Added kintree cli fork as a submodule.
Added 'inventree' stage to CI, which runs ki-ntree cli on all the boms it can find in the artifacts dir
This commit is contained in:
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -2,3 +2,7 @@
|
|||||||
path = kicad-footprint-generator
|
path = kicad-footprint-generator
|
||||||
url = git@gitlab.com:acmelon/kicad-footprint-generator.git
|
url = git@gitlab.com:acmelon/kicad-footprint-generator.git
|
||||||
branch = offset_fix
|
branch = offset_fix
|
||||||
|
[submodule ".scripts/ki-ntree"]
|
||||||
|
path = .scripts/ki-ntree
|
||||||
|
url = https://github.com/Andrew-Collins/Ki-nTree
|
||||||
|
branch = cli
|
||||||
|
|||||||
1
.scripts/ki-ntree
Submodule
1
.scripts/ki-ntree
Submodule
Submodule .scripts/ki-ntree added at 316a11d0da
35
kibot-ci.yml
35
kibot-ci.yml
@@ -15,6 +15,7 @@ variables:
|
|||||||
stages:
|
stages:
|
||||||
- gen_mech
|
- gen_mech
|
||||||
- gen_fab
|
- gen_fab
|
||||||
|
- inventree
|
||||||
- upload
|
- upload
|
||||||
- release
|
- release
|
||||||
|
|
||||||
@@ -33,6 +34,8 @@ image:
|
|||||||
- if: $CI_COMMIT_BRANCH == "dev"
|
- if: $CI_COMMIT_BRANCH == "dev"
|
||||||
|
|
||||||
.commands:
|
.commands:
|
||||||
|
get_tag:
|
||||||
|
- TAG=$(echo ${CI_COMMIT_MESSAGE} | tr -d \\n)
|
||||||
get_files:
|
get_files:
|
||||||
- FILES=$(find . -name *$SEARCH -not -path "./.gitlab/*")
|
- FILES=$(find . -name *$SEARCH -not -path "./.gitlab/*")
|
||||||
get_dirs:
|
get_dirs:
|
||||||
@@ -124,12 +127,29 @@ image:
|
|||||||
python3 $CI_PROJECT_DIR/.gitlab/.scripts/neo.py $d
|
python3 $CI_PROJECT_DIR/.gitlab/.scripts/neo.py $d
|
||||||
done
|
done
|
||||||
|
|
||||||
|
boms:
|
||||||
|
- cd $CI_PROJECT_DIR/.gitlab/.scripts/ki-ntree/
|
||||||
|
- poetry install
|
||||||
|
- cd $CI_PROJECT_DIR/Fabrication
|
||||||
|
- 'SEARCH="bom.csv"'
|
||||||
|
- !reference [.commands, get_tag]
|
||||||
|
- !reference [.commands, get_files]
|
||||||
|
- cd $CI_PROJECT_DIR/.gitlab/.scripts/ki-ntree/
|
||||||
|
- |
|
||||||
|
for f in $FILES
|
||||||
|
do
|
||||||
|
echo $f
|
||||||
|
name=$(echo $f | cut -d'-' -f1)A
|
||||||
|
poetry run python -m kintree_cli -p $f --assembly "{'ipn': '$name', 'rev': '$TAG'}" --settings_inv $KINTREE_SETT_INV --settings_ipn $KINTREE_SETT_IPN
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
git_tag:
|
git_tag:
|
||||||
|
- !reference [.commands, get_tag]
|
||||||
- |
|
- |
|
||||||
if [[ $GITLAB_CI == 'true' && $CI_COMMIT_BRANCH == "main" ]]; then
|
if [[ $GITLAB_CI == 'true' && $CI_COMMIT_BRANCH == "main" ]]; then
|
||||||
TAG=$(echo ${CI_COMMIT_MESSAGE} | tr -d \\n)
|
|
||||||
echo "running git tag"
|
echo "running git tag"
|
||||||
git tag $CI_COMMIT_MESSAGE
|
git tag $TAG
|
||||||
elif [[ $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" && "$CI_MERGE_REQUEST_TITLE" =~ [^a-zA-Z0-9.-_] ]]; then
|
elif [[ $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" && "$CI_MERGE_REQUEST_TITLE" =~ [^a-zA-Z0-9.-_] ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -230,6 +250,17 @@ outputs_all:
|
|||||||
- !reference [.commands, neo]
|
- !reference [.commands, neo]
|
||||||
- ls Fabrication/
|
- ls Fabrication/
|
||||||
|
|
||||||
|
inventree_job:
|
||||||
|
stage: inventree
|
||||||
|
needs:
|
||||||
|
- job: outputs_all
|
||||||
|
artifacts: true
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
|
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
|
||||||
|
script:
|
||||||
|
- !reference [.commands, boms]
|
||||||
|
|
||||||
upload_job:
|
upload_job:
|
||||||
stage: upload
|
stage: upload
|
||||||
|
|||||||
Reference in New Issue
Block a user