orchestration 0.7.10 → 0.7.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aea7091859513085daaa652226e9e6e2eaad838f8cea0fc5e4f92baabf231d66
4
- data.tar.gz: 01f656a8e0a4c94679ea1cede73a276345dd097254c8feee73ecf4d71c6ae0f8
3
+ metadata.gz: 20aff7348ec0fde4cf7a457138a2f4ea67f5467c25cde74757e6f1f1ebccd7d3
4
+ data.tar.gz: bd582b8b42c353ec86d2c3dadd8932dc24fe3123784dd62f1bdaa62eea934ac8
5
5
  SHA512:
6
- metadata.gz: aac8c41311328ee9285d9d3172baed798ca89a17a9311c16bd2dfd75ff2ee9631b4f8b464c208d0e607cd9c488641e8cce33fc6988204d5812b4ac1abd428861
7
- data.tar.gz: 6c5bd17caaa053100b721f78fe93620aa8579e55c141b35a477ce162ed1929bb10a2e073d2f4b8ca6e5ca3ffe110d862bab3bfdce1b33f332431fdd3d5fbef98
6
+ metadata.gz: be08355e64f4f66fe249a447b816c9f98d72f94a8c32ab79b22236700755f930aab6a6d1e3a481f9c7ae01b73c387bcc82516256bd61220e35be909bc58ed09f
7
+ data.tar.gz: 2166504bbb6fb34c349bf1e15c7a5f50107b65f7869accfbee6edccb9c9dc98d2b1c2bd65de9e9d8c75489867d803b5a8f485a814a1901e189f12d09fdfb9167
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- orchestration (0.7.10)
4
+ orchestration (0.7.11)
5
5
  database_url (~> 0.1.2)
6
6
  dotenv-rails (~> 2.8)
7
7
  erubis (~> 2.7)
@@ -17,6 +17,8 @@ module Orchestration
17
17
  end
18
18
 
19
19
  def orchestration_configuration
20
+ return unless build?('.orchestration.yml')
21
+
20
22
  configure_orchestration_settings
21
23
  relpath = relative_path(@env.orchestration_configuration_path)
22
24
  return @terminal.write(:create, relpath) unless @settings.exist? || force?
@@ -26,11 +28,15 @@ module Orchestration
26
28
  end
27
29
 
28
30
  def application_makefile
31
+ return unless build?('Makefile')
32
+
29
33
  path = @env.root.join('Makefile')
30
34
  simple_copy('application.mk', path) unless File.exist?(path)
31
35
  end
32
36
 
33
37
  def dockerfile
