Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ test-linux-stable: &test
test "${CI_COMMIT_REF_NAME}" = "kusama-nightly-staging" && (
echo "kusama-nightly-staging: change Cargo.toml to build against substrate:kusama-nightly-staging"
find . -name Cargo.toml -exec sed -i -r -e ':github.com/paritytech/substrate": { s:branch = "polkadot-(master|testing)":branch = "kusama-nightly-staging":; s:github.com/paritytech/substrate:gitlab.parity.io/parity/substrate.git:}' '{}' \;
sed -i -r 's:github.com/paritytech/substrate\?branch=polkadot-(master|testing):gitlab.parity.io/parity/substrate.git?branch=kusama-nightly-staging:' Cargo.lock
time cargo test --all --release --verbose) || \
time cargo test --all --release --verbose --locked
- sccache -s
Expand All @@ -108,8 +109,9 @@ build-linux-release: &build
script:
- |
test "${CI_COMMIT_REF_NAME}" = "kusama-nightly-staging" && (
echo "kusama-nightly-staging: change Cargo.toml to build against substrate:kusama-nightly-staging";
find . -name Cargo.toml -exec sed -i -r -e ':github.com/paritytech/substrate": { s:branch = "polkadot-(master|testing)":branch = "kusama-nightly-staging":; s:github.com/paritytech/substrate:gitlab.parity.io/parity/substrate.git:}' '{}' \; )
echo "kusama-nightly-staging: change Cargo.toml to build against substrate:kusama-nightly-staging"
find . -name Cargo.toml -exec sed -i -r -e ':github.com/paritytech/substrate": { s:branch = "polkadot-(master|testing)":branch = "kusama-nightly-staging":; s:github.com/paritytech/substrate:gitlab.parity.io/parity/substrate.git:}' '{}' \;
sed -i -r 's:github.com/paritytech/substrate\?branch=polkadot-(master|testing):gitlab.parity.io/parity/substrate.git?branch=kusama-nightly-staging:' Cargo.lock )
- time cargo build --release --verbose
- mkdir -p ./artifacts
- mv ./target/release/polkadot ./artifacts/.
Expand All @@ -135,6 +137,20 @@ build-linux-release: &build
cache: {}
<<: *build-refs
<<: *kubernetes-env
before_script:
- test -s ./artifacts/VERSION || exit 1
- LATEST_BRANCH="$(ls -1 .git/refs/remotes/origin/ | sed -r -n 's:v([0-9]+)\.([0-9]+):v\1.\2:p' | sort -V | tail -n1)"
- if [ "${CI_COMMIT_TAG}" ]; then
VERSION="${CI_COMMIT_TAG}";
else
VERSION="$(cat ./artifacts/VERSION)-$(cut -c 1-8 ./artifacts/polkadot.sha256)";
fi
- if expr match x${CI_COMMIT_TAG} x${LATEST_BRANCH}; then
EXTRATAG="latest";
else
EXTRATAG="latest-${CI_COMMIT_REF_NAME}";
fi
- echo "Polkadot version = ${VERSION} (TAG ${EXTRATAG})"



Expand All @@ -151,16 +167,11 @@ publish-docker-release:
GIT_STRATEGY: none
# DOCKERFILE: scripts/docker/Dockerfile
CONTAINER_IMAGE: parity/polkadot
before_script:
script:
- test "$Docker_Hub_User_Parity" -a "$Docker_Hub_Pass_Parity"
|| ( echo "no docker credentials provided"; exit 1 )
- docker login -u "$Docker_Hub_User_Parity" -p "$Docker_Hub_Pass_Parity"
- docker info
script:
- VERSION="$(cat ./artifacts/VERSION)"
- EXTRATAG="${CI_COMMIT_TAG:-latest}"
- echo "Polkadot version = ${VERSION}"
- test -z "${VERSION}" && exit 1
- cd ./artifacts
- docker build
--build-arg VCS_REF="${CI_COMMIT_SHA}"
Expand All @@ -185,19 +196,16 @@ publish-s3-release:
BUCKET: "releases.parity.io"
PREFIX: "polkadot/${ARCH}-${DOCKER_OS}"
script:
- 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"
- for file in ./artifacts/*; do
name="$(basename ${file})";
aws s3api copy-object
--copy-source ${BUCKET}/${PREFIX}/${VERSION}/${name}
--bucket ${BUCKET} --key ${PREFIX}/latest${LATEST_BRANCH}/${name};
--bucket ${BUCKET} --key ${PREFIX}/${EXTRATAG}/${name};
done
after_script:
- aws s3 ls s3://${BUCKET}/${PREFIX}/latest${LATEST_BRANCH}/
- aws s3 ls s3://${BUCKET}/${PREFIX}/${EXTRATAG}/
--recursive --human-readable --summarize


Expand Down