Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zarr-tools
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Show more breadcrumbs
Andrey ARISTOV
zarr-tools
Commits
b8dc8d0b
Commit
b8dc8d0b
authored
3 years ago
by
Andrey ARISTOV
Browse files
Options
Downloads
Plain Diff
Merge branch 'aaristov-feature-docker-CI' into 'main'
Update .gitlab-ci.yml - add docker build See merge request
!3
parents
1c69863e
dbd64627
No related branches found
Branches containing commit
Tags
v0.4
Tags containing commit
1 merge request
!3
Update .gitlab-ci.yml - add docker build
Pipeline
#81920
passed
3 years ago
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+33
-1
33 additions, 1 deletion
.gitlab-ci.yml
with
33 additions
and
1 deletion
.gitlab-ci.yml
+
33
−
1
View file @
b8dc8d0b
...
...
@@ -12,6 +12,7 @@ image: python:3.8
# only cache local items.
variables
:
PIP_CACHE_DIR
:
"
$CI_PROJECT_DIR/.cache/pip"
CI_REGISTRY
:
"
registry-gitlab.pasteur.fr"
# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
...
...
@@ -20,15 +21,46 @@ variables:
# them in a virtualenv and cache it as well.
cache
:
paths
:
-
.cache/pip
#
- .cache/pip
-
.tox/.tox
stages
:
-
test
-
build
test
:
stage
:
test
script
:
-
pip install tox flake8 pytest
-
tox
docker-build
:
# Use the official docker image.
image
:
registry-gitlab.pasteur.fr/dsi-tools/docker-images/docker:latest
stage
:
build
services
:
-
registry-gitlab.pasteur.fr/dsi-tools/docker-images/docker:dind
before_script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# Default branch leaves tag empty (= latest tag)
# All other branches are tagged with the escaped branch name (commit ref slug)
script
:
-
|
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag=""
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
-
docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" .
-
docker push "$CI_REGISTRY_IMAGE${tag}"
# Run this job in a branch where a Dockerfile exists
rules
:
-
if
:
$CI_COMMIT_BRANCH
exists
:
-
Dockerfile
# pages:
# 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