Commit ba677b99 authored by Aníbal Portero Hermida's avatar Aníbal Portero Hermida

Merge branch 'installer-path' into 'master'

Fix missing xz in gitlab artifacts; avoid posting when not in master; change tag path in aws

See merge request pantacor/pv-manifest!11
parents 7527fffa db86c53f
Pipeline #103886105 passed with stage
in 9 minutes and 3 seconds
......@@ -91,6 +91,7 @@ deployment:
- pvr add .
- pvr commit
# post device to pantahub
- test "$CI_COMMIT_REF_NAME" != "master" && DEPLOY="false"
- if test -z "$CI_COMMIT_TAG" ; then PH_DEVICE_OUT=$PH_DEVICE_LATEST; elif test -n "$PH_DEVICE_STABLE"; then PH_DEVICE_OUT=$PH_DEVICE_STABLE; else DEPLOY="false"; fi
- TOKEN=`http --ignore-stdin POST https://api.pantahub.com/auth/login username=$PHUSER password=$PHPASS | jq -r .token`
- test "$DEPLOY" = "false" || PANTAHUB_REVISION=$(pvr -a $TOKEN post -m `git describe --tags` $PH_DEVICE_OUT | grep Revision | sed -e 's/.*Revision \(.*\) (.*/\1/')
......@@ -100,21 +101,23 @@ deployment:
# prepare image artifact and metadata
- cd out/$TARGET/
- xz *.img
- "jq -n --arg pr \"$PANTAHUB_REVISION\" '{pantahubrevision: $pr}' > img.json"
# upload image and metadata to aws
- if test -z "$CI_COMMIT_TAG" ; then IMAGE_PATH="$CI_COMMIT_REF_NAME/latest/$CI_PIPELINE_ID/$TARGET"; else IMAGE_PATH="$CI_COMMIT_REF_NAME/stable/$CI_COMMIT_TAG/$TARGET"; fi
# upload image to aws
- if test -z "$CI_COMMIT_TAG" ; then IMAGE_PATH="$CI_COMMIT_REF_NAME/latest/$CI_PIPELINE_ID/$TARGET"; else IMAGE_PATH="$CI_COMMIT_REF_NAME/stable/$CI_PIPELINE_ID/$TARGET"; fi
- aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
- aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
- aws s3 cp *.img.xz s3://pantavisor-ci/$IMAGE_PATH/$TARGET.img.xz
# upload metadata
- "jq -n --arg pr \"$PANTAHUB_REVISION\" '{pantahubrevision: $pr}' > img.json"
- aws s3 cp img.json s3://pantavisor-ci/$IMAGE_PATH/img.json
# build installer
# upload installer installer
- test -z "$INSTALLER" && exit 0
- rm -f *img *.img.xz
- cd ../../
- MMC_SIZE=1024 PVR_MERGE_SRC=device-checkout/.pvr PV_BUILD_INTERACIVE=false PANTAVISOR_DEBUG=yes ./build.docker.sh $ARCH-installer
- cd out/$TARGET/
- xz *.img
- aws s3 cp *.img.xz s3://pantavisor-ci/$IMAGE_PATH/$TARGET-installer.img.xz
- xz *installer*.img
- aws s3 cp *installer*.img.xz s3://pantavisor-ci/$IMAGE_PATH-installer/$TARGET-installer.img.xz
# upload metadata
- aws s3 cp img.json s3://pantavisor-ci/$IMAGE_PATH-installer/img.json
only:
- pushes
- tags
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment