Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
idatt2106-2024-07
backend
Commits
2f07d186
Commit
2f07d186
authored
1 year ago
by
Andreas
Browse files
Options
Downloads
Patches
Plain Diff
refactor/Updated .gitlab-ci.yml
parent
5bfc2ad8
Branches
Branches containing commit
No related tags found
1 merge request
!85
Feat/workflow implement docker push and deploy
Pipeline
#283434
passed
1 year ago
Stage: build_test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+24
-24
24 additions, 24 deletions
.gitlab-ci.yml
with
24 additions
and
24 deletions
.gitlab-ci.yml
+
24
−
24
View file @
2f07d186
image
:
maven:3.8.5-openjdk-17
variables
:
# This will suppress any download for dependencies and plugins or upload messages which would clutter the console log.
MAVEN_OPTS
:
"
-Dhttps.protocols=TLSv1.2
-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN
-Dorg.slf4j.simpleLogger.showDateTime=true
-Djava.awt.headless=true"
MAVEN_CLI_OPTS
:
"
--batch-mode
--errors
--fail-at-end
--show-version
-DinstallAtEnd=true
-DdeployAtEnd=true"
SPRING_PROFILES_ACTIVE
:
gitlab-ci
services
:
-
name
:
mysql:latest
alias
:
mysql
variables
:
MYSQL_ROOT_PASSWORD
:
"
root"
# TODO Set this in GitLab's CI/CD environment variables for security reasons
MYSQL_DATABASE
:
"
sparesti"
cache
:
key
:
"
${CI_COMMIT_REF_SLUG}"
# Branch-specific cache keys to have separate caches across branches.
paths
:
-
.m2/repository
stages
:
-
compile_an
d_test
-
buil
d_test
-
generate_site_reports
-
modify_generated_site_reports
-
publish_pages
cache
:
key
:
"
maven-repository"
# Static Cache Key to keep cache across branches
paths
:
-
.m2/repository
-
pages
compile_and_test
:
stage
:
compile_and_test
build_test_project
:
stage
:
build_test
services
:
-
name
:
mysql:latest
alias
:
mysql
variables
:
MYSQL_ROOT_PASSWORD
:
"
root"
MYSQL_DATABASE
:
"
sparesti"
script
:
-
mvn clean test
# Cleans the previous build and runs tests
artifacts
:
-
mvn clean test
when
:
always
artifacts
:
expire_in
:
1 day
paths
:
-
target/site/jacoco
reports
:
junit
:
-
target/surefire-reports/TEST-*.xml
-
target/failsafe-reports/TEST-*.xml
when
:
always
cache
:
key
:
${CI_COMMIT_REF_SLUG}
paths
:
-
.m2/repository
generate_site_reports
:
stage
:
generate_site_reports
...
...
@@ -65,7 +65,7 @@ modify_generated_site_reports: # Modify the generated website containing project
# We move the code coverage reports generated by jacoco and mvn site to be served by Gitlab Pages (Settings -> Pages)
pages
:
image
:
alpine:latest
stage
:
publish_
pages
stage
:
pages
dependencies
:
-
modify_generated_site_reports
script
:
...
...
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