Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
ubuntu_20_04
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
HZB
EPICS
base
ubuntu_20_04
Commits
408e7e3d
Commit
408e7e3d
authored
1 year ago
by
(INACTIVE) Marcel Bajdel (new marcel.bajdel)
Browse files
Options
Downloads
Patches
Plain Diff
build branch changes
parent
d64ab8e2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!20
Release
,
!13
Docker image branch
,
!12
Docker image branch
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+7
-8
7 additions, 8 deletions
.gitlab-ci.yml
with
7 additions
and
8 deletions
.gitlab-ci.yml
+
7
−
8
View file @
408e7e3d
...
...
@@ -33,16 +33,15 @@ build_branch:
-
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
# Read the value of DOCKER_LATEST_IMAGE_EXISTS from the artifact
-
export DOCKER_LATEST_IMAGE_EXISTS=$(cat docker_latest_image.txt)
# Check for changes (excluding README.md)
-
CHANGED_FILES=$(git diff --name-only $CI_COMMIT_BEFORE_SHA $CI_COMMIT_SHA | grep -v README.md)
# if the image does not exist and there are changes (excluding README.md), build it
-
if [ "$DOCKER_LATEST_IMAGE_EXISTS" == "false" ] && [ -n "$CHANGED_FILES" ]; then /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH; else echo "Docker image already exists or no relevant changes"; fi
# Run tests (assuming you have a command for running tests)
-
./run_tests.sh
# Replace this with your actual test command
-
if [ "$DOCKER_LATEST_IMAGE_EXISTS" == "false" ]; then /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH; else echo "Docker image already exists or no relevant changes"; fi
rules
:
-
if
:
'
$CI_COMMIT_BRANCH
&&
$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
!=
"main"'
changes
:
-
"
**/*"
-
exists
:
-
$CI_COMMIT_BRANCH
-
changes
:
-
'
*'
except
:
-
README.md
build_main
:
# This build will run only for main branch
...
...
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