Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
analytics
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nomad-lab
analytics
Commits
9e53e183
Commit
9e53e183
authored
Jun 25, 2020
by
Luigi Sbailo
Browse files
Options
Downloads
Patches
Plain Diff
Add deployment develop branch
parent
e130221d
No related branches found
No related tags found
1 merge request
!123
testing develop merge
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+31
-0
31 additions, 0 deletions
.gitlab-ci.yml
.gitlab-ci/update_tag_develop.sh
+42
-0
42 additions, 0 deletions
.gitlab-ci/update_tag_develop.sh
with
73 additions
and
0 deletions
.gitlab-ci.yml
+
31
−
0
View file @
9e53e183
...
...
@@ -11,6 +11,22 @@ stages:
-
deploy
build to develop
:
stage
:
build
before_script
:
-
echo "Building the single user notebook image"
-
echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
-
docker info
script
:
# Using cache to speed up the build process
-
docker pull ${CI_REGISTRY_IMAGE}:latest ||
true
-
docker build --cache-from ${CI_REGISTRY_IMAGE}:latest --tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA} .
-
docker push ${CI_REGISTRY_IMAGE}:develop${CI_COMMIT_SHORT_SHA}
rules
:
# Execute jobs when a new commit is pushed to develop branch
-
if
:
$CI_COMMIT_BRANCH == "develop"
build to staging
:
stage
:
build
before_script
:
...
...
@@ -44,6 +60,21 @@ build to production:
-
if
:
$CI_COMMIT_BRANCH == 'master'
deploy to develop
:
image
:
python:3.6
stage
:
deploy
variables
:
GIT_SUBMODULE_STRATEGY
:
none
script
:
-
./.gitlab-ci/update_tag_develop.sh
environment
:
name
:
develop
url
:
https://analytics-toolkit.nomad-coe.eu/develop
rules
:
# Execute jobs when a new commit is pushed to develop branch
-
if
:
$CI_COMMIT_BRANCH == "develop"
deploy to staging
:
image
:
python:3.6
stage
:
deploy
...
...
...
...
This diff is collapsed.
Click to expand it.
.gitlab-ci/update_tag_develop.sh
0 → 100755
+
42
−
0
View file @
9e53e183
# !/bin/bash
# Based on: https://docs.gitlab.com/ee/ci/ssh_keys/README.html
# Install ssh-agent if not already installed, it is required by Docker.
# (change apt-get to yum if you use an RPM-based image)
# - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
# Run ssh-agent (inside the build environment)
eval
$(
ssh-agent
-s
)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
# We're using tr to fix line endings which makes ed25519 keys work
# without extra base64 encoding.
# https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
echo
"
$SSH_PRIVATE_KEY
"
|
tr
-d
'\r'
| ssh-add -
# Create the SSH directory and give it the right permissions
mkdir
-p
~/.ssh
chmod
700 ~/.ssh
# Use ssh-keyscan to scan the keys of your private server.
ssh-keyscan gitlab.mpcdf.mpg.de
>>
~/.ssh/known_hosts
chmod
644 ~/.ssh/known_hosts
# Set the user name and email.
git config
--global
user.name
$GITLAB_USER_NAME
git config
--global
user.email
$GITLAB_USER_EMAIL
# Clone the private repository
git clone git@gitlab.mpcdf.mpg.de:nomad-lab/analytics-deployment.git /tmp/analytics-deployment
cd
/tmp/analytics-deployment
# Update the tag of the docker image
sed
-i
"s/^ tag
\:
.*/ tag
\:
develop
$CI_COMMIT_SHORT_SHA
/g"
deployments/hub/config/develop.yaml
# Finally, commit and push the changes
git add deployments/hub/config/develop.yaml
git commit
-m
"CI: Update the hub image for develop (
$CI_PIPELINE_URL
)"
git push
rm
-rf
/tmp/analytics-deployment
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
sign in
to comment