Skip to content

Commit

Permalink
[ci] use cirrus ci artifacs for storage
Browse files Browse the repository at this point in the history
  • Loading branch information
anuejn authored Nov 2, 2019
1 parent 2ca2463 commit 2b6dfe4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
46 changes: 21 additions & 25 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ docker_builder:
only_if: $CIRRUS_TAG !=~ "nightly/.*"
env:
TOKEN: ENCRYPTED[4e4d80e944992ff037ce22e89b29a5151ef75bf44b133db67fb3cfb5ff1f3aaf7722bf86028957fc99a07edecfbe0962]
UPLOAD_KEY: ENCRYPTED[218507b6609fd0eb0cd00663c48a10082930967672efe5655b56118e4f515561f0bbc893dbb6a5a943d55f384ec1285c]
SSH_PRIVATE_KEY: ENCRYPTED[f2f0f5401824d85c731ff5e6663a2388663a776deef6ccbbaee0bb0f968718131a87bbbfebb8960b3ad686cfa8b3debe]
matrix:
DEVICE: beta
DEVICE: micro
Expand All @@ -15,16 +13,31 @@ docker_builder:
git fetch origin pull/$CIRRUS_PR/head:pull/$CIRRUS_PR
fi;
git reset --hard $CIRRUS_CHANGE_IN_REPO
make_script: ./makefiles/docker-make.sh DEVICE=$DEVICE
test_script: ./makefiles/docker-make.sh DEVICE=$DEVICE test
release_script: |
make_script: |
./makefiles/docker-make.sh DEVICE=$DEVICE
# compress the image
[ -z $CIRRUS_PR ] || PR="-pr-$CIRRUS_PR"
FILE=axiom-$DEVICE$PR-$(git describe --always --abbrev=8).img.xz
FILE=axiom-$DEVICE$([ -z $CIRRUS_PR ] || echo "-pr-$CIRRUS_PR")-$(git describe --always --abbrev=8).img.xz
xz -T $(nproc) build/axiom-$DEVICE.img
mv build/axiom-$DEVICE.img.xz build/$FILE
image_upload_artifacts:
path: "build/axiom-*.img.xz"
image_notify_script: |
if [ $DEVICE = 'beta' ]; then
if [[ ! -z "$CIRRUS_PR" ]]; then
wget https://github.com/cloudposse/github-commenter/releases/download/0.5.0/github-commenter_linux_amd64
chmod a+x github-commenter_linux_amd64
./github-commenter_linux_amd64 -token $TOKEN -owner $CIRRUS_REPO_OWNER -repo $CIRRUS_REPO_NAME -type pr -number $CIRRUS_PR \
-comment "[//]: # (tracking-code: wasDinkDrybatghivSeerz8opDyajMoartEvbagyivwavdapGa)
Download a build of the latest (untested) commit at https://api.cirrus-ci.com/v1/artifact/task/$CIRRUS_TASK_ID/image_upload/$(ls build/axiom-*.img.xz)" \
-delete-comment-regex "wasDinkDrybatghivSeerz8opDyajMoartEvbagyivwavdapGa"
fi
fi
test_script: |
./makefiles/docker-make.sh DEVICE=$DEVICE test
github_release_script: |
if [ $CIRRUS_BRANCH = 'master' ]; then
FILE=axiom-$DEVICE$([ -z $CIRRUS_PR ] || echo "-pr-$CIRRUS_PR")-$(git describe --always --abbrev=8).img.xz
# get the github-release tool
wget https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2
tar -xf linux-amd64-github-release.tar.bz2
Expand All @@ -41,21 +54,4 @@ docker_builder:
./bin/linux/amd64/github-release upload -u $CIRRUS_REPO_OWNER -r $CIRRUS_REPO_NAME -t "nightly/$(git describe --always --abbrev=8)" -s $TOKEN -n "$FILE" -f build/$FILE
else
echo "not creating a github release, because this is not a build for the master branch"
fi
echo "$UPLOAD_KEY" | tr -d '\r' > /tmp/storage_key
chmod 600 /tmp/storage_key
scp -oStrictHostKeyChecking=no -i /tmp/storage_key -P 22201 build/$FILE [email protected]:/data/file_storage/data
rm /tmp/storage_key
echo "Download the image of this build at https://axiom-images.niemo.de/$FILE"
if [ $DEVICE = 'beta' ]; then
if [[ ! -z "$CIRRUS_PR" ]]; then
wget https://github.com/cloudposse/github-commenter/releases/download/0.5.0/github-commenter_linux_amd64
chmod a+x github-commenter_linux_amd64
./github-commenter_linux_amd64 -token $TOKEN -owner $CIRRUS_REPO_OWNER -repo $CIRRUS_REPO_NAME -type pr -number $CIRRUS_PR -comment "[//]: # (tracking-code: wasDinkDrybatghivSeerz8opDyajMoartEvbagyivwavdapGa)
Download a build of the latest commit at https://axiom-images.niemo.de/$FILE " -delete-comment-regex "wasDinkDrybatghivSeerz8opDyajMoartEvbagyivwavdapGa"
fi
fi
6 changes: 5 additions & 1 deletion makefiles/host/docker_entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@ else
fi

make -f makefiles/host/main.mk -I makefiles/host -j $(nproc) $*
RETURN_CODE=$?

umount build/root.fs
losetup -d /dev/loop0
losetup -d /dev/loop0

exit $RETURN_CODE

0 comments on commit 2b6dfe4

Please sign in to comment.