-
-
Save bootstraponline/b01041c05b17c3a295757651fdde52e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
if [ -z "$BITRISEIO_GIT_BRANCH_DEST" ] | |
then | |
echo "No PR detected. Skipping selective builds." | |
exit 0 | |
fi | |
git fetch origin "$BITRISEIO_GIT_BRANCH_DEST" --depth 1 | |
DIFF_FILES="$(git diff --name-only origin/${BITRISEIO_GIT_BRANCH_DEST})" | |
set +x | |
PATH_PATTERN=$(ruby -e 'puts ENV["TRIGGER_PATHS"].strip.split("\n").map { |e| e.gsub("/", "\\/") }.join("|") ') | |
echo "PATH_PATTERN: $PATH_PATTERN" | |
set -x | |
check_app_diff () | |
{ | |
set +e | |
echo $DIFF_FILES | grep -E $1 | |
exit_status=$? | |
if [[ $exit_status = 1 ]]; then | |
echo "No changes detected. Aborting build." | |
curl -X POST \ | |
https://api.bitrise.io/v0.1/apps/$BITRISE_APP_SLUG/builds/$BITRISE_BUILD_SLUG/abort \ | |
-H "authorization: token $BITRISE_TOKEN" \ | |
-H 'content-type: application/json; charset=UTF-8' \ | |
-d '{ | |
"abort_reason": "Build skipped. No changes detected.", | |
"skip_notifications": true, | |
"abort_with_success": true | |
}' | |
else | |
echo "Changes detected. Running build." | |
fi | |
set -e | |
} | |
check_app_diff "$PATH_PATTERN" | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash -e | |
rm /etc/timezone | |
rm /etc/localtime | |
TIMEZONE="America/Denver" | |
export TZ="$TIMEZONE" | |
echo "$TIMEZONE" > /etc/timezone | |
cp "/usr/share/zoneinfo/${TIMEZONE}" /etc/localtime | |
dpkg-reconfigure -f noninteractive tzdata | |
# mac | |
# sudo systemsetup -settimezone America/Denver | |
# sudo systemsetup -gettimezone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
paths = [ | |
'rn/Teacher/', | |
'CanvasCore/', | |
'Podfile.lock', | |
'Frameworks/SoAnnotated/', | |
'Frameworks/Attendance/', | |
'Frameworks/CanvasKeymaster/' | |
] | |
puts paths.map { |e| e.gsub("/", "\\/") }.join '|' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add paths as env var in app settings. Must disable replace var in inputs, otherwise $ will be replaced.