diff --git a/kibot-ci.yml b/kibot-ci.yml index 15b2cc4..0a3b9e3 100644 --- a/kibot-ci.yml +++ b/kibot-ci.yml @@ -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]