shiplane 0.2.2 → 0.2.3

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: 24630dde655efe6157f41b56971d38dae1756785a8986a56b2a29dd159a9ff32
4
- data.tar.gz: f1a246d2253e9042b9d63034de457cc48fceec19d818a30aaaca83e605788fe0
3
+ metadata.gz: a65c39ac05e2fac9eb88f9e80706577318ce04fe04f782d2a9730bc24000b218
4
+ data.tar.gz: adf16d46271c06b14f320ffe00bcdbb98d83dca3bcd3f5127bdbf3089b348b0c
5
5
  SHA512:
6
- metadata.gz: 3e3277e0f480bd4f1762dc1e49e064c856aed3dbae1c94577610b155f27daa400da97294f13006302dcfb116c3be8e458f831177eec53a82967210dde567deeb
7
- data.tar.gz: 6f686d80e59aded2d251c17b155624ce1f005c8182426e8c13c34a323f7c12b9d4e253b0dd7a0ddbca1ba3508381ddae9de4c45567d9b0fc22bb083ad1dbc35d
6
+ metadata.gz: '08be86c9d7d83f8df85d111ab1f623d0c34683bbff17f50ef7e1139aee5a27862c078cb649b9256f4912f8139b1a3afde7358f7561d410f566a572bc49c5316c'
7
+ data.tar.gz: 5d65f4e2c62243105f865fe47deeb12e3a3b2fcd62e0e02842ae29ed086db883a28748ec497976faa37317d70d32dbd1d90f98fe32d8f046ff22983a6d7d1a97
@@ -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',
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shiplane
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
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.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Epperson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-18 00:00:00.000000000 Z
11
+ date: 2021-05-02 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.2.2
19
+ version: 0.2.3
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.2.2
26
+ version: 0.2.3
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.2.2
33
+ version: 0.2.3
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.2.2
40
+ version: 0.2.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: dotenv
43
43
  requirement: !ruby/object:Gem::Requirement