Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
reposync
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
linuxsupport
cronjobs
reposync
Commits
cf12b2cf
Commit
cf12b2cf
authored
6 years ago
by
Alex Iribarren
Browse files
Options
Downloads
Patches
Plain Diff
Remove debug and fix nomad steps
parent
ee160e52
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Promote to production
Pipeline
#520465
passed
6 years ago
Stage: prepare
Stage: build
Stage: deploy_test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+12
-15
12 additions, 15 deletions
.gitlab-ci.yml
with
12 additions
and
15 deletions
.gitlab-ci.yml
+
12
−
15
View file @
cf12b2cf
...
@@ -7,11 +7,8 @@ variables:
...
@@ -7,11 +7,8 @@ variables:
before_script
:
before_script
:
-
if [ $CI_COMMIT_REF_NAME == 'master' ]; then PREFIX='PROD_'; else PREFIX='DEV_'; fi
-
if [ $CI_COMMIT_REF_NAME == 'master' ]; then PREFIX='PROD_'; else PREFIX='DEV_'; fi
-
printenv | sort
-
eval 'vars=${!'"$PREFIX"'@}'
-
eval 'vars=${!'"$PREFIX"'@}'
-
echo $vars
-
for v in $vars; do eval 'export '"${v#$PREFIX}"'=$'$v; done
-
for v in $vars; do echo $v; echo eval 'export '"${v#$PREFIX}"'=$'$v; eval 'export '"${v#$PREFIX}"'=$'$v; done
-
printenv | sort
stages
:
stages
:
-
prepare
-
prepare
...
@@ -99,27 +96,27 @@ tag_scheduler:
...
@@ -99,27 +96,27 @@ tag_scheduler:
.nomad_deps_template
:
&nomad_deps
.nomad_deps_template
:
&nomad_deps
before_script
:
curl https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip -o /tmp/vault.zip &&
-
curl https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip -o /tmp/vault.zip
curl https://releases.hashicorp.com/nomad/${NOMAD_VERSION}/nomad_${NOMAD_VERSION}_linux_amd64.zip -o /tmp/nomad.zip &&
-
curl https://releases.hashicorp.com/nomad/${NOMAD_VERSION}/nomad_${NOMAD_VERSION}_linux_amd64.zip -o /tmp/nomad.zip
unzip /tmp/vault.zip -d /usr/local/bin/ &&
-
unzip /tmp/vault.zip -d /usr/local/bin/
unzip /tmp/nomad.zip -d /usr/local/bin/ &&
-
unzip /tmp/nomad.zip -d /usr/local/bin/
export IMAGE_VER="${CI_COMMIT_TAG:-latest}" &&
-
export IMAGE_VER="${CI_COMMIT_TAG:-latest}"
vault read nomad/creds/submitjobs -format=json > token.json &&
-
vault read nomad/creds/submitjobs -format=json > token.json
export `jq -r '"NOMAD_TOKEN=" + .data.secret_id' token.json`
-
export `jq -r '"NOMAD_TOKEN=" + .data.secret_id' token.json`
deploy_test
:
deploy_test
:
<<
:
*nomad_deps
stage
:
deploy_test
stage
:
deploy_test
dependencies
:
[]
dependencies
:
[]
script
:
script
:
-
*nomad_deps
-
for j in *.nomad; do echo -e "\n${j}:"; nomad job validate <(envsubst < $j); done
-
for j in *.nomad; do echo -e "\n${j}:"; nomad job validate <(envsubst < $j); done
-
for j in *.nomad; do echo -e "\n${j}:"; (nomad job plan -verbose <(envsubst < $j) || [[ $? -eq 0 || $? -eq 1 ]]) || break; done
# plan returns 0 or 1 on success
-
for j in *.nomad; do echo -e "\n${j}:"; (nomad job plan -verbose <(envsubst < $j) || [[ $? -eq 0 || $? -eq 1 ]]) || break; done
# plan returns 0 or 1 on success
deploy
:
deploy
:
<<
:
*nomad_deps
stage
:
deploy
stage
:
deploy
dependencies
:
dependencies
:
-
deploy_test
-
deploy_test
script
:
script
:
-
*nomad_deps
-
for j in *.nomad; do echo -e "\n${j}:"; nomad job run <(envsubst < $j); done
-
for j in *.nomad; do echo -e "\n${j}:"; nomad job run <(envsubst < $j); done
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