Implemented parsing of commit message to find DWN, CHK, APP
This commit is contained in:
@@ -23,6 +23,12 @@ preflight:
|
|||||||
- name: 'title'
|
- name: 'title'
|
||||||
expand_kibot_patterns: true
|
expand_kibot_patterns: true
|
||||||
command: 'echo $KIBOT_PCB_NAME | rev | cut -d"/" -f1 | rev | cut -d"." -f1 '
|
command: 'echo $KIBOT_PCB_NAME | rev | cut -d"/" -f1 | rev | cut -d"." -f1 '
|
||||||
|
- name: 'DWN'
|
||||||
|
command: 'echo $DWN'
|
||||||
|
- name: 'CHK'
|
||||||
|
command: 'echo $CHK'
|
||||||
|
- name: 'APP'
|
||||||
|
command: 'echo $APP'
|
||||||
check_zone_fills: true
|
check_zone_fills: true
|
||||||
|
|
||||||
global:
|
global:
|
||||||
|
|||||||
29
kibot-ci.yml
29
kibot-ci.yml
@@ -148,7 +148,7 @@ image:
|
|||||||
- cat token_storage.json
|
- cat token_storage.json
|
||||||
- cd $CI_PROJECT_DIR/Fabrication
|
- cd $CI_PROJECT_DIR/Fabrication
|
||||||
- 'SEARCH="bom.csv"'
|
- 'SEARCH="bom.csv"'
|
||||||
- !reference [.commands, strip_tag]
|
- !reference [.commands, parse_commit]
|
||||||
- !reference [.commands, get_files]
|
- !reference [.commands, get_files]
|
||||||
- cd $CI_PROJECT_DIR
|
- cd $CI_PROJECT_DIR
|
||||||
- FAIL=0
|
- FAIL=0
|
||||||
@@ -184,7 +184,7 @@ image:
|
|||||||
# USE PRIVATE-TOKEN to upload from gitlab-ci
|
# USE PRIVATE-TOKEN to upload from gitlab-ci
|
||||||
|
|
||||||
git_tag:
|
git_tag:
|
||||||
- !reference [.commands, strip_tag]
|
- !reference [.commands, parse_commit]
|
||||||
- |
|
- |
|
||||||
if [[ $GITLAB_CI == 'true' && $CI_COMMIT_BRANCH == "main" ]]; then
|
if [[ $GITLAB_CI == 'true' && $CI_COMMIT_BRANCH == "main" ]]; then
|
||||||
echo "running git tag"
|
echo "running git tag"
|
||||||
@@ -236,7 +236,26 @@ image:
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
strip_tag:
|
parse_commit:
|
||||||
|
- |
|
||||||
|
initials () {
|
||||||
|
echo "$(echo $1 | cut -d' ' -f1 | cut -c1-1)$(echo $1 | cut -d' ' -f2 | cut -c1-1)"
|
||||||
|
}
|
||||||
|
|
||||||
|
str=$CI_COMMIT_MESSAGE
|
||||||
|
REV=$(echo "$str" | sed -n '1 p')
|
||||||
|
DWN=$(initials "$(echo "$str" | sed -n '3 p' | cut -d' ' -f1,2)")
|
||||||
|
CHK=''
|
||||||
|
APP=''
|
||||||
|
|
||||||
|
while IFS= read -r line; do
|
||||||
|
if [[ $line == Rev* ]]; then
|
||||||
|
CHK=$(initials "$(echo $line | cut -d' ' -f2,3)")
|
||||||
|
fi
|
||||||
|
if [[ $line == App* ]]; then
|
||||||
|
APP=$(initials "$(echo $line | cut -d' ' -f2,3)")
|
||||||
|
fi
|
||||||
|
done <<<"$str"
|
||||||
- TAG=$(echo ${CI_COMMIT_MESSAGE} | tr -d \\n)
|
- TAG=$(echo ${CI_COMMIT_MESSAGE} | tr -d \\n)
|
||||||
|
|
||||||
outputs_mech:
|
outputs_mech:
|
||||||
@@ -335,7 +354,7 @@ upload_job:
|
|||||||
when: never # Do not run this job when a tag is created manually
|
when: never # Do not run this job when a tag is created manually
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
|
||||||
script:
|
script:
|
||||||
- !reference [.commands, strip_tag]
|
- !reference [.commands, parse_commit]
|
||||||
- apt remove libcurl4 -y
|
- apt remove libcurl4 -y
|
||||||
- apt-get update && apt-get -y install zip curl
|
- apt-get update && apt-get -y install zip curl
|
||||||
- |
|
- |
|
||||||
@@ -370,7 +389,7 @@ release_job:
|
|||||||
when: never # Do not run this job when a tag is created manually
|
when: never # Do not run this job when a tag is created manually
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
|
||||||
script:
|
script:
|
||||||
- !reference [.commands, strip_tag]
|
- !reference [.commands, parse_commit]
|
||||||
- apk add jq curl
|
- apk add jq curl
|
||||||
- |
|
- |
|
||||||
echo "running release_job for $TAG"
|
echo "running release_job for $TAG"
|
||||||
|
|||||||
Reference in New Issue
Block a user