Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
atdb-ldv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
ASTRON SDC
atdb-ldv
Commits
425c9b05
Commit
425c9b05
authored
2 years ago
by
Nico Vermaas
Browse files
Options
Downloads
Patches
Plain Diff
remove old stages
parent
576a5ccb
No related branches found
No related tags found
1 merge request
!261
updating ci/cd pipeline with stages and do it as user 'sdc' instead of 'vermaas'
Pipeline
#37902
passed
2 years ago
Stage: build
Stage: deploy_to_test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+2
-74
2 additions, 74 deletions
.gitlab-ci.yml
with
2 additions
and
74 deletions
.gitlab-ci.yml
+
2
−
74
View file @
425c9b05
...
...
@@ -19,81 +19,9 @@ docker-build:
# - master
# - release
docker-build-branch
:
# Official docker image.
image
:
docker:latest
stage
:
build
services
:
-
docker:dind
before_script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script
:
-
docker build --pull -t "$CI_REGISTRY_IMAGE" atdb
-
docker push "$CI_REGISTRY_IMAGE"
except
:
-
master
-
release
# deploy test/dev version on 'sdc-dev.astron.nl'
docker-deploy-master
:
image
:
docker:latest
stage
:
deploy
before_script
:
-
'
command
-v
ssh-agent
>/dev/null
||
(
apt-get
update
-y
&&
apt-get
install
openssh-client
-y
)'
-
eval $(ssh-agent -s)
-
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
-
mkdir -p ~/.ssh
-
chmod 700 ~/.ssh
-
ssh-keyscan dop814.astron.nl >> ~/.ssh/known_hosts
-
chmod 644 ~/.ssh/known_hosts
script
:
-
ssh -o StrictHostKeyChecking=no vermaas@dop814.astron.nl "docker pull "$CI_REGISTRY_IMAGE""
-
ssh -o StrictHostKeyChecking=no vermaas@dop814.astron.nl "docker-compose -p atdb -f /docker_compose/atdb-ldv/docker-compose-dev-cd.yml up -d"
when
:
manual
only
:
-
master
# deploy release version on 'sdc.astron.nl'
docker-deploy-release
:
image
:
docker:latest
stage
:
deploy
before_script
:
-
'
command
-v
ssh-agent
>/dev/null
||
(
apt-get
update
-y
&&
apt-get
install
openssh-client
-y
)'
-
eval $(ssh-agent -s)
-
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
-
mkdir -p ~/.ssh
-
chmod 700 ~/.ssh
-
ssh-keyscan dop821.astron.nl >> ~/.ssh/known_hosts
-
chmod 644 ~/.ssh/known_hosts
script
:
-
ssh -o StrictHostKeyChecking=no sdco@dop821.astron.nl "echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY"
-
ssh -o StrictHostKeyChecking=no sdco@dop821.astron.nl "docker pull "$CI_REGISTRY_IMAGE""
-
ssh -o StrictHostKeyChecking=no sdco@dop821.astron.nl "docker-compose -p atdb -f /opt/dockercompose/atdb-ldv-compose/docker-compose-production-cd.yml up -d"
when
:
manual
only
:
-
release
# deploy branch to 'sdc-dev.astron.nl'
docker-deploy-branch-to-test
:
image
:
docker:latest
stage
:
deploy_to_test
before_script
:
-
'
command
-v
ssh-agent
>/dev/null
||
(
apt-get
update
-y
&&
apt-get
install
openssh-client
-y
)'
-
eval $(ssh-agent -s)
-
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
-
mkdir -p ~/.ssh
-
chmod 700 ~/.ssh
-
ssh-keyscan dop814.astron.nl >> ~/.ssh/known_hosts
-
chmod 644 ~/.ssh/known_hosts
script
:
-
ssh -o StrictHostKeyChecking=no vermaas@dop814.astron.nl "docker pull "$CI_REGISTRY_IMAGE""
-
ssh -o StrictHostKeyChecking=no vermaas@dop814.astron.nl "docker-compose -p atdb -f /docker_compose/atdb-ldv/docker-compose-dev-cd.yml up -d"
when
:
manual
except
:
-
master
# deploy master branch to 'sdc-dev.astron.nl'
docker-deploy-
master-
to-test
:
# deploy master
or
branch to 'sdc-dev.astron.nl'
docker-deploy-to-test
:
image
:
docker:latest
stage
:
deploy_to_test
before_script
:
...
...
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