Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
docker
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
bioroboticslab
robofish
docker
Commits
59559605
Commit
59559605
authored
5 years ago
by
calrama
Browse files
Options
Downloads
Patches
Plain Diff
ci: split build stage into build&deploy, no longer provide OS version suffix to image tag
parent
f7737c98
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+48
-29
48 additions, 29 deletions
.gitlab-ci.yml
with
48 additions
and
29 deletions
.gitlab-ci.yml
+
48
−
29
View file @
59559605
stages
:
-
build
-
deploy
-
trigger
build centos
:
stage
:
build
tags
:
[
linux
,
shell
]
before_script
:
-
echo "${CI_REGISTRY_PASSWORD}" | docker login -u "${CI_REGISTRY_USER}" "${CI_REGISTRY}" --password-stdin
script
:
-
GPU_DRIVER_VERSION="$(dpkg-query --showformat='${Version}' --show 'nvidia-driver-*')"
-
CACHE_FILE="/var/lib/gitlab-runner/.local/share/robofish-docker-gpu-driver-version"
-
if [[ -f $CACHE_FILE ]] && [[ "$(cat $CACHE_FILE)" == "$GPU_DRIVER_VERSION" ]]; then OPTS=''; else OPTS='--no-cache'; fi
-
echo -n $GPU_DRIVER_VERSION > $CACHE_FILE
-
docker build $OPTS --pull -t "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:centos" -f centos/Dockerfile centos
-
docker build $OPTS --pull -t "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:${CI_COMMIT_REF_NAME}-centos" -f centos/Dockerfile centos
deploy centos
:
stage
:
build
tags
:
[
linux
,
shell
]
only
:
-
master
before_script
:
-
echo "${CI_REGISTRY_PASSWORD}" | docker login -u "${CI_REGISTRY_USER}" "${CI_REGISTRY}" --password-stdin
script
:
-
docker tag "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:${CI_COMMIT_REF_NAME}-centos" "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:centos"
-
docker push "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:centos"
-
docker tag "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:centos" "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:centos-7"
-
docker push "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:centos-7"
after_script
:
-
docker logout "${CI_REGISTRY}"
build ubuntu
:
stage
:
build
tags
:
[
linux
,
shell
]
before_script
:
-
echo "${CI_REGISTRY_PASSWORD}" | docker login -u "${CI_REGISTRY_USER}" "${CI_REGISTRY}" --password-stdin
script
:
-
GPU_DRIVER_VERSION="$(dpkg-query --showformat='${Version}' --show 'nvidia-driver-*')"
-
CACHE_FILE="/var/lib/gitlab-runner/.local/share/robofish-docker-gpu-driver-version"
-
if [[ -f $CACHE_FILE ]] && [[ "$(cat $CACHE_FILE)" == "$GPU_DRIVER_VERSION" ]]; then OPTS=''; else OPTS='--no-cache'; fi
-
echo -n $GPU_DRIVER_VERSION > $CACHE_FILE
-
docker build $OPTS --pull -t "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:ubuntu" -f ubuntu/Dockerfile ubuntu
-
docker build $OPTS --pull -t "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:${CI_COMMIT_REF_NAME}-ubuntu" -f ubuntu/Dockerfile ubuntu
deploy ubuntu
:
stage
:
build
tags
:
[
linux
,
shell
]
only
:
-
master
before_script
:
-
echo "${CI_REGISTRY_PASSWORD}" | docker login -u "${CI_REGISTRY_USER}" "${CI_REGISTRY}" --password-stdin
script
:
-
docker tag "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:${CI_COMMIT_REF_NAME}-ubuntu" "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:ubuntu"
-
docker push "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:ubuntu"
-
docker tag "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:ubuntu" "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:ubuntu-18.04"
-
docker push "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:ubuntu-18.04"
after_script
:
-
docker logout "${CI_REGISTRY}"
...
...
@@ -40,7 +53,6 @@ build windows:
stage
:
build
tags
:
[
windows-1809
,
shell
]
before_script
:
-
echo "${CI_REGISTRY_PASSWORD}" | docker login -u "${CI_REGISTRY_USER}" "${CI_REGISTRY}" --password-stdin
-
Copy-Item 'C:/Windows/System32/opengl32.dll' 'windows/devel/opengl32.dll'
-
Copy-Item 'C:/Windows/System32/glu32.dll' 'windows/devel/glu32.dll'
-
Copy-Item 'C:/Windows/System32/ddraw.dll' 'windows/devel/ddraw.dll'
...
...
@@ -50,18 +62,25 @@ build windows:
-
Copy-Item 'C:/Windows/System32/nvcuda.dll' 'windows/cuda-devel/nvcuda.dll'
script
:
-
$image_name = "${CI_REGISTRY}/$(${CI_PROJECT_PATH}.toLower())"
-
docker build --memory 10G -t "${image_name}:base-windows" windows/base
-
docker build --memory 10G -t "${image_name}:${CI_COMMIT_REF_NAME}-base-windows" windows/base
-
docker build --memory 15G -t "${image_name}:${CI_COMMIT_REF_NAME}-devel-windows" -f windows/devel/Dockerfile windows/devel
-
docker build --memory 15G -t "${image_name}:${CI_COMMIT_REF_NAME}-cuda-devel-windows" -f windows/cuda-devel/Dockerfile windows/cuda-devel
deploy windows
:
stage
:
build
tags
:
[
windows-1809
,
shell
]
only
:
-
master
before_script
:
-
echo "${CI_REGISTRY_PASSWORD}" | docker login -u "${CI_REGISTRY_USER}" "${CI_REGISTRY}" --password-stdin
script
:
-
$image_name = "${CI_REGISTRY}/$(${CI_PROJECT_PATH}.toLower())"
-
docker tag "${image_name}:${CI_COMMIT_REF_NAME}-base-windows" "${image_name}:base-windows"
-
docker push "${image_name}:base-windows"
-
docker tag "${image_name}:base-windows" "${image_name}:base-windows-1809"
-
docker push "${image_name}:base-windows-1809"
-
docker build --memory 15G -t "${image_name}:devel-windows" -f windows/devel/Dockerfile windows/devel
-
docker tag "${image_name}:${CI_COMMIT_REF_NAME}-devel-windows" "${image_name}:devel-windows"
-
docker push "${image_name}:devel-windows"
-
docker tag "${image_name}:devel-windows" "${image_name}:devel-windows-1809"
-
docker push "${image_name}:devel-windows-1809"
-
docker build --memory 15G -t "${image_name}:cuda-devel-windows" -f windows/cuda-devel/Dockerfile windows/cuda-devel
-
docker tag "${image_name}:${CI_COMMIT_REF_NAME}-cuda-devel-windows" "${image_name}:cuda-devel-windows"
-
docker push "${image_name}:cuda-devel-windows"
-
docker tag "${image_name}:cuda-devel-windows" "${image_name}:cuda-devel-windows-1809"
-
docker push "${image_name}:cuda-devel-windows-1809"
after_script
:
-
docker logout "${CI_REGISTRY}"
...
...
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