38
+ return unless build?('Dockerfile')
39
+
34
40
  create_file(
35
41
  orchestration_dir.join('Dockerfile'),
36
42
  dockerfile_content,
@@ -39,6 +45,8 @@ module Orchestration
39
45
  end
40
46
 
41
47
  def entrypoint_sh
48
+ return unless build?('entrypoint.sh')
49
+
42
50
  content = template('entrypoint.sh')
43
51
  path = orchestration_dir.join('entrypoint.sh')
44
52
  create_file(path, content, overwrite: false)
@@ -46,12 +54,15 @@ module Orchestration
46
54
  end
47
55
 
48
56
  def docker_compose
57
+ return unless build?('docker-compose.yml')
58
+
49
59
  @docker_compose.docker_compose_test_yml
50
60
  @docker_compose.docker_compose_development_yml
51
61
  @docker_compose.docker_compose_deployment_yml
52
62
  end
53
63
 
54
64
  def puma
65
+ return unless build?('puma.rb')
55
66
  return nil unless @env.web_server == 'puma'
56
67
 
57
68
  content = template('puma.rb')
@@ -60,6 +71,7 @@ module Orchestration
60
71
  end
61
72
 
62
73
  def unicorn
74
+ return unless build?('unicorn.rb')
63
75
  return nil unless @env.web_server == 'unicorn'
64
76
 
65
77
  content = template('unicorn.rb')
@@ -70,6 +82,7 @@ module Orchestration
70
82
  end
71
83
 
72
84
  def database_yml
85
+ return unless build?('database.yml')
73
86
  return unless defined?(::ActiveRecord)
74
87
 
75
88
  adapter = DockerCompose::ComposeConfiguration.database_adapter_name
@@ -79,28 +92,35 @@ module Orchestration
79
92
  end
80
93
 
81
94
  def mongoid_yml
95
+ return unless build?('mongoid.yml')
82
96
  return unless defined?(::Mongoid)
83
97
 
84
98
  service_config('mongoid.yml', Services::Mongo::Configuration)
85
99
  end
86
100
 
87
101
  def rabbitmq_yml
102
+ return unless build?('rabbitmq.yml')
88
103
  return unless defined?(::Bunny)
89
104
 
90
105
  service_config('rabbitmq.yml', Services::RabbitMQ::Configuration)
91
106
  end
92
107
 
93
108
  def redis_yml
109
+ return unless build?('redis.yml')
94
110
  return unless defined?(::Redis)
95
111
 
96
112
  service_config('redis.yml', Services::Redis::Configuration)
97
113
  end
98
114
 
99
115
  def env
116
+ return unless build?('.env')
117
+
100
118
  simple_copy('env', @env.root.join('.env'), overwrite: false)
101
119
  end
102
120
 
103
121
  def gitignore
122
+ return unless build?('.gitignore')
123
+
104
124
  path = @env.root.join('.gitignore')
105
125
  globs = %w[.build/ .deploy/ Gemfile Gemfile.lock docker-compose.local.yml]
106
126
  lines = %w[orchestration/.sidecar .env deploy.tar] + globs.map do |line|
@@ -112,6 +132,13 @@ module Orchestration
112
132
 
113
133
  private
114
134
 
135
+ def build?(filename)
136
+ return true unless ENV.key?('build')
137
+ return true if ENV.fetch('build') == filename
138
+
139
+ false
140
+ end
141
+
115
142
  def t(key)
116
143
  I18n.t("orchestration.#{key}")
117
144
  end
@@ -386,14 +386,13 @@ tag:
386
386
  .PHONY: deploy
387
387
  deploy: _log-notify _clean-logs
388
388
  ifdef env_file
389
- deploy: env_file_option = --env-file ${env_file}
389
+ deploy: env_file_option = . ${env_file}
390
390
  endif
391
391
  deploy: RAILS_ENV := ${env}
392
392
  deploy: RACK_ENV := ${env}
393
393
  deploy: DOCKER_TAG = ${git_version}
394
394
  deploy: base_vars = DOCKER_ORGANIZATION=${docker_organization} DOCKER_REPOSITORY=${docker_repository} DOCKER_TAG=${git_version}
395
- deploy: compose_deploy := ${base_vars} COMPOSE_PROJECT_NAME=${project_base} HOST_UID=$(shell id -u) docker-compose ${env_file_option} --project-name ${project_base} -f orchestration/docker-compose.deployment.yml
396
- deploy: config_cmd = ${compose_deploy} config
395
+ deploy: config_cmd := ( set -a ; ${env_file_option} ; ${base_vars} COMPOSE_PROJECT_NAME=${project_base} HOST_UID=$(shell id -u) docker stack config --compose-file orchestration/docker-compose.deployment.yml )
397
396
  deploy: remote_cmd = cat | docker stack deploy --prune --with-registry-auth -c - ${project_base}
398
397
  deploy: ssh_cmd = ssh "${manager}"
399
398
  deploy: deploy_cmd := ${config_cmd} | ${ssh_cmd} "/bin/bash -lc '${remote_cmd}'"
@@ -2,20 +2,23 @@ FROM ruby:<%= ruby_version %>
2
2
  ARG BUNDLE_BITBUCKET__ORG
3
3
  ARG BUNDLE_GITHUB__COM
4
4
  ARG GIT_COMMIT
5
- RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
6
- && apt-get update \
5
+ ENV NODE_MAJOR=20
6
+ RUN apt-get update \
7
7
  && DEBIAN_FRONTEND=noninteractive apt-get install -y \
8
- nodejs \
9
8
  gosu \
10
9
  sendmail \
10
+ cron \
11
+ ca-certificates \
12
+ curl \
13
+ gnupg \
14
+ && mkdir -p /etc/apt/keyrings \
15
+ && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
16
+ && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
17
+ && apt-get update \
18
+ && DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs \
11
19
  && rm -rf /var/lib/apt/lists/* \
12
20
  && gem install bundler \
13
21
  && mkdir /app<%if defined?(Webpacker) %> \
14
- && curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash \
15
- && . /root/.bashrc \
16
- && nvm install 14.16.0 \
17
- && npm config set user 0 \
18
- && npm config set unsafe-perm true \
19
22
  && npm install -g yarn<% end %>
20
23
  WORKDIR /app
21
24
  COPY .build/Gemfile .build/Gemfile.lock ./
@@ -23,7 +26,7 @@ RUN bundle config set deployment 'true' \
23
26
  && bundle config set without 'development test' \
24
27
  && bundle install
25
28
  ADD .build/context.tar .
26
- <% if defined?(Webpacker) %>RUN . /root/.bashrc ; NODE_ENV=production RAILS_ENV=production yarn install && NODE_ENV=production RAILS_ENV=production SECRET_KEY_BASE=placeholder-secret bundle exec rake assets:precompile<% elsif Rake::Task.tasks.map(&:name).include?('assets:precompile') %>RUN NODE_ENV=production RAILS_ENV=production SECRET_KEY_BASE=placeholder-secret bundle exec rake assets:precompile<% end %>
29
+ <% if defined?(Webpacker) %>RUN NODE_ENV=production RAILS_ENV=production yarn install && NODE_ENV=production RAILS_ENV=production SECRET_KEY_BASE=placeholder-secret bundle exec rake assets:precompile<% elsif Rake::Task.tasks.map(&:name).include?('assets:precompile') %>RUN NODE_ENV=production RAILS_ENV=production SECRET_KEY_BASE=placeholder-secret bundle exec rake assets:precompile<% end %>
27
30
  RUN echo "${GIT_COMMIT}" > /app/GIT_COMMIT
28
31
  HEALTHCHECK --interval=<%= healthcheck['interval'] %> \
29
32
  --timeout=<%= healthcheck['timeout'] %> \
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Orchestration
4
- VERSION = '0.7.10'
4
+ VERSION = '0.7.12'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orchestration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.10
4
+ version: 0.7.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-12 00:00:00.000000000 Z
11
+ date: 2023-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: database_url