Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
org.etsi.osl.tmf.api
Manage
Activity
Members
Labels
Plan
Issues
7
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
1
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
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
OSL
code
org.etsi.osl.tmf.api
Commits
97b2ca76
Commit
97b2ca76
authored
1 year ago
by
Dimitrios Giannopoulos
Browse files
Options
Downloads
Patches
Plain Diff
made all jobs run only on certain branch push
parent
75339df9
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!36
Merging 2024Q2_RC into main, creating 2024Q2 Release
,
!7
Resolve "Create a pipeline to build and publish the docker image in gitlab registry"
Pipeline
#3755
passed with stages
Stage:
Stage:
in 1 minute and 54 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+10
-4
10 additions, 4 deletions
.gitlab-ci.yml
with
10 additions
and
4 deletions
.gitlab-ci.yml
+
10
−
4
View file @
97b2ca76
...
...
@@ -2,6 +2,13 @@ stages:
-
java_build
-
docker_build
# Define default rules as a YAML anchor
.default_rules
:
&default_rules
rules
:
-
if
:
'
$CI_COMMIT_REF_NAME
==
"main"'
-
if
:
'
$CI_COMMIT_REF_NAME
==
"develop"'
-
if
:
'
$CI_COMMIT_REF_NAME
==
"12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry"'
variables
:
DEFAULT_TAG
:
"
1.2.0-SNAPSHOT"
...
...
@@ -20,6 +27,7 @@ deploy_jar:
image
:
maven:3.9.5-ibm-semeru-17-focal
script
:
-
mvn deploy -s ci_settings.xml -DskipTests -Dversion=$APP_VERSION
<<
:
*default_rules
download_jar
:
stage
:
docker_build
...
...
@@ -34,6 +42,7 @@ download_jar:
artifacts
:
paths
:
-
target/
<<
:
*default_rules
build_image
:
stage
:
docker_build
...
...
@@ -47,9 +56,6 @@ build_image:
echo "Pushing Docker image with tag 'latest'"
/kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:latest"
fi
rules
:
-
if
:
'
$CI_COMMIT_REF_NAME
==
"main"'
-
if
:
'
$CI_COMMIT_REF_NAME
==
"develop"'
-
if
:
'
$CI_COMMIT_REF_NAME
==
"12-create-a-pipeline-to-build-and-publish-the-docker-image-in-gitlab-registry"'
<<
:
*default_rules
needs
:
-
download_jar
This diff is collapsed.
Click to expand it.
Preview
0%
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