Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
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
LOFAR2.0
tango
Commits
cb0361ad
Commit
cb0361ad
authored
3 years ago
by
Corné Lukken
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-205
: Rules for file change and for tagged master
parent
534764df
No related branches found
No related tags found
1 merge request
!183
Docker image building & pushing with CI pipeline caching
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+40
-24
40 additions, 24 deletions
.gitlab-ci.yml
with
40 additions
and
24 deletions
.gitlab-ci.yml
+
40
−
24
View file @
cb0361ad
...
@@ -9,13 +9,52 @@ cache:
...
@@ -9,13 +9,52 @@ cache:
-
.cache/pip
-
.cache/pip
-
/var/lib/docker
-
/var/lib/docker
stages
:
stages
:
-
remote_images
# - building
# - building
# - linting
# - linting
# - static-analysis
# - static-analysis
# - unit-tests
# - unit-tests
# - integration-tests
# - integration-tests
# - packaging
# - packaging
-
images
# - images
.base_docker_store_images
:
stage
:
remote_images
image
:
docker:latest
tags
:
-
privileged
services
:
-
name
:
docker:dind
variables
:
DOCKER_TLS_CERTDIR
:
"
/certs"
before_script
:
-
apk add --update make bash
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script
:
-
touch /root/.Xauthority
# Hack BASH_SOURCE into sourced files, docker its sh shell won't set this
-
export BASH_SOURCE=$(pwd)/bootstrap/etc/lofar20rc.sh
# source the lofarrc file and mask its non zero exit code
-
. bootstrap/etc/lofar20rc.sh ||
true
# Allow docker image script test to execute
-
chmod u+x $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh
# Do not remove 'bash' or statement will be ignored by primitive docker shell
-
bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh
docker_store_images_master_tag
:
extends
:
.base_docker_store_images
only
:
-
tags
except
:
# Anything not master branch is an exception to the only tags rule
-
/^(?!master).+@/
docker_store_images_changes
:
extends
:
.base_docker_store_images
only
:
changes
:
-
docker-compose/.env
except
:
refs
:
-
tags
-
master
#newline_at_eof:
#newline_at_eof:
# stage: linting
# stage: linting
# before_script:
# before_script:
...
@@ -97,26 +136,3 @@ stages:
...
@@ -97,26 +136,3 @@ stages:
# script:
# script:
# - cd tangostationcontrol
# - cd tangostationcontrol
# - python setup.py bdist_wheel
# - python setup.py bdist_wheel
docker_store_images
:
stage
:
images
image
:
docker:latest
tags
:
-
privileged
services
:
-
name
:
docker:dind
variables
:
DOCKER_TLS_CERTDIR
:
"
/certs"
before_script
:
-
apk add --update make bash docker-compose
-
apk add --update bind-tools
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script
:
-
touch /root/.Xauthority
# Hack BASH_SOURCE into sourced files, docker its sh shell won't set this
-
export BASH_SOURCE=$(pwd)/bootstrap/etc/lofar20rc.sh
# source the lofarrc file and mask its non zero exit code
-
. bootstrap/etc/lofar20rc.sh ||
true
# Allow docker image script test to execute
-
chmod u+x $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh
# Do not remove 'bash' or statement will be ignored by primitive docker shell
-
bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh
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