Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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-v23-03
backend
Commits
d1b27648
Commit
d1b27648
authored
2 years ago
by
Birk Øvstetun Narvhus
Browse files
Options
Downloads
Patches
Plain Diff
Update .gitlab-ci.yml file
parent
5ef7c7bc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+30
-35
30 additions, 35 deletions
.gitlab-ci.yml
with
30 additions
and
35 deletions
.gitlab-ci.yml
+
30
−
35
View file @
d1b27648
#Workflow name
name
:
CI/CD Pipeline
on
:
#Manually trigger workflow runs
workflow_dispatch
:
#Trigger the workflow on push from the main branch
push
:
branches
:
-
main
jobs
:
#Test's job
tests
:
name
:
Unit tests
#Run on Ubuntu using the latest version
runs-on
:
ubuntu-latest
#Job's steps
steps
:
#Check-out your repository under $GITHUB_WORKSPACE, so your workflow can access it
-
uses
:
actions/checkout@v1
#Set up JDK 11
-
name
:
Set up JDK
uses
:
actions/setup-java@v1
with
:
java-version
:
'
20'
#Set up Maven cache
-
name
:
Cache Maven packages
#This action allows caching dependencies and build outputs to improve workflow execution time.
uses
:
actions/cache@v1
with
:
path
:
~/.m2
key
:
${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys
:
${{ runner.os }}-m2
#Run Tests
-
name
:
Run Tests
run
:
mvn -B test
\ No newline at end of file
image
:
maven:3.9.0-eclipse-temurin-19-focal
variables
:
SPRING_PROFILES_ACTIVE
:
gitlab-ci
stages
:
-
build
-
test
-
deploy
maven-build
:
stage
:
build
script
:
-
mvn -v
-
mvn package
run-tests
:
stage
:
test
script
:
-
mvn install
-
mvn test
deploy-jar
:
stage
:
deploy
script
:
-
mvn install
artifacts
:
paths
:
-
target/*.jar
\ No newline at end of file
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