add .gitlab-ci.yml for continuous platform tests
This commit is contained in:
@@ -59,6 +59,7 @@ jobs:
|
|||||||
- run: ./lazy.sh devsetup
|
- run: ./lazy.sh devsetup
|
||||||
|
|
||||||
- run: make zrepl-bin
|
- run: make zrepl-bin
|
||||||
|
- run: make test-platform-bin
|
||||||
- run: make vet
|
- run: make vet
|
||||||
- run: make lint
|
- run: make lint
|
||||||
- run: make release
|
- run: make release
|
||||||
@@ -98,6 +99,30 @@ jobs:
|
|||||||
-X POST \
|
-X POST \
|
||||||
-d '{"context":"zrepl/publish-ci-artifacts", "state": "success", "description":"CI Build Artifacts for '"$JOB_NAME"'", "target_url":"https://minio.cschwarz.com/minio/zrepl-ci-artifacts/'"$COMMIT"'/"}'
|
-d '{"context":"zrepl/publish-ci-artifacts", "state": "success", "description":"CI Build Artifacts for '"$JOB_NAME"'", "target_url":"https://minio.cschwarz.com/minio/zrepl-ci-artifacts/'"$COMMIT"'/"}'
|
||||||
|
|
||||||
|
- run:
|
||||||
|
shell: /bin/bash -eo pipefail
|
||||||
|
when: always
|
||||||
|
command: |
|
||||||
|
if [ -n "$CIRCLE_PR_NUMBER" ]; then # CIRCLE_PR_NUMBER is guaranteed to be only present in forked PRs (external)
|
||||||
|
echo "Forked PR detected. Sry, can't trust you with credentials to external artifact store, use CircleCI's instead."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
set -u # from now on
|
||||||
|
|
||||||
|
# Trigger Platform Tests
|
||||||
|
# ZREPL_BOT_GIT_PRWN_EU_ACCESS_TOKEN from secrets
|
||||||
|
## Sync this commit to the GitLab
|
||||||
|
git remote add prwn-gitlab "https://zrepl-bot:$ZREPL_BOT_GIT_PRWN_EU_ACCESS_TOKEN@git.prwn.eu/problame/zrepl.git"
|
||||||
|
REMOTE_REF=circleci/$CIRCLE_BRANCH/$CIRCLE_BUILD_NUM
|
||||||
|
git push -f prwn-gitlab "HEAD:$REMOTE_REF"
|
||||||
|
## Trigger Tests
|
||||||
|
curl -v --request POST \
|
||||||
|
--header "PRIVATE-TOKEN: $ZREPL_BOT_GIT_PRWN_EU_ACCESS_TOKEN" \
|
||||||
|
--header "Content-Type: application/json" \
|
||||||
|
--data '{ "ref":"'"$REMOTE_REF"'", "variables": [ {"key":"ZREPL_MAIN_REPO_COMMIT", "value": "'"$CIRCLE_SHA1"'" }, { "key":"ZREPL_CI_BUILDJOB", "value": "'"$CIRCLE_JOB"'" } ] } ' \
|
||||||
|
"https://git.prwn.eu/api/v4/projects/13/pipeline"
|
||||||
|
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
shell: /bin/bash -euo pipefail
|
shell: /bin/bash -euo pipefail
|
||||||
command: |
|
command: |
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
build-and-run-platformtests:
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
script:
|
||||||
|
- mkdir artifacts
|
||||||
|
# platformtests are installed by the CI environment
|
||||||
|
- /opt/platformtest-linux-amd64
|
||||||
|
-test.coverprofile artifacts/platformtest.cover
|
||||||
|
-test.v
|
||||||
|
__DEVEL--i-heard-you-like-tests
|
||||||
|
-poolname zreplplatformtest
|
||||||
|
-imagepath /tmp/zreplplatformtest.pool.img
|
||||||
|
-mountpoint /tmp/zreplplatformtest.pool
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- artifacts
|
||||||
Executable
+16
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
|
commit="$1"
|
||||||
|
build="$2"
|
||||||
|
src="$3"
|
||||||
|
dst="$4"
|
||||||
|
|
||||||
|
[ -n "$commit" -a -n "$build" -a -n "$src" -a -n "$dst" ] || ( echo "arguments must not be empty"; exit 1 )
|
||||||
|
|
||||||
|
aws="aws --endpoint-url https://minio.cschwarz.com --no-sign-request"
|
||||||
|
|
||||||
|
|
||||||
|
path="s3://zrepl-ci-artifacts/$commit/$build/$src"
|
||||||
|
$aws s3 cp "$path" "$dst"
|
||||||
Reference in New Issue
Block a user