Store and retrieving token written, upload tested.

This commit is contained in:
andrewc
2024-10-08 10:04:16 +10:00
parent adf63a67e0
commit ba09a90c53

View File

@@ -127,22 +127,31 @@ image:
boms:
- cd $CI_PROJECT_DIR/.gitlab/.scripts/ki-ntree/
- apt update && apt install pip -y && pip install --break-system-packages poetry
- apt update && apt install curl wget pip -y && pip install --break-system-packages poetry
- poetry install
- cd /tmp
- url="https://gitlab.com/api/v4/projects/${DIGI_API_PRJ_ID}/packages/generic/digikey_api/0/token_storage.json"
- |
if [[ -z "$KINTREE_DIGI_TOKEN" ]]; then
wget $url
else
cp $KINTREE_DIGI_TOKEN token_storage.json
fi
- ls
- cd $CI_PROJECT_DIR/Fabrication
- 'SEARCH="bom.csv"'
- !reference [.commands, strip_tag]
- !reference [.commands, get_files]
- !reference [.commands, strip_tag]
- !reference [.commands, get_files]
- cd $CI_PROJECT_DIR/.gitlab/.scripts/ki-ntree/
- |
for f in $FILES
do
echo $f
name=$(echo $f | cut -c3- | cut -d'-' -f1)A
poetry run python -m kintree_cli -p $CI_PROJECT_DIR/Fabrication/$f --assembly "{'ipn': '$name', 'rev': '$TAG'}" --settings $KINTREE_SETT --digi_token $KINTREE_DIGI_TOKEN
done
for f in $FILES
do
echo $f
name=$(echo $f | cut -c3- | cut -d'-' -f1)A
poetry run python -m kintree_cli -p $CI_PROJECT_DIR/Fabrication/$f --assembly "{'ipn': '$name', 'rev': '$TAG'}" --settings $KINTREE_SETT --digi_token storage_token.json
done
- |
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file /tmp/token_storage.json $url
git_tag:
- !reference [.commands, strip_tag]