ncdns-repro/tools/cirrus_gen_yml.sh
2021-02-20 23:45:32 +00:00

80 lines
2.3 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euxo pipefail
shopt -s nullglob globstar
print_os_arch () {
local OS="$1"
local ARCH="$2"
# Pre-download tarballs and Git repos
echo "${CHANNEL}_${OS}_${ARCH}_download_docker_builder:
timeout_in: 120m
out_${CHANNEL}_${OS}_${ARCH}_cache:
folder: out
fingerprint_script:
- \"echo out_${CHANNEL}_${OS}_${ARCH}\"
reupload_on_changes: true
populate_script:
- \"mkdir -p out\"
git_${CHANNEL}_${OS}_${ARCH}_cache:
folder: git_clones
fingerprint_script:
- \"echo git_${CHANNEL}_${OS}_${ARCH}\"
reupload_on_changes: true
populate_script:
- \"mkdir -p git_clones\"
build_script:
- \"./tools/cirrus_build_project.sh ncdns ${CHANNEL} ${OS} ${ARCH} 0\""
echo ""
# TODO fine-tune this list
for PROJECT in goeasyconfig ncdns ncp11 ncprop279; do
echo "${CHANNEL}_${OS}_${ARCH}_${PROJECT}_docker_builder:
timeout_in: 120m
out_${CHANNEL}_${OS}_${ARCH}_cache:
folder: out
fingerprint_script:
- \"echo out_${CHANNEL}_${OS}_${ARCH}\"
reupload_on_changes: true
populate_script:
- \"mkdir -p out\"
git_${CHANNEL}_${OS}_${ARCH}_cache:
folder: git_clones
fingerprint_script:
- \"echo git_${CHANNEL}_${OS}_${ARCH}\"
reupload_on_changes: true
populate_script:
- \"mkdir -p git_clones\"
build_script:
- \"./tools/cirrus_build_project.sh ${PROJECT} ${CHANNEL} ${OS} ${ARCH} 1\""
# Depend on previous project
if [[ "$PROJECT" == "goeasyconfig" ]]; then
echo " depends_on:
- \"${CHANNEL}_${OS}_${ARCH}_download\""
else
echo " depends_on:
- \"${CHANNEL}_${OS}_${ARCH}_${PREV_PROJECT}\""
fi
local PREV_PROJECT="$PROJECT"
echo ""
done
}
(
for CHANNEL in release; do
print_os_arch linux x86_64
print_os_arch linux i686
print_os_arch windows x86_64
print_os_arch windows i686
done
) > .cirrus.yml
# Timeout issues?
# Might want to increase the timeout -- but we're already using the 2 hour max.
# Might want to bump the CPU count -- but that's blocked by cirrus-ci-docs issue #741.
# Might want to split into smaller project sets.
# What is the CPU count limit? "Linux Containers" docs say 8.0 CPU and 24 GB RAM; "FAQ" says 16.0 CPU. docker_builder VM's are really 4.0 CPU and 15 GB RAM (12 GB of which is unused by the OS).