shiplane 0.1.17 → 0.2.5

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: 3ae8f35e9d9eb37af8026cc7664a99a91df38b4509013077f346b19b09120c68
4
- data.tar.gz: 6187a0375ef86304831505932a475d046afa0b74d81a3214a11bcd27ea50beef
3
+ metadata.gz: e6287f0c051a021eda164d50d8aa8c1b6188558346c482cdaae3138cdc5530bf
4
+ data.tar.gz: 50d05109e351a27dac7a9a1756cec67d0a986aa3d095c181704651b639a6eaa7
5
5
  SHA512:
6
- metadata.gz: 24e26faa8239207b66a7d47b72cee33a0b48641d3574123422d2b861254c2302585708001cc69810d163cbe2535190aa4d13e8923d1b420f87d013ba83bff963
7
- data.tar.gz: b0e074456a000474e575ca1f273bf2eb49128de78d96f68e9859dba0b1c58a8416077571d4f03aba023745298648be7a91e08779ef7ee8d9fa1d1cd6d451db0f
6
+ metadata.gz: 0e525defd47ffc63fc57b53f78c6c2b232e375b9457b2554b2d670cbea5d3fe38e863b9e29a474737d97b79c23f153077623b78e39fa5d7f66edaadd94c8623a
7
+ data.tar.gz: 119147343d5d80fdd768eefd56c734b55c4c04b9deb0dc133c0b41d537fa9ff31b9caad55a810c6b89de668745e8dd275df736053f07cd65661e20e6245d2944
@@ -8,7 +8,7 @@ lock '3.11.0'
8
8
  set :application, 'podcaster'
9
9
  set :repo_url, 'git@github.com:kirillian/podcaster.git'
10
10
 
11
- set :deploy_to, '/var/www/battlecryforfreedom'
11
+ set :deploy_to, '/var/www/my_app_network'
12
12
 
13
13
  # Default value for :log_level is :debug
14
14
  # set :log_level, :debug
@@ -54,8 +54,21 @@ set :sha, `git rev-parse HEAD`.chomp
54
54
  set :shiplane_docker_registry_username, ENV['DOCKERHUB_USERNAME']
55
55
  set :shiplane_docker_registry_password, ENV['DOCKERHUB_PASSWORD']
56
56
 
57
+
58
+ set :shiplane_build_environment_variables, {
59
+ # The following example Fetches RAILS_ENV from your Capistrano environment-specific configuration
60
+ # RAILS_ENV: proc { fetch(:rails_env, 'production') },
61
+ }
62
+
63
+ # The following setting points shiplane to Github's Registry
64
+ # set :shiplane_docker_registry_url, 'ghcr.io'
65
+
66
+ # The following settings assign the username and token/password needed to login to a given registry
67
+ # set :shiplane_docker_registry_username, ENV['SHIPLANE_CONTAINER_REGISTRY_USERNAME']
68
+ # set :shiplane_docker_registry_token, ENV['SHIPLANE_CONTAINER_REGISTRY_TOKEN']
69
+
57
70
  set :shiplane_networks, {
58
- battlecryforfreedom: {
71
+ my_app_network: {
59
72
  connections: [
60
73
  "nginx_reverse_proxy",
61
74
  "nginx-proxy-letsencrypt",
@@ -65,28 +78,28 @@ set :shiplane_networks, {
65
78
 
66
79
  set :shiplane_containers, {
67
80
  app: {
68
- alias: 'battlecryforfreedom-app',
81
+ alias: 'my_app-app',
69
82
  volumes: [],
70
83
  environment: [],
71
84
  expose: 3000,
72
85
  capistrano_role: "docker",
73
- repo: "kirillian2/podcaster",
86
+ repo: "my_docker_repo_account_name/my_docker_repo",
74
87
  command: 'bin/start',
75
- virtual_host: "battlecryforfreedom.com",
76
- letsencrypt_email: "john.epperson@battlecryforfreedom.com",
88
+ virtual_host: "my_app.com",
89
+ letsencrypt_email: "john.epperson@my_app_network.com",
77
90
  networks: [
78
- "battlecryforfreedom"
91
+ "my_app_network"
79
92
  ],
80
93
  },
81
94
  sidekiq: {
82
- alias: 'battlecryforfreedom-sidekiq',
95
+ alias: 'my_app-sidekiq',
83
96
  volumes: [],
84
97
  environment: [],
85
98
  capistrano_role: "docker",
86
- repo: "kirillian2/podcaster",
99
+ repo: "my_docker_repo_account_name/my_docker_repo",
87
100
  command: 'bin/start_sidekiq_workers',
88
101
  networks: [
89
- "battlecryforfreedom"
102
+ "my_app_network"
90
103
  ],
91
104
  },
92
105
  redis: {
@@ -101,22 +114,37 @@ set :shiplane_containers, {
101
114
  repo: "redis",
102
115
  tag: "4.0.9-alpine",
103
116
  networks: [
104
- "battlecryforfreedom"
117
+ "my_app_network"
105
118
  ],
119
+ deploy: {
120
+ # This setting will tell shiplane NOT to restart this container every deploy
121
+ restart: false,
122
+ },
106
123
  },
107
124
  postgres: {
108
125
  alias: 'postgres',
109
126
  volumes: [
110
127
  "/var/lib/postgres/data:/var/lib/postgresql/data",
111
128
  ],
129
+ environment: {
130
+ POSTGRES_PASSWORD: ENV['DATABASE_PASSWORD'],
131
+ POSTGRES_USER: ENV['DATABASE_USERNAME'],
132
+ },
133
+ flags: {
134
+ 'shm-size' => '256MB',
135
+ },
112
136
  expose: 5432,
113
137
  publish: 5432,
114
138
  capistrano_role: "docker",
115
139
  repo: "postgres",
116
140
  tag: "9.6",
117
141
  networks: [
118
- "battlecryforfreedom"
142
+ "my_app_network"
119
143
  ],
144
+ deploy: {
145
+ # This setting will tell shiplane NOT to restart this container every deploy
146
+ restart: false,
147
+ },
120
148
  },
121
149
  }
122
150
 
@@ -6,6 +6,8 @@ COPY . $APP_PATH
6
6
 
7
7
  WORKDIR $APP_PATH
8
8
 
9
+ ARG RAILS_ENV production
10
+ ENV RAILS_ENV $RAILS_ENV
9
11
  ARG GITHUB_TOKEN
10
12
  ENV GITHUB_TOKEN $GITHUB_TOKEN
11
13
  ENV SHIPLANE building
@@ -36,7 +38,8 @@ WORKDIR $APP_PATH
36
38
  RUN bundle config --local path vendor/bundle
37
39
  RUN bundle config --local without development:test:assets
38
40
 
39
- ENV RAILS_ENV production
41
+ ARG RAILS_ENV production
42
+ ENV RAILS_ENV $RAILS_ENV
40
43
  ENV SHIPLANE running
41
44
  ENV RAILS_LOG_TO_STDOUT true
42
45
  ENV RAILS_SERVE_STATIC_FILES true
@@ -6,8 +6,8 @@ project:
6
6
  bootstrap:
7
7
  env_file: .env.production
8
8
  chef-bootstrapper:
9
- package_name: chefdk_3.6.57-1_amd64.deb
10
- package_url: https://packages.chef.io/files/stable/chefdk/3.6.57/ubuntu/18.04/chefdk_3.6.57-1_amd64.deb
9
+ package_name: chefdk_3.13.1-1_amd64.deb
10
+ package_url: https://packages.chef.io/files/stable/chefdk/3.13.1/ubuntu/16.04/chefdk_3.13.1-1_amd64.deb
11
11
  build:
12
12
  registry:
13
13
  # url: ghcr.io # for Github Container Service. Should work for similar services such as Gitlab
@@ -34,9 +34,9 @@ build:
34
34
  - services.container-name.depends_on
35
35
  deploy:
36
36
  servers:
37
- # put the server domain or ip address here
37
+ # `server-url` is your server domain or ip address here (e.g. `12.345.67.89` or `myapp.com`)
38
38
  server-url:
39
- # Only set this flag if you need docker to run as the sudo user (default Ubuntu AMI on AWS requires this)
39
+ # Only set this flag if you need docker to escalate permissions and run everything as sudo (default Ubuntu AMI on AWS requires this)
40
40
  requires_sudo: false
41
41
  # Put SSH options here
42
42
  # ssh_options:
@@ -19,6 +19,16 @@ module Shiplane
19
19
  @postfix = postfix
20
20
 
21
21
  Dotenv.overload File.join(Dir.pwd, build_config.fetch('environment_file', '.env'))
22
+
23
+ # Add any ENV variable overrides from the capistrano configuration
24
+ environment_variable_overrides = fetch(:shiplane_build_environment_variables, {})
25
+ environment_variable_overrides.each do |key, value|
26
+ if value.is_a? Proc
27
+ ENV[key.to_s] = value.call
28
+ else
29
+ ENV[key.to_s] = value
30
+ end
31
+ end
22
32
  end
23
33
 
24
34
  def build!
@@ -73,7 +83,7 @@ module Shiplane
73
83
  def token_login_command
74
84
  @token_login_command ||= [
75
85
  'echo',
76
- login_token,
86
+ "\"#{login_token}\"",
77
87
  '|',
78
88
  'docker',
79
89
  'login',
@@ -44,7 +44,11 @@ module Shiplane
44
44
  end
45
45
 
46
46
  def virtual_host
47
- @virtual_host ||= options[:virtual_host]
47
+ return @virtual_host if defined?(@virtual_host) && @virtual_host
48
+
49
+ if options[:virtual_host]
50
+ @virtual_host = options[:virtual_host].is_a?(Proc) ? options[:virtual_host].call : options[:virtual_host]
51
+ end
48
52
  end
49
53
 
50
54
  def letsencrypt_host
@@ -64,7 +68,7 @@ module Shiplane
64
68
  end
65
69
 
66
70
  def network_connect_commands(role)
67
- @network_commands ||= networks.map do |network|
71
+ @network_commands ||= networks[1..-1].map do |network|
68
72
  [
69
73
  docker_command(role),
70
74
  "network connect",
@@ -84,6 +88,8 @@ module Shiplane
84
88
  published_ports.map{|port| "-p #{port}" },
85
89
  exposed_ports.map{|port| "--expose #{port}" },
86
90
  "--name #{unique_container_name}",
91
+ "--network=#{networks.first}",
92
+ "--network-alias=#{network_alias}",
87
93
  virtual_host ? "-e VIRTUAL_HOST=#{virtual_host}" : nil,
88
94
  letsencrypt_host ? "-e LETSENCRYPT_HOST=#{letsencrypt_host}" : nil,
89
95
  letsencrypt_email ? "-e LETSENCRYPT_EMAIL=#{letsencrypt_email}" : nil,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shiplane
4
- VERSION = "0.1.17"
4
+ VERSION = "0.2.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shiplane
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Epperson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-26 00:00:00.000000000 Z
11
+ date: 2021-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shiplane_bootstrappers_chef
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.17
19
+ version: 0.2.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.17
26
+ version: 0.2.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: shiplane_deployers_capistrano_docker
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.17
33
+ version: 0.2.5
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.17
40
+ version: 0.2.5
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: dotenv
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -156,7 +156,7 @@ homepage: https://github.com/kirillian/shiplane
156
156
  licenses:
157
157
  - MIT
158
158
  metadata: {}
159
- post_install_message:
159
+ post_install_message:
160
160
  rdoc_options: []
161
161
  require_paths:
162
162
  - lib
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  requirements: []
174
174
  rubygems_version: 3.0.3
175
- signing_key:
175
+ signing_key:
176
176
  specification_version: 4
177
177
  summary: A toolbox for converting developer docker-compose files into production-ready
178
178
  images.