vx-builder 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/lib/vx/builder/configuration.rb +1 -1
- data/lib/vx/builder/helper/vxvm_install.rb +19 -0
- data/lib/vx/builder/script_builder/base.rb +1 -0
- data/lib/vx/builder/script_builder/cache.rb +1 -1
- data/lib/vx/builder/script_builder/go.rb +5 -8
- data/lib/vx/builder/script_builder/prepare.rb +2 -2
- data/lib/vx/builder/script_builder/ruby.rb +5 -19
- data/lib/vx/builder/version.rb +1 -1
- data/lib/vx/builder.rb +2 -1
- data/spec/fixtures/integration/go/language/after_script.sh +4 -4
- data/spec/fixtures/integration/go/language/before_script.sh +25 -25
- data/spec/fixtures/integration/ruby/deploy/after_script.sh +15 -0
- data/spec/fixtures/integration/ruby/deploy/before_script.sh +70 -0
- data/spec/fixtures/integration/ruby/deploy/script.sh +8 -0
- data/spec/fixtures/integration/ruby/language/after_script.sh +5 -5
- data/spec/fixtures/integration/ruby/language/before_script.sh +23 -22
- data/spec/fixtures/integration/ruby/matrix/0.after_script.sh +5 -5
- data/spec/fixtures/integration/ruby/matrix/0.before_script.sh +23 -22
- data/spec/fixtures/integration/ruby/matrix/1.after_script.sh +5 -5
- data/spec/fixtures/integration/ruby/matrix/1.before_script.sh +23 -22
- data/spec/fixtures/integration/ruby/matrix/d.after_script.sh +4 -4
- data/spec/fixtures/integration/ruby/matrix/d.before_script.sh +23 -22
- data/spec/fixtures/vx_test_repo_insecure_key +27 -0
- data/spec/fixtures/vx_test_repo_insecure_key.pub +1 -0
- data/spec/integration/clojure_spec.rb +42 -0
- data/spec/integration/go_spec.rb +49 -17
- data/spec/integration/ruby_spec.rb +82 -78
- data/spec/lib/builder/script_builder/prepare_spec.rb +29 -27
- data/spec/lib/builder/task_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -0
- data/spec/support/create.rb +5 -5
- metadata +14 -9
- data/spec/fixtures/insecure_private_key +0 -27
- data/spec/fixtures/integration/ruby/deploy/d.after_script.sh +0 -14
- data/spec/fixtures/integration/ruby/deploy/d.before_script.sh +0 -69
- data/spec/fixtures/integration/ruby/deploy/d.script.sh +0 -8
data/spec/support/create.rb
CHANGED
@@ -7,11 +7,11 @@ def create(name, options = {})
|
|
7
7
|
Vx::Builder::Task.new(
|
8
8
|
job_id: 1,
|
9
9
|
build_id: 12,
|
10
|
-
name: '
|
11
|
-
src: "git@github.com:
|
12
|
-
sha: "
|
13
|
-
deploy_key: fixture("
|
14
|
-
branch: "
|
10
|
+
name: 'vexor/vx-test-repo',
|
11
|
+
src: "git@github.com:vexor/vx-test-repo.git",
|
12
|
+
sha: options[:sha] || "8f53c077072674972e21c82a286acc07fada91f5",
|
13
|
+
deploy_key: fixture("vx_test_repo_insecure_key"),
|
14
|
+
branch: options[:branch] || "test/pull-request",
|
15
15
|
cache_url_prefix: "http://example.com",
|
16
16
|
pull_request_id: options[:pull_request_id],
|
17
17
|
job_number: 100,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vx-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Galinsky
|
@@ -134,6 +134,7 @@ files:
|
|
134
134
|
- lib/vx/builder/deploy_builder.rb
|
135
135
|
- lib/vx/builder/helper/config.rb
|
136
136
|
- lib/vx/builder/helper/trace_sh_command.rb
|
137
|
+
- lib/vx/builder/helper/vxvm_install.rb
|
137
138
|
- lib/vx/builder/matrix_builder.rb
|
138
139
|
- lib/vx/builder/script_builder.rb
|
139
140
|
- lib/vx/builder/script_builder/base.rb
|
@@ -152,15 +153,14 @@ files:
|
|
152
153
|
- lib/vx/builder/task.rb
|
153
154
|
- lib/vx/builder/version.rb
|
154
155
|
- spec/fixtures/clojure.yml
|
155
|
-
- spec/fixtures/insecure_private_key
|
156
156
|
- spec/fixtures/integration/go/language/after_script.sh
|
157
157
|
- spec/fixtures/integration/go/language/before_script.sh
|
158
158
|
- spec/fixtures/integration/go/language/config.yml
|
159
159
|
- spec/fixtures/integration/go/language/script.sh
|
160
|
+
- spec/fixtures/integration/ruby/deploy/after_script.sh
|
161
|
+
- spec/fixtures/integration/ruby/deploy/before_script.sh
|
160
162
|
- spec/fixtures/integration/ruby/deploy/config.yml
|
161
|
-
- spec/fixtures/integration/ruby/deploy/
|
162
|
-
- spec/fixtures/integration/ruby/deploy/d.before_script.sh
|
163
|
-
- spec/fixtures/integration/ruby/deploy/d.script.sh
|
163
|
+
- spec/fixtures/integration/ruby/deploy/script.sh
|
164
164
|
- spec/fixtures/integration/ruby/language/after_script.sh
|
165
165
|
- spec/fixtures/integration/ruby/language/before_script.sh
|
166
166
|
- spec/fixtures/integration/ruby/language/config.yml
|
@@ -180,6 +180,9 @@ files:
|
|
180
180
|
- spec/fixtures/travis.yml
|
181
181
|
- spec/fixtures/travis_bug_1.yml
|
182
182
|
- spec/fixtures/travis_bug_2.yml
|
183
|
+
- spec/fixtures/vx_test_repo_insecure_key
|
184
|
+
- spec/fixtures/vx_test_repo_insecure_key.pub
|
185
|
+
- spec/integration/clojure_spec.rb
|
183
186
|
- spec/integration/go_spec.rb
|
184
187
|
- spec/integration/ruby_spec.rb
|
185
188
|
- spec/lib/builder/build_configuration/cache_spec.rb
|
@@ -232,15 +235,14 @@ specification_version: 4
|
|
232
235
|
summary: Write a gem summary
|
233
236
|
test_files:
|
234
237
|
- spec/fixtures/clojure.yml
|
235
|
-
- spec/fixtures/insecure_private_key
|
236
238
|
- spec/fixtures/integration/go/language/after_script.sh
|
237
239
|
- spec/fixtures/integration/go/language/before_script.sh
|
238
240
|
- spec/fixtures/integration/go/language/config.yml
|
239
241
|
- spec/fixtures/integration/go/language/script.sh
|
242
|
+
- spec/fixtures/integration/ruby/deploy/after_script.sh
|
243
|
+
- spec/fixtures/integration/ruby/deploy/before_script.sh
|
240
244
|
- spec/fixtures/integration/ruby/deploy/config.yml
|
241
|
-
- spec/fixtures/integration/ruby/deploy/
|
242
|
-
- spec/fixtures/integration/ruby/deploy/d.before_script.sh
|
243
|
-
- spec/fixtures/integration/ruby/deploy/d.script.sh
|
245
|
+
- spec/fixtures/integration/ruby/deploy/script.sh
|
244
246
|
- spec/fixtures/integration/ruby/language/after_script.sh
|
245
247
|
- spec/fixtures/integration/ruby/language/before_script.sh
|
246
248
|
- spec/fixtures/integration/ruby/language/config.yml
|
@@ -260,6 +262,9 @@ test_files:
|
|
260
262
|
- spec/fixtures/travis.yml
|
261
263
|
- spec/fixtures/travis_bug_1.yml
|
262
264
|
- spec/fixtures/travis_bug_2.yml
|
265
|
+
- spec/fixtures/vx_test_repo_insecure_key
|
266
|
+
- spec/fixtures/vx_test_repo_insecure_key.pub
|
267
|
+
- spec/integration/clojure_spec.rb
|
263
268
|
- spec/integration/go_spec.rb
|
264
269
|
- spec/integration/ruby_spec.rb
|
265
270
|
- spec/lib/builder/build_configuration/cache_spec.rb
|
@@ -1,27 +0,0 @@
|
|
1
|
-
-----BEGIN RSA PRIVATE KEY-----
|
2
|
-
MIIEpAIBAAKCAQEAveiqzr0nxJA48fk/T7qFrODmdT94lvt7ontGLhqNT7Z+GbqL
|
3
|
-
t45F4/5BxNgyMbSQfaJw1sGMunQfjKRdWfuKUQp0y6bNhAjtnCnoVel3SMBaXE2r
|
4
|
-
896GkhNXc1/lz1v/1T8blc/chVeKZvQT+hDvC/KECF/+vd7yL6NRloayZdv0ks7z
|
5
|
-
CwoIeeTfEu2hd3rXDELgoiM+AAEciYe08VuytFjbONy28Ey3SGHURN418FJrJHDs
|
6
|
-
7B5x3P89glkSta1TY4JOQtoWuxza7ylS8G1k+ss+TDB+ET3sqjDe1mxosRAfqSA7
|
7
|
-
apEZK3ALbZru3nYd26x+CE84dvH7GiKoBl0TSQIDAQABAoIBAEEAgnaBCDufod4x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SA37nv3jZEHMJrN/I4pvDu3zJCKy3bGS
|
23
|
-
p6qolzSPavdFpRGz7N9/Ncvoql7jkfT3BoyBQ4YpwGbTBZRccKQqnLjhQ1aj+jzU
|
24
|
-
a2PipwKBgQCCLuOrhO37UovMnmNrRzXnwu9C+VCB4oGf6QtjEehMx/J+6ehvSYub
|
25
|
-
lLOxeZQHzVkC3I6rVMbK1qx0t8Qnb+5jHRAkR4x/JaTojpZYqngdLrtY4/qLKJq7
|
26
|
-
4aOLYjJyL3YB09g3r68wcnTUHbcZYj+Q7xT1Y/ntXNp3pdbYc47NUQ==
|
27
|
-
-----END RSA PRIVATE KEY-----
|
@@ -1,14 +0,0 @@
|
|
1
|
-
|
2
|
-
# after script init
|
3
|
-
export CI=1
|
4
|
-
export CI_JOB_ID=1
|
5
|
-
export CI_JOB_NUMBER=100
|
6
|
-
export CI_BUILD_ID=12
|
7
|
-
export CI_BUILD_NUMBER=101
|
8
|
-
export CI_PROJECT_NAME=project/name
|
9
|
-
export CI_BUILD_SHA=b665f90239563c030f1b280a434b3d84daeda1bd
|
10
|
-
export CI_BRANCH=master
|
11
|
-
export VX_ROOT=$(pwd)
|
12
|
-
cd ${VX_ROOT}/code/project/name
|
13
|
-
|
14
|
-
# after script
|
@@ -1,69 +0,0 @@
|
|
1
|
-
|
2
|
-
# init
|
3
|
-
set -e
|
4
|
-
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
5
|
-
export LC_ALL=en_US.UTF8
|
6
|
-
export DEBIAN_FRONTEND=noninteractive
|
7
|
-
export CI=1
|
8
|
-
export CI_JOB_ID=1
|
9
|
-
export CI_JOB_NUMBER=100
|
10
|
-
export CI_BUILD_ID=12
|
11
|
-
export CI_BUILD_NUMBER=101
|
12
|
-
export CI_PROJECT_NAME=project/name
|
13
|
-
export CI_BUILD_SHA=b665f90239563c030f1b280a434b3d84daeda1bd
|
14
|
-
export CI_BRANCH=master
|
15
|
-
echo \$\ export\ FOO
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ExYWoranpVCmEyUGlwd0tCZ1FDQ0x1T3JoTzM3VW92TW5tTnJSelhud3U5QytWQ0I0b0dmNlF0akVlaE14L0orNmVodlNZdWIKbExPeGVaUUh6VmtDM0k2clZNYksxcXgwdDhRbmIrNWpIUkFrUjR4L0phVG9qcFpZcW5nZExydFk0L3FMS0pxNwo0YU9MWWpKeUwzWUIwOWczcjY4d2NuVFVIYmNaWWorUTd4VDFZL250WE5wM3BkYlljNDdOVVE9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo= | base64 --decode) > ${VX_ROOT}/data/project/name/key
|
23
|
-
chmod 0600 ${VX_ROOT}/data/project/name/key
|
24
|
-
export VX_PRIVATE_KEY=${VX_ROOT}/data/project/name/key
|
25
|
-
(echo IyEvYmluL3NoCmV4ZWMgL3Vzci9iaW4vc3NoIC1BIC1vIExvZ0xldmVsPXF1aWV0IC1vIFN0cmljdEhvc3RLZXlDaGVja2luZz1ubyAtbyBVc2VyS25vd25Ib3N0c0ZpbGU9L2Rldi9udWxsIC1pICR7VlhfUk9PVH0vZGF0YS9wcm9qZWN0L25hbWUva2V5ICRACg== | base64 --decode) > ${VX_ROOT}/data/project/name/git_ssh
|
26
|
-
chmod 0750 ${VX_ROOT}/data/project/name/git_ssh
|
27
|
-
export GIT_SSH=${VX_ROOT}/data/project/name/git_ssh
|
28
|
-
echo "$ git clone --depth=50 --branch=master git@github.com:dima-exe/ci-worker-test-repo.git ${VX_ROOT}/code/project/name"
|
29
|
-
git clone --depth=50 --branch=master git@github.com:dima-exe/ci-worker-test-repo.git ${VX_ROOT}/code/project/name
|
30
|
-
echo "$ git checkout -qf b665f90239563c030f1b280a434b3d84daeda1bd"
|
31
|
-
( cd ${VX_ROOT}/code/project/name && git checkout -qf b665f90239563c030f1b280a434b3d84daeda1bd )
|
32
|
-
unset GIT_SSH
|
33
|
-
echo "starting SSH Agent"
|
34
|
-
eval "$(ssh-agent)" > /dev/null
|
35
|
-
ssh-add $VX_PRIVATE_KEY 2> /dev/null
|
36
|
-
cd ${VX_ROOT}/code/project/name
|
37
|
-
echo "download latest version of vxvm"
|
38
|
-
curl --fail --silent --show-error https://raw.githubusercontent.com/vexor/vx-packages/master/vxvm > $VX_ROOT/bin/vxvm
|
39
|
-
chmod +x $VX_ROOT/bin/vxvm
|
40
|
-
export CASHER_DIR=$HOME/.casher && ( mkdir -p $CASHER_DIR/bin && /usr/bin/curl https://raw2.github.com/dima-exe/casher/master/bin/casher -s -o $HOME/.casher/bin/casher && chmod +x $HOME/.casher/bin/casher ) || true
|
41
|
-
test -f $HOME/.casher/bin/casher && /opt/rbenv/versions/1.9.3-p547/bin/ruby $HOME/.casher/bin/casher fetch http://example.com/master/rvm-1.9.3-gemfile.tgz || true
|
42
|
-
test -f $HOME/.casher/bin/casher && /opt/rbenv/versions/1.9.3-p547/bin/ruby $HOME/.casher/bin/casher add ~/.rubygems || true
|
43
|
-
unset CASHER_DIR
|
44
|
-
|
45
|
-
# before install
|
46
|
-
eval "$(rbenv init -)" || true
|
47
|
-
rbenv shell $(rbenv versions | sed -e 's/^*/ /' | awk '{print $1}' | grep -v 'system' | grep '1.9.3' | tail -n1)
|
48
|
-
echo \$\ export\ BUNDLE_GEMFILE\=\$\{PWD\}/Gemfile
|
49
|
-
export BUNDLE_GEMFILE=${PWD}/Gemfile
|
50
|
-
echo \$\ export\ GEM_HOME\=\~/.rubygems
|
51
|
-
export GEM_HOME=~/.rubygems
|
52
|
-
|
53
|
-
# announce
|
54
|
-
echo \$\ ruby\ --version
|
55
|
-
ruby --version
|
56
|
-
echo \$\ gem\ --version
|
57
|
-
gem --version
|
58
|
-
echo \$\ bundle\ --version
|
59
|
-
bundle --version
|
60
|
-
|
61
|
-
# install
|
62
|
-
echo \$\ bundle\ install\
|
63
|
-
bundle install
|
64
|
-
echo \$\ bundle\ clean\ --force
|
65
|
-
bundle clean --force
|
66
|
-
|
67
|
-
# before script
|
68
|
-
echo \$\ echo\ before\ deploy
|
69
|
-
echo before deploy
|