Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Risefor - Front end package
Manage
Activity
Members
Labels
Plan
Issues
3
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
stop-impunity
Risefor - Front end package
Commits
4f75c8d5
Commit
4f75c8d5
authored
11 months ago
by
senza
Browse files
Options
Downloads
Patches
Plain Diff
[patch] Risefor Versionning CI - fix auth issues
parent
84af1bfb
Branches
Branches containing commit
Tags
v2.5.1
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+22
-9
22 additions, 9 deletions
.gitlab-ci.yml
with
22 additions
and
9 deletions
.gitlab-ci.yml
+
22
−
9
View file @
4f75c8d5
variables
:
GIT_STRATEGY
:
fetch
stages
:
-
build
-
test
...
...
@@ -10,7 +13,7 @@ build:
artifacts
:
paths
:
# just setting /applications/risefor-front/ throws error, setting full path as temp workaround
-
/home/gitlab-runner/builds/
eGNSascF4
/0/applications/risefor-front/
# Adjust this path to your build output directory
-
/home/gitlab-runner/builds/
2zkxs7HHG
/0/applications/risefor-front/
# Adjust this path to your build output directory
#- "!/home/gitlab-runner/builds/eGNSascF4/0/applications/risefor-front/.git/"
expire_in
:
1 week
...
...
@@ -26,27 +29,37 @@ test:
update_version
:
stage
:
build
script
:
-
echo "Setting permissions"
-
mkdir -p ~/.ssh && chmod 700 ~/.ssh
-
ssh-keyscan git.risefor.org >> ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts
-
eval $(ssh-agent -s)
-
echo "using key "$SSH_PRIVATE_KEY" | base64 -d"
-
ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 -d)
-
echo set remote to ssh and test connexion
-
git remote set-url origin git@git.risefor.org:applications/risefor-front.git
-
ssh -T git@git.risefor.org
-
echo "Updating version..."
-
echo "Checking latest version from tags..."
-
latest_version=$(git tag --sort=-v:refname | head -n1)
-
echo "Latest version found $latest_version"
-
'
INITIAL_VERSION=${latest_version:-"2.5.0"}'
-
'
INITIAL_VERSION=${latest_version:-"
v
2.5.0"}'
-
echo "Initial version set to $INITIAL_VERSION"
-
echo "Checking commit message for version bump..."
-
|
# Check if the commit message contains [major], [minor], or [patch]
if grep -qE '\[major\]' <<< "$CI_COMMIT_MESSAGE"; then
echo "Major version bump detected"
new_version=$(semver -i major $INITIAL_VERSION)
new_version=
v
$(semver -i major $INITIAL_VERSION)
elif grep -qE '\[minor\]' <<< "$CI_COMMIT_MESSAGE"; then
echo "Minor version bump detected"
new_version=$(semver -i minor $INITIAL_VERSION)
new_version=
v
$(semver -i minor $INITIAL_VERSION)
elif grep -qE '\[patch\]' <<< "$CI_COMMIT_MESSAGE"; then
echo "Patch version bump detected"
new_version=$(semver -i patch $INITIAL_VERSION)
echo "Patch version bump detected $INITIAL_VERSION"
new_version=v$(semver -i patch $INITIAL_VERSION)
echo "Patch version bump detected $new_version"
else
echo "No version bump detected,
defaulting to patch increment
"
new_version=$(semver -i patch $INITIAL_VERSION)
echo "No version bump detected,
skip version
"
exit 0 # Exit without incrementing version
fi
echo "New version set to: $new_version"
...
...
@@ -57,4 +70,4 @@ update_version:
# Push the new tag to the repository
git push origin $new_version
only
:
-
risefor_main/master
\ No newline at end of file
-
risefor_main/master
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