Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
engine
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
engine
Merge requests
!16
FEAT(gitlab-ci):Push from Feature Branch
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
FEAT(gitlab-ci):Push from Feature Branch
feat-auto-deployment
into
main
Overview
1
Commits
17
Pipelines
31
Changes
1
Merged
Kay Effenberger
requested to merge
feat-auto-deployment
into
main
1 year ago
Overview
1
Commits
17
Pipelines
31
Changes
1
Expand
If a Merge Request on a feature Branch is created, the Image will pushed to gitlab registry
1
0
Merge request reports
Compare
main
version 16
caa30555
1 year ago
version 15
0676c0f5
1 year ago
version 14
5a8ef9b8
1 year ago
version 13
67427776
1 year ago
version 12
1826ee51
1 year ago
version 11
63868e49
1 year ago
version 10
22a589b8
1 year ago
version 9
c382e2eb
1 year ago
version 8
ade0b00d
1 year ago
version 7
52ea8a6e
1 year ago
version 6
cae79b61
1 year ago
version 5
7b4d3b17
1 year ago
version 4
032d5587
1 year ago
version 3
b3fe9d83
1 year ago
version 2
db7e1052
1 year ago
version 1
704e86b9
1 year ago
main (base)
and
latest version
latest version
7768d782
17 commits,
1 year ago
version 16
caa30555
16 commits,
1 year ago
version 15
0676c0f5
15 commits,
1 year ago
version 14
5a8ef9b8
14 commits,
1 year ago
version 13
67427776
13 commits,
1 year ago
version 12
1826ee51
12 commits,
1 year ago
version 11
63868e49
11 commits,
1 year ago
version 10
22a589b8
10 commits,
1 year ago
version 9
c382e2eb
9 commits,
1 year ago
version 8
ade0b00d
8 commits,
1 year ago
version 7
52ea8a6e
7 commits,
1 year ago
version 6
cae79b61
6 commits,
1 year ago
version 5
7b4d3b17
5 commits,
1 year ago
version 4
032d5587
4 commits,
1 year ago
version 3
b3fe9d83
3 commits,
1 year ago
version 2
db7e1052
2 commits,
1 year ago
version 1
704e86b9
1 commit,
1 year ago
1 file
+
19
−
8
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
.gitlab-ci.yml
+
19
−
8
Options
@@ -45,23 +45,34 @@ docker-push:
services
:
-
docker:dind
before_script
:
# default repo is docker.io (aka docker hub)
-
docker login -u "$DOCKER_ID" -p "$DOCKER_HUB_AUTH"
# on a feature branch will login to gitlab registry
# else to docker hub
# hint: feature branches must begin with "feat"
-
|
if expr "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" : ^feat > /dev/null
then docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
else docker login -u "$DOCKER_ID" -p "$DOCKER_HUB_AUTH"
fi
script
:
# every commit on main branch should build image as unstable
# every commit on main branch should build and push image as unstable
# elseif its a feature branch build and push to gitlab registry
# else it is from a tag (enforced by gitlab-ci rules)
# hint: tags are references independent of branches
# hint: feature branches must begin with "feat"
-
|
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 .
docker push "$AURA_IMAGE_NAME" --all-tag
elif expr "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" : ^feat > /dev/null
then docker build -t $AURA_IMAGE_NAME -t $CI_REGISTRY_IMAGE:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME .
docker push $CI_REGISTRY_IMAGE:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
else docker build -t $AURA_IMAGE_NAME -t $AURA_IMAGE_NAME:$CI_COMMIT_TAG .
docker push "$AURA_IMAGE_NAME" --all-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
# every commit on master/main
or feature
branch should trigger a push
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|| $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^feat/
exists
:
-
Dockerfile
Loading