shiplane 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +27 -0
- data/lib/generators/shiplane/install/templates/shiplane.yml.erb +7 -6
- data/lib/shiplane/build.rb +2 -2
- data/lib/shiplane/checkout_artifact.rb +27 -2
- data/lib/shiplane/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad2ef91c7eb7f85d8f3e56390ae719034c3877fe1125084a21becde82d1cb708
|
4
|
+
data.tar.gz: c27d7f18396f5f79c0650e60822cdab1e86d922150a71ce6d07f578ab17d5d80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7eaae21149786351ae740e5c55ddc0375b5cf212b0ce0b1f9f9f819aa5229d70ceabb1bc4bd08c0623176fa783b3d618a58dd0ea3b60a520a4d7e35bd043423
|
7
|
+
data.tar.gz: d860ac1e9ba8ea1ad68d6e86f78f203c028f0107273cdc0f5b9574f1099ca2637adf908ecaa2f358e60e2ac6b0a1c64019f7fd877b9046a2bc1d4d16723ba528
|
data/README.md
CHANGED
@@ -118,6 +118,33 @@ You can build a docker container based on the HEAD of your current branch like s
|
|
118
118
|
bundle exec cap production shiplane
|
119
119
|
```
|
120
120
|
|
121
|
+
### Environment Variables
|
122
|
+
Shiplane uses specific .env files to make sure that a given build environment contains the appropriate environment variables. These are used for 3 separate purposes:
|
123
|
+
- The environment that the Shiplane process is running in. For example, if you want to authenticate with a Github private repo, you will need to set the GITHUB_TOKEN environment variable in your .env file so that Shiplane can authenticate.
|
124
|
+
- The buildtime step of building the container. If your container needs environment variables to be set during buildtime so that the container can be built, you will need these builtime env variables. Examples might include a Github Token used to pull dependencies from private repositories on Github during buildtime. These variables will not be stored in your container, but you may need to remove any traces of these variables that might be stored in your container as side effects if your dependency ecosystem does this. For example, Ruby Gems downloaded during buildtime using an Github Token will result in that token being stored in the Gemfile.lock file. The [examples folder](examples/rails_app/.shiplane/production_dockerfile_stages) provide an example of a means of removing this after bundling. You may consider a similar step during your build process.
|
125
|
+
- The runtime environment may require some environment variables. For example, you might have a bunch of ENVIRONMENT VARIABLES necessary for your application to run (less secure, but simpler), or, you might need an environment variable to access a vault somewhere containing other runtime ENVIRONMENT VARIABLES (more secure, slightly more difficult), or, you may have none at all and use another mechanism to inject appropriate settings (you have more control over this, but the most difficult).
|
126
|
+
|
127
|
+
## Important ENVIRONMENT VARIABLES for the Shiplane Process
|
128
|
+
```sh
|
129
|
+
GITHUB_TOKEN=XXXXXXXXXX # required if pulling from a private Github Repository
|
130
|
+
BITBUCKET_TOKEN=XXXXXXXXXX # required if pulling from a private Bitbucket Repository
|
131
|
+
BITBUCKET_USERNAME=XXXXXXXXXX # required if pulling from a private Bitbucket Repository
|
132
|
+
```
|
133
|
+
|
134
|
+
## Important ENVIRONMENT VARIABLES for buildtime
|
135
|
+
```sh
|
136
|
+
DOCKERHUB_PASSWORD=XXXXXXXXXX # deprecated but still supported token/password specifically for DOCKERHUB
|
137
|
+
DOCKERHUB_USERNAME=XXXXXXXXXX # deprecated but still supported username specifically for DOCKERHUB
|
138
|
+
SHIPLANE_CONTAINER_REGISTRY_TOKEN=XXXXXXXXXX # Token for container registry authentication
|
139
|
+
SHIPLANE_CONTAINER_REGISTRY_USERNAME=XXXXXXXXXX # Username for container registry authentication
|
140
|
+
RAISE_EXCEPTIONS_ON_FAILED_BUILD=true # Tells Shiplane to stop on a failed build and raise an exception. Defaults to 'false'
|
141
|
+
```
|
142
|
+
## Important ENVIRONMENT VARIABLES for runtime
|
143
|
+
# Rails Environment Variable sample
|
144
|
+
```sh
|
145
|
+
RAILS_MASTER_KEY=XXXXXXXXXX
|
146
|
+
```
|
147
|
+
|
121
148
|
#### Deploying
|
122
149
|
Shiplane provides tasks to help you deploy your code. These tasks depend on your deployment framework, but each task appropriately launches your docker containers on your selected framework.
|
123
150
|
|
@@ -1,17 +1,18 @@
|
|
1
1
|
project:
|
2
2
|
appname: <%= app_name %>
|
3
3
|
version_control: git
|
4
|
-
#
|
5
|
-
# origin
|
4
|
+
version_control_host: github # alternately, use `bitbucket` if your application is hosted on BitBucket
|
5
|
+
# The origin url on Github or Bitbucket
|
6
|
+
origin: #username/<%= app_name %>
|
6
7
|
bootstrap:
|
7
8
|
env_file: .env.production
|
8
9
|
chef-bootstrapper:
|
9
|
-
package_name: chefdk_3.
|
10
|
-
package_url: https://packages.chef.io/files/stable/chefdk/3.
|
10
|
+
package_name: chefdk_3.6.57-1_amd64.deb
|
11
|
+
package_url: https://packages.chef.io/files/stable/chefdk/3.6.57/ubuntu/18.04/chefdk_3.6.57-1_amd64.deb
|
11
12
|
build:
|
12
13
|
registry:
|
13
14
|
# url: ghcr.io # for Github Container Service. Should work for similar services such as Gitlab
|
14
|
-
# url:
|
15
|
+
# url: dockerhub # for default Dockerhub Service
|
15
16
|
settings_folder: .shiplane
|
16
17
|
environment_file: .env.production
|
17
18
|
compose_filepath: docker-compose.yml
|
@@ -20,7 +21,7 @@ build:
|
|
20
21
|
artifacts:
|
21
22
|
container-name:
|
22
23
|
tag: <%= app_name %>-base:latest
|
23
|
-
repo:
|
24
|
+
repo: #username/<%= app_name %>
|
24
25
|
ports:
|
25
26
|
- "3000:3000"
|
26
27
|
compose:
|
data/lib/shiplane/build.rb
CHANGED
@@ -53,7 +53,7 @@ module Shiplane
|
|
53
53
|
end
|
54
54
|
rescue StepFailureException => e
|
55
55
|
puts e.message
|
56
|
-
raise if ENV['RAISE_EXCEPTIONS_ON_FAILED_BUILD']
|
56
|
+
raise if ENV['RAISE_EXCEPTIONS_ON_FAILED_BUILD'] == 'true'
|
57
57
|
end
|
58
58
|
|
59
59
|
def steps(artifact_name, attributes)
|
@@ -147,7 +147,7 @@ module Shiplane
|
|
147
147
|
end
|
148
148
|
|
149
149
|
def dockerhub?
|
150
|
-
registry_configuration['url'] ==
|
150
|
+
registry_configuration['url'].to_s == 'dockerhub'
|
151
151
|
end
|
152
152
|
|
153
153
|
def token_auth?
|
@@ -21,12 +21,37 @@ module Shiplane
|
|
21
21
|
@appname ||= project_config['appname']
|
22
22
|
end
|
23
23
|
|
24
|
+
def bitbucket_origin?
|
25
|
+
project_config['version_control_host'] == 'bitbucket'
|
26
|
+
end
|
27
|
+
|
28
|
+
def github_origin?
|
29
|
+
project_config['version_control_host'] == 'github'
|
30
|
+
end
|
31
|
+
|
24
32
|
def github_token
|
25
33
|
@github_token ||= ENV['GITHUB_TOKEN']
|
26
34
|
end
|
27
35
|
|
36
|
+
def bitbucket_token
|
37
|
+
@bitbucket_token ||= ENV['BITBUCKET_APP_PASSWORD']
|
38
|
+
end
|
39
|
+
|
40
|
+
def bitbucket_username
|
41
|
+
@bitbucket_username ||= ENV['BITBUCKET_APP_USERNAME']
|
42
|
+
end
|
43
|
+
|
28
44
|
def git_url
|
29
|
-
|
45
|
+
return github_url if github_origin?
|
46
|
+
return bitbucket_url if bitbucket_origin?
|
47
|
+
end
|
48
|
+
|
49
|
+
def github_url
|
50
|
+
"https://#{github_token ? "#{github_token}@" : ''}github.com/#{project_config['origin']}/archive/#{sha}.tar.gz"
|
51
|
+
end
|
52
|
+
|
53
|
+
def bitbucket_url
|
54
|
+
"https://#{bitbucket_token ? "#{bitbucket_username}:#{bitbucket_token}@" : ''}bitbucket.org/#{project_config['origin']}/get/#{sha}.tar.gz"
|
30
55
|
end
|
31
56
|
|
32
57
|
def app_directory
|
@@ -67,7 +92,7 @@ module Shiplane
|
|
67
92
|
def download_archive
|
68
93
|
return true if File.exist? archive_path
|
69
94
|
|
70
|
-
system("curl -L #{git_url}
|
95
|
+
system("curl -L #{git_url} --output #{archive_path}")
|
71
96
|
end
|
72
97
|
|
73
98
|
def unpack_archive
|
data/lib/shiplane/version.rb
CHANGED
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.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Epperson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-16 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.
|
19
|
+
version: 0.2.8
|
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.
|
26
|
+
version: 0.2.8
|
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.
|
33
|
+
version: 0.2.8
|
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.
|
40
|
+
version: 0.2.8
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: dotenv
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|