Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
platform
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
leap
platform
Commits
6e7b18f8
Verified
Commit
6e7b18f8
authored
7 years ago
by
Varac
Browse files
Options
Downloads
Patches
Plain Diff
[CI] Move more commands into functions
parent
a3fc4340
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!105
Upgrade tests
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/platform-ci/ci-build.sh
+17
-13
17 additions, 13 deletions
tests/platform-ci/ci-build.sh
with
17 additions
and
13 deletions
tests/platform-ci/ci-build.sh
+
17
−
13
View file @
6e7b18f8
...
@@ -68,6 +68,16 @@ test() {
...
@@ -68,6 +68,16 @@ test() {
}
}
build_from_scratch
()
{
build_from_scratch
()
{
# create node(s) with unique id so we can run tests in parallel
NAME
=
"citest
${
CI_BUILD_ID
:-
0
}
"
# when using gitlab-runner locally, CI_BUILD_ID is always 1 which
# will conflict with running/terminating AWS instances in subsequent runs
# therefore we pick a random number in this case
[
"
${
CI_BUILD_ID
:-
0
}
"
-eq
"1"
]
&&
NAME+
=
"000
${
RANDOM
}
"
TAG
=
'single'
SERVICES
=
'couchdb,soledad,mx,webapp,tor,monitor'
# leap_platform/tests/platform-ci/provider
# leap_platform/tests/platform-ci/provider
PROVIDERDIR
=
"
${
ROOTDIR
}
/provider"
PROVIDERDIR
=
"
${
ROOTDIR
}
/provider"
/bin/echo
"Provider directory:
${
PROVIDERDIR
}
"
/bin/echo
"Provider directory:
${
PROVIDERDIR
}
"
...
@@ -130,6 +140,12 @@ run() {
...
@@ -130,6 +140,12 @@ run() {
test
test
}
}
cleanup
()
{
# if everything succeeds, destroy the vm
LEAP_CMD vm
rm
"
${
TAG
}
"
[
-f
"nodes/
${
NAME
}
.json"
]
&&
/bin/rm
"nodes/
${
NAME
}
.json"
}
#
#
# Main
# Main
#
#
...
@@ -163,21 +179,9 @@ case "$CI_JOB_NAME" in
...
@@ -163,21 +179,9 @@ case "$CI_JOB_NAME" in
run bitmask ssh://gitolite@leap.se/bitmask
run bitmask ssh://gitolite@leap.se/bitmask
;;
;;
*
)
*
)
# create node(s) with unique id so we can run tests in parallel
NAME
=
"citest
${
CI_BUILD_ID
:-
0
}
"
# when using gitlab-runner locally, CI_BUILD_ID is always 1 which
# will conflict with running/terminating AWS instances in subsequent runs
# therefore we pick a random number in this case
[
"
${
CI_BUILD_ID
:-
0
}
"
-eq
"1"
]
&&
NAME+
=
"000
${
RANDOM
}
"
TAG
=
'single'
SERVICES
=
'couchdb,soledad,mx,webapp,tor,monitor'
build_from_scratch
build_from_scratch
# Deploy and test
deploy
deploy
test
test
# if everything succeeds, destroy the vm
cleanup
LEAP_CMD vm
rm
"
${
TAG
}
"
[
-f
"nodes/
${
NAME
}
.json"
]
&&
/bin/rm
"nodes/
${
NAME
}
.json"
;;
;;
esac
esac
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment