mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 16:21:02 +00:00
ci: upload builds according to the tag if present (#198)
This commit is contained in:
committed by
GitHub
parent
c12ed7d8ac
commit
33873d7ab6
+12
-8
@@ -169,12 +169,13 @@ publish-docker-release:
|
|||||||
- docker info
|
- docker info
|
||||||
script:
|
script:
|
||||||
- VERSION="$(cat ./artifacts/VERSION)"
|
- VERSION="$(cat ./artifacts/VERSION)"
|
||||||
|
- EXTRATAG="${CI_COMMIT_TAG:-latest}"
|
||||||
- echo "Polkadot version = ${VERSION}"
|
- echo "Polkadot version = ${VERSION}"
|
||||||
- test -z "${VERSION}" && exit 1
|
- test -z "${VERSION}" && exit 1
|
||||||
- cd ./artifacts
|
- cd ./artifacts
|
||||||
- docker build --tag $CONTAINER_IMAGE:$VERSION --tag $CONTAINER_IMAGE:latest .
|
- docker build --tag $CONTAINER_IMAGE:$VERSION --tag $CONTAINER_IMAGE:$EXTRATAG .
|
||||||
- docker push $CONTAINER_IMAGE:$VERSION
|
- docker push $CONTAINER_IMAGE:$VERSION
|
||||||
- docker push $CONTAINER_IMAGE:latest
|
- docker push $CONTAINER_IMAGE:$EXTRATAG
|
||||||
after_script:
|
after_script:
|
||||||
- docker logout
|
- docker logout
|
||||||
# only VERSION information is needed for the deployment
|
# only VERSION information is needed for the deployment
|
||||||
@@ -191,16 +192,19 @@ publish-s3-release:
|
|||||||
BUCKET: "releases.parity.io"
|
BUCKET: "releases.parity.io"
|
||||||
PREFIX: "polkadot/${ARCH}-${DOCKER_OS}"
|
PREFIX: "polkadot/${ARCH}-${DOCKER_OS}"
|
||||||
script:
|
script:
|
||||||
- aws s3 sync ./artifacts/ s3://${BUCKET}/${PREFIX}/$(cat ./artifacts/VERSION)/
|
- VERSION="${CI_COMMIT_TAG:-$(cat ./artifacts/VERSION)}"
|
||||||
|
# LATEST_BRANCH will be empty if it's not a tag build i.e. CI_COMMIT_TAG is unset
|
||||||
|
- LATEST_BRANCH="$(echo $CI_COMMIT_TAG | sed -n -r 's/^(v[0-9]+\.[0-9]+)\.[0-9]+$/\1/p')"
|
||||||
|
- aws s3 sync ./artifacts/ s3://${BUCKET}/${PREFIX}/${VERSION}/
|
||||||
- echo "update objects in latest path"
|
- echo "update objects in latest path"
|
||||||
- for file in ./artifacts/*; do
|
- for file in ./artifacts/*; do
|
||||||
name="$(basename ${file})";
|
name="$(basename ${file})";
|
||||||
aws s3api copy-object
|
aws s3api copy-object
|
||||||
--copy-source ${BUCKET}/${PREFIX}/$(cat ./artifacts/VERSION)/${name}
|
--copy-source ${BUCKET}/${PREFIX}/${VERSION}/${name}
|
||||||
--bucket ${BUCKET} --key ${PREFIX}/latest/${name};
|
--bucket ${BUCKET} --key ${PREFIX}/latest${LATEST_BRANCH}/${name};
|
||||||
done
|
done
|
||||||
after_script:
|
after_script:
|
||||||
- aws s3 ls s3://${BUCKET}/${PREFIX}/latest/
|
- aws s3 ls s3://${BUCKET}/${PREFIX}/latest${LATEST_BRANCH}/
|
||||||
--recursive --human-readable --summarize
|
--recursive --human-readable --summarize
|
||||||
|
|
||||||
|
|
||||||
@@ -219,8 +223,8 @@ publish-s3-release:
|
|||||||
- kubernetes-parity-build
|
- kubernetes-parity-build
|
||||||
before_script:
|
before_script:
|
||||||
- test -z "${DEPLOY_TAG}" &&
|
- test -z "${DEPLOY_TAG}" &&
|
||||||
test -f ./artifacts/VERSION &&
|
test "${CI_COMMIT_TAG}" -o -f ./artifacts/VERSION &&
|
||||||
DEPLOY_TAG="$(cat ./artifacts/VERSION)"
|
DEPLOY_TAG="${CI_COMMIT_TAG:-$(cat ./artifacts/VERSION)}"
|
||||||
- test "${DEPLOY_TAG}" || ( echo "Neither DEPLOY_TAG nor VERSION information available"; exit 1 )
|
- test "${DEPLOY_TAG}" || ( echo "Neither DEPLOY_TAG nor VERSION information available"; exit 1 )
|
||||||
script:
|
script:
|
||||||
- echo "Polkadot version = ${DEPLOY_TAG}"
|
- echo "Polkadot version = ${DEPLOY_TAG}"
|
||||||
|
|||||||
Reference in New Issue
Block a user