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
cec4387a
Commit
cec4387a
authored
1 year ago
by
Andreas
Browse files
Options
Downloads
Patches
Plain Diff
feat/Implemented caching to jobs, and divided up jobs
parent
5bfc2ad8
No related branches found
No related tags found
No related merge requests found
Pipeline
#283394
failed
1 year ago
Stage: install
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+38
-14
38 additions, 14 deletions
.gitlab-ci.yml
with
38 additions
and
14 deletions
.gitlab-ci.yml
+
38
−
14
View file @
cec4387a
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_ROOT_PASSWORD
:
"
root"
MYSQL_DATABASE
:
"
sparesti"
cache
:
key
:
"
${CI_COMMIT_REF_SLUG}"
# Branch-specific cache keys to have separate caches across branches.
paths
:
-
.m2/repository
stages
:
-
compile_and_test
-
install
-
build
-
test
-
generate_site_reports
-
modify_generated_site_reports
-
publish_pages
install_dependencies
:
stage
:
install
script
:
-
mvn dependency:go-offline
cache
:
key
:
"
maven-repository"
# Static Cache Key to keep cache across branches
key
:
${CI_COMMIT_REF_SLUG}
paths
:
-
.m2/repository
policy
:
push
compile_and_tes
t
:
stage
:
compile_and_test
build_projec
t
:
stage
:
build
script
:
-
mvn clean test
# Cleans the previous build and runs tests
artifacts
:
-
mvn clean install -DskipTests
cache
:
key
:
${CI_COMMIT_REF_SLUG}
paths
:
-
.m2/repository
policy
:
pull
test_project
:
stage
:
test
script
:
-
mvn 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
policy
:
pull
generate_site_reports
:
stage
:
generate_site_reports
...
...
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