Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchParapheur
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
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
Maarch
MaarchParapheur
Commits
f94d2387
Commit
f94d2387
authored
3 years ago
by
Guillaume Heurtier
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #16997 TIME 0:05 added commit logging in forge tickets
parent
ef10eba3
No related branches found
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
+42
-0
42 additions, 0 deletions
.gitlab-ci.yml
with
42 additions
and
0 deletions
.gitlab-ci.yml
+
42
−
0
View file @
f94d2387
...
...
@@ -9,6 +9,7 @@ variables:
POSTGRES_PASSWORD
:
"
"
stages
:
-
logs
-
test
-
synchronization
...
...
@@ -137,3 +138,44 @@ tags:
-
git tag $CI_COMMIT_TAG
-
git status
-
git push origin --tags
logs
:
image
:
debian:10-slim
stage
:
logs
except
:
-
schedules
-
tags
-
master
before_script
:
# Skip the logging if in pro (=> sync disabled)
-
if [ $SYNC_ENABLED = "true" ]; then echo "Sync enabled"; else echo "Sync disabled, stopping the job" && exit 0; fi
-
apt-get update -y
-
apt install -y curl
script
:
-
|
if [[ $CI_COMMIT_MESSAGE == "FEAT"* ]]; then \
ISSUE_ID=`echo $CI_COMMIT_MESSAGE | grep -o 'FEAT \#[0-9]*' | grep -o '[0-9]*'`; \
echo "found FEAT !"; \
else \
if [[ $CI_COMMIT_MESSAGE == "FIX"* ]]; then \
ISSUE_ID=`echo $CI_COMMIT_MESSAGE | grep -o 'FIX \#[0-9]*' | grep -o '[0-9]*'`; \
echo "found FIX !"; \
else \
echo "no FEAT or FIX found :("; \
exit 0; \
fi; \
fi
-
echo $ISSUE_ID
-
NOTE_MESSAGE="Commit ajouté sur la branche **$CI_COMMIT_REF_NAME** de **$CI_PROJECT_NAME**"
-
COMMIT_URL="$CI_PROJECT_URL/commit/$CI_COMMIT_SHA"
-
echo $NOTE_MESSAGE
-
echo "$CI_COMMIT_MESSAGE"
-
CI_COMMIT_MESSAGE=$(echo $CI_COMMIT_MESSAGE)
# Remove the line returns
-
echo "$CI_COMMIT_MESSAGE"
-
echo $COMMIT_URL
-
NOTE="$NOTE_MESSAGE \n $CI_COMMIT_MESSAGE \n $COMMIT_URL"
-
echo "$NOTE"
-
BODY="{\"issue\":{\"notes\":\"$NOTE\",\"private_notes\":false}}"
-
echo "$BODY"
-
curl -v -H 'Content-Type:application/json' -H "X-Redmine-API-Key:$REDMINE_API_KEY" -d "$BODY" -X PUT https://forge.maarch.org/issues/$ISSUE_ID.json
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