soaring 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -3
- data/lib/soaring/cli.rb +1 -3
- data/lib/soaring/packager.rb +17 -11
- data/lib/soaring/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90d04662980ccaf615364b1c93c178d6ac5f47d7
|
4
|
+
data.tar.gz: dff57f92cbe3dff16b4a585f02b3c660ef9cec5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 593ae88af95fafd6d68378f5775e4c8e55f719490dea9091156f04a656b22a67965125e964da359979fb00def336992a642327ceb302699c794ba1e6310f9d5a
|
7
|
+
data.tar.gz: 20d2ddae1794116def8480097a790418057b2d1f5ab3062b3b5c2fbb3eecbbb30a10d5ddbc8a6723c02e861276cbb4f9a09b1566dcbdf755cb46ce23f94ec457
|
data/README.md
CHANGED
@@ -10,13 +10,17 @@ Install the gem from rubygems as follow:
|
|
10
10
|
|
11
11
|
## Creating a new project
|
12
12
|
|
13
|
+
Create a repo on github/gitlab, clone locally and enter project folder:
|
14
|
+
git clone git@github.com:hetznerZA/my-awesome-service-component.git
|
15
|
+
cd my-awesome-service-component
|
16
|
+
|
13
17
|
Create the fresh project skeleton:
|
14
18
|
soaring init
|
15
19
|
|
16
|
-
Switch to the appropriate ruby version and install the gem dependencies
|
20
|
+
Switch to the appropriate ruby version and install the gem dependencies:
|
17
21
|
rvm use . && bundle install
|
18
22
|
|
19
|
-
Create an environment.yml file by copying the example:
|
23
|
+
Create an environment.yml file by copying the example and updating to your needs:
|
20
24
|
cp config/environment.yml.example config/environment.yml
|
21
25
|
|
22
26
|
## Running a service component locally
|
@@ -24,10 +28,13 @@ Create an environment.yml file by copying the example:
|
|
24
28
|
Start up a local instance of the service component to check that all is well
|
25
29
|
soaring run
|
26
30
|
|
27
|
-
This will default to a MRI ruby rack application running with the following defaults
|
31
|
+
This will default to a MRI ruby rack application running with the following defaults:
|
28
32
|
port = 9393
|
29
33
|
environment = 'development'
|
30
34
|
|
35
|
+
These defaults can be overriden using parameters passed to soaring. View the command line options:
|
36
|
+
soaring -h
|
37
|
+
|
31
38
|
## Packaging the service component for deployment
|
32
39
|
|
33
40
|
Make sure your git repo is committed and pushed to master. Execute the following command.
|
data/lib/soaring/cli.rb
CHANGED
@@ -5,9 +5,7 @@ module Soaring
|
|
5
5
|
def self.start(argv)
|
6
6
|
@project_folder = Dir.pwd
|
7
7
|
command, options = self.parse
|
8
|
-
|
9
|
-
puts "executing #{command} with #{options}" if options[:verbose]
|
10
|
-
|
8
|
+
puts "#{command} with #{options}" if options[:verbose]
|
11
9
|
self.send("execute_#{command}",options)
|
12
10
|
end
|
13
11
|
|
data/lib/soaring/packager.rb
CHANGED
@@ -5,27 +5,33 @@ module Soaring
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def package(project_folder)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
service_name = File.split(project_folder)[-1]
|
12
|
-
service_revision = get_service_component_revision
|
13
|
-
revision_hash = `git rev-parse --short HEAD`.chomp
|
14
|
-
timestamp = Time.now.strftime("%F-%H%M%S")
|
15
|
-
build_output_location = "build/build-#{service_name}-#{service_revision}-#{revision_hash}-#{timestamp}.zip"
|
8
|
+
validate_project
|
9
|
+
build_output_location = generate_build_output_location
|
16
10
|
`zip -r #{build_output_location} * .ebextensions -x build -x config/environment.yml`
|
17
|
-
puts "Build packaged at #{
|
11
|
+
puts "Build packaged at #{build_output_location}"
|
18
12
|
end
|
19
13
|
|
20
14
|
private
|
21
15
|
|
22
|
-
def
|
16
|
+
def validate_project
|
17
|
+
|
18
|
+
if (not is_git_repo_up_to_date?) and (not @options[:ignore_git_checks])
|
19
|
+
puts "Local git repo is dirty and should not be packaged"
|
20
|
+
exit 1
|
21
|
+
end
|
22
|
+
puts 'Local git repo up to date.' if @options[:verbose]
|
23
|
+
end
|
24
|
+
|
25
|
+
def generate_build_output_location
|
26
|
+
service_name = File.split(project_folder)[-1]
|
27
|
+
revision_hash = `git rev-parse --short HEAD`.chomp
|
28
|
+
timestamp = Time.now.strftime("%F-%H%M%S")
|
29
|
+
"#{project_folder}/build/build_#{service_name}_#{revision_hash}_#{timestamp}.zip"
|
23
30
|
end
|
24
31
|
|
25
32
|
def is_git_repo_up_to_date?
|
26
33
|
git_response = `git status --porcelain`.chomp
|
27
34
|
return true if '' == git_response
|
28
|
-
puts "Git repo is dirty and should not be packaged"
|
29
35
|
false
|
30
36
|
end
|
31
37
|
end
|
data/lib/soaring/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soaring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barney de Villiers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|