-
Notifications
You must be signed in to change notification settings - Fork 11
/
appcenter-post-clone.sh
33 lines (27 loc) · 1.21 KB
/
appcenter-post-clone.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Cancel builds with [skip ci] as AppCenter's Build Machines don't currently do this.
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
APPCENTER_APPID=""
if [ ! -z "$IOS_CODEPUSH_APPID" ]; then
APPCENTER_APPID="$IOS_CODEPUSH_APPID"
fi
if [ ! -z "$ANDROID_CODEPUSH_APPID" ]; then
APPCENTER_APPID="$ANDROID_CODEPUSH_APPID"
fi
echo "[Ueno RNS] Commit Message: $COMMIT_MESSAGE"
echo "[Ueno RNS] App Center App ID: $APPCENTER_APPID"
if [[ $COMMIT_MESSAGE = *"[skip ci]"* ]]; then
echo "[Ueno RNS] Skipping this build..."
curl -X PATCH "https://api.appcenter.ms/v0.1/apps/$APPCENTER_APPID/builds/$APPCENTER_BUILD_ID" -H "accept: application/json" -H "X-API-Token: $APPCENTER_API_KEY" -H "Content-Type: application/json" -d "{ \"status\": \"cancelling\" }"
else
echo "[Ueno RNS] This build is valid, not skipping."
fi
set -ex
echo "[Ueno RNS] Uninstalling current node"
brew uninstall node@6
NODE_VERSION="8.11.3"
echo "[Ueno RNS] Installing node version $NODE_VERSION"
curl "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.pkg" > "$HOME/Downloads/node-installer.pkg"
sudo installer -store -pkg "$HOME/Downloads/node-installer.pkg" -target "/"
echo "[Ueno RNS] Identifying selected node version..."
node --version
which node