Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Private Server Plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Sofiane Lasri
Private Server Plugin
Commits
110920cc
Commit
110920cc
authored
5 months ago
by
Sofiane Lasri
Browse files
Options
Downloads
Patches
Plain Diff
feat: add GitLab CI configuration for build and release stages
parent
ce9eaa46
No related branches found
No related tags found
No related merge requests found
Pipeline
#975
failed
5 months ago
Stage: build
Stage: release
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+45
-0
45 additions, 0 deletions
.gitlab-ci.yml
pom.xml
+1
-0
1 addition, 0 deletions
pom.xml
with
46 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
45
−
0
View file @
110920cc
stages
:
-
build
-
release
variables
:
MAVEN_CLI_OPTS
:
"
--batch-mode
--errors
--fail-at-end
--show-version"
DATE_FORMAT
:
"
%Y%m%d-%H%M%S"
build
:
stage
:
build
image
:
maven:3.8.7-openjdk-21
script
:
-
mvn $MAVEN_CLI_OPTS clean package
-
BUILD_DATE=$(date -u +${DATE_FORMAT})
-
JAR_NAME="PrivateServerPlugin-${BUILD_DATE}.jar"
-
mv target/PrivateServerPlugin.jar "${JAR_NAME}"
-
echo "BUILD_DATE=${BUILD_DATE}" > build.env
-
echo "JAR_NAME=${JAR_NAME}" >> build.env
artifacts
:
paths
:
-
"
${JAR_NAME}"
-
build.env
expire_in
:
1 week
rules
:
-
if
:
$CI_COMMIT_BRANCH == "master"
release
:
stage
:
release
image
:
registry.gitlab.com/gitlab-org/release-cli:latest
needs
:
-
job
:
build
artifacts
:
true
script
:
-
source build.env
-
echo "Release ${JAR_NAME} created at ${BUILD_DATE}"
release
:
name
:
"
Release
${BUILD_DATE}"
tag_name
:
"
release-${BUILD_DATE}"
description
:
"
Version
compilée
le
${BUILD_DATE}
(commit
${CI_COMMIT_SHORT_SHA})"
assets
:
links
:
-
name
:
"
${JAR_NAME}"
url
:
"
${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/${CI_JOB_ID}/artifacts/${JAR_NAME}"
rules
:
-
if
:
$CI_COMMIT_BRANCH == "master"
This diff is collapsed.
Click to expand it.
pom.xml
+
1
−
0
View file @
110920cc
...
...
@@ -18,6 +18,7 @@
<build>
<defaultGoal>
clean package
</defaultGoal>
<finalName>
PrivateServerPlugin
</finalName>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
...
...
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