Further tweaks to CI scripts

This commit is contained in:
Morgan Pretty 2023-08-01 15:27:40 +10:00
parent 00aef6ca97
commit 2341fbf59f
2 changed files with 14 additions and 19 deletions

View File

@ -23,23 +23,22 @@ local load_cocoapods_cache = {
name: 'Load CocoaPods Cache', name: 'Load CocoaPods Cache',
commands: [ commands: [
||| |||
if [[ ! -f /Users/drone/.cocoapods_cache.valid ]]; then LOOP_BREAK=0
rm -f /Users/drone/.cocoapods_cache.lock
fi
|||,
|||
while test -e /Users/drone/.cocoapods_cache.lock; do while test -e /Users/drone/.cocoapods_cache.lock; do
sleep 1 sleep 1
LOOP_BREAK=$((LOOP_BREAK + 1))
if [[ LOOP_BREAK >= 600 ]]; then
'rm -f /Users/drone/.cocoapods_cache.lock'
fi
done done
|||, |||,
'touch /Users/drone/.cocoapods_cache.lock', 'touch /Users/drone/.cocoapods_cache.lock',
'rm -f /Users/drone/.cocoapods_cache.valid',
||| |||
if [[ -d /Users/drone/.cocoapods_cache ]]; then if [[ -d /Users/drone/.cocoapods_cache ]]; then
cp -r /Users/drone/.cocoapods_cache ./Pods cp -r /Users/drone/.cocoapods_cache ./Pods
fi fi
|||, |||,
'touch /Users/drone/.cocoapods_cache.valid',
'rm -f /Users/drone/.cocoapods_cache.lock' 'rm -f /Users/drone/.cocoapods_cache.lock'
] ]
}; };
@ -49,24 +48,23 @@ local update_cocoapods_cache = {
name: 'Update CocoaPods Cache', name: 'Update CocoaPods Cache',
commands: [ commands: [
||| |||
if [[ ! -f /Users/drone/.cocoapods_cache.valid ]]; then LOOP_BREAK=0
rm -f /Users/drone/.cocoapods_cache.lock
fi
|||,
|||
while test -e /Users/drone/.cocoapods_cache.lock; do while test -e /Users/drone/.cocoapods_cache.lock; do
sleep 1 sleep 1
LOOP_BREAK=$((LOOP_BREAK + 1))
if [[ LOOP_BREAK >= 600 ]]; then
'rm -f /Users/drone/.cocoapods_cache.lock'
fi
done done
|||, |||,
'touch /Users/drone/.cocoapods_cache.lock', 'touch /Users/drone/.cocoapods_cache.lock',
'rm -f /Users/drone/.cocoapods_cache.valid',
||| |||
if [[ -d ./Pods ]]; then if [[ -d ./Pods ]]; then
rm -rf /Users/drone/.cocoapods_cache rm -rf /Users/drone/.cocoapods_cache
cp -r ./Pods /Users/drone/.cocoapods_cache cp -r ./Pods /Users/drone/.cocoapods_cache
fi fi
|||, |||,
'touch /Users/drone/.cocoapods_cache.valid',
'rm -f /Users/drone/.cocoapods_cache.lock' 'rm -f /Users/drone/.cocoapods_cache.lock'
] ]
}; };
@ -134,7 +132,7 @@ local update_cocoapods_cache = {
name: 'Build', name: 'Build',
commands: [ commands: [
'mkdir build', 'mkdir build',
'xcodebuild archive -workspace Session.xcworkspace -scheme Session -derivedDataPath ./build/derivedData -configuration "App Store Release" -sdk iphoneos -archivePath ./build/Session.xcarchive -destination "generic/platform=iOS" -allowProvisioningUpdates CODE_SIGNING_ALLOWED=NO' 'xcodebuild archive -workspace Session.xcworkspace -scheme Session -derivedDataPath ./build/derivedData -configuration "App Store Release" -sdk iphoneos -archivePath ./build/Session.xcarchive -destination "generic/platform=iOS" -allowProvisioningUpdates CODE_SIGNING_ALLOWED=NO | ./Pods/xcbeautify/xcbeautify --is-ci'
], ],
}, },
update_cocoapods_cache, update_cocoapods_cache,

View File

@ -3,8 +3,6 @@
# Script used with Drone CI to upload build artifacts (because specifying all this in # Script used with Drone CI to upload build artifacts (because specifying all this in
# .drone.jsonnet is too painful). # .drone.jsonnet is too painful).
set -o errexit set -o errexit
if [ -z "$SSH_KEY" ]; then if [ -z "$SSH_KEY" ]; then
@ -35,14 +33,13 @@ prod_path="build/Session.xcarchive"
sim_path="build/Session_sim.xcarchive/Products/Applications/Session.app" sim_path="build/Session_sim.xcarchive/Products/Applications/Session.app"
mkdir -p build mkdir -p build
echo "Test" > "build/test.txt"
if [ ! -d $prod_path ]; then if [ ! -d $prod_path ]; then
cp -av $prod_path "$base" cp -av $prod_path "$base"
else if [ ! -d $sim_path ]; then else if [ ! -d $sim_path ]; then
cp -av $sim_path "$base" cp -av $sim_path "$base"
else else
echo "Expected a file to upload, found none" >&2 echo -e "\n\n\n\e[31;1mExpected a file to upload, found none\e[0m" >&2
exit 1 exit 1
fi fi