CI: refactor configuration file

Cache instructions will query system to check if existing cache is available.
While cache will unlikely to be available in build task, it is better to
make it queried before build so if cache folder appear, it will be deleted by
`rm -rf "debs-${TERMUX_ARCH}"`.
This commit is contained in:
Leonid Pliushch 2019-05-02 15:16:52 +03:00
parent 0fdd2c60a8
commit fddb17f159

View File

@ -31,6 +31,23 @@ build_task:
git reset --hard "$CIRRUS_CHANGE_IN_REPO"
fi
# Setup cache to make built packages available for the next tasks.
share_aarch64_packages_cache:
folder: "./cached-debs-aarch64"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-aarch64"
share_arm_packages_cache:
folder: "./cached-debs-arm"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-arm"
share_i686_packages_cache:
folder: "./cached-debs-i686"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-i686"
share_x86_64_packages_cache:
folder: "./cached-debs-x86_64"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-x86_64"
# Determine changes in repository and build modified packages.
build_script: |
for package in $(./scripts/build/ci/determine_git_changes.sh); do
@ -48,23 +65,6 @@ build_task:
cp -a "cached-debs-${TERMUX_ARCH}" ./debs
fi
# Make built packages available for the next tasks.
share_aarch64_packages_cache:
folder: "./cached-debs-aarch64"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-aarch64"
share_arm_packages_cache:
folder: "./cached-debs-arm"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-arm"
share_i686_packages_cache:
folder: "./cached-debs-i686"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-i686"
share_x86_64_packages_cache:
folder: "./cached-debs-x86_64"
fingerprint_script: echo "${CIRRUS_CHANGE_IN_REPO}-x86_64"
# Also make them downloadable from the UI.
store_packages_artifacts:
path: "./debs/*.deb"