Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
AURA
steering
Commits
2eacf62e
Commit
2eacf62e
authored
3 years ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
ssh://gitlab.servus.at:22022/aura/steering
parents
2203e80e
529c3cda
No related branches found
No related tags found
No related merge requests found
Pipeline
#1566
failed
3 years ago
Stage: release
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+55
-0
55 additions, 0 deletions
.gitlab-ci.yml
with
55 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
55
−
0
View file @
2eacf62e
.release-rules
:
&release-rules
# rule to run job on a tag-reference which has the form number.number.number (semantic versioning)
# or number.number.number-text (semantic versioning + release-name)
# and where a Dockerfile exists
-
if
:
$CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+$/ || $CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+[-]\S+$/
exists
:
-
Dockerfile
stages
:
-
release
docker-push
:
# Use the official docker image.
image
:
docker:latest
stage
:
release
variables
:
# the name of the image without version
AURA_IMAGE_NAME
:
"
autoradio/steering"
services
:
-
docker:dind
before_script
:
# default repo is docker.io (aka docker hub)
-
docker login -u "$DOCKER_ID" -p "$DOCKER_HUB_AUTH"
script
:
# every commit on main branch should build image as unstable
# else it is from a tag (enforced by gitlab-ci rules)
# hint: tags are references independent of branches
-
|
if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]
then docker build -t $AURA_IMAGE_NAME:unstable .
else docker build -t $AURA_IMAGE_NAME -t $AURA_IMAGE_NAME:$CI_COMMIT_TAG .
fi
# TODO: maybe isolate docker build and docker push
-
docker push "$AURA_IMAGE_NAME" --all-tags
rules
:
-
*release-rules
# every commit on master/main branch should trigger a push to docker-hub as unstable without a release
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
exists
:
-
Dockerfile
release_job
:
stage
:
release
needs
:
-
docker-push
image
:
registry.gitlab.com/gitlab-org/release-cli:latest
rules
:
*release-rules
script
:
-
echo "this will be a release when there is a tag, but tags should be protected to be only createable by maintainers."
release
:
# TODO: automated release notes
name
:
'
Release
$CI_COMMIT_TAG'
description
:
'
Created
using
the
release-cli'
tag_name
:
'
$CI_COMMIT_TAG'
ref
:
'
$CI_COMMIT_TAG'
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