This repository has been archived by the owner on Aug 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
azure-build-release.sh
executable file
·122 lines (110 loc) · 4.61 KB
/
azure-build-release.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/bash
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
VERSION="$1"
REBUILD_NUM="$2"
if [ -z "${VERSION}" ]; then
VERSION="$(date +%Y.%m.%d)"
fi
echo "Attempting to build version: $VERSION"
echo "Rebuild number: $REBUILD_NUM"
set -ex
if [ -n "$PLATFORM" ]; then
source os-metadata.inc.sh
if [ "$PLATFORM" != "$OS_VERSION" ] && [ "$PLATFORM" != "$OS_CODENAME" ]; then
echo "Requested build for Mac OS X $PLATFORM" \
"but we are on $OS_VERSION ($OS_CODENAME)."
echo "Nothing to do here, good bye."
exit 0
fi
fi
if [ -n "$SKIP_IF_DONE" ]; then
source os-metadata.inc.sh
brew upgrade
brew install jq
if (
curl --retry 5 "https://hhvm.com/api/build-status/$VERSION" \
| jq .succeeded | grep "\"macos-$OS_CODENAME\""
); then
echo "Package for Mac OS X $OS_VERSION ($OS_CODENAME)" \
"has already been successfully built."
echo "Nothing to do here, good bye."
exit 0
fi
fi
# Azure High Sierra workers have:
# - python@2, which causes issues installing python 3
# - currently conflicting bazel and bazelisk packages, and we don't need
# either
for PKG in python@2 bazel bazelisk; do
brew uninstall $PKG || true
done
# ... and Catalina has an `openssl` 1.0 package that the 1.1 package doesn't
# play nicely with upgrading from as of 2020-10-12
brew uninstall openssl || true
# Upgrading this causes a symlink conflict in /usr/local/bin as of 2021-07-16
brew uninstall mongodb-compass || true
brew uninstall mongodb-community || true
# Incompatible with libnghttp2, which curl depends on - 2021-10-05
brew unlink nghttp2 || true
# ... and this is pointing in to /Library/Frameworks/ as of 2021-09-07
rm -f /usr/local/bin/{2to3,py*}
brew update
brew upgrade
# awscli is also needed, but now pre-installed, not via brew
brew install gnu-sed gnupg
# uncomment if we ever need another Homebrew patch
#WORKDIR="$(pwd)"
#(
# cd /usr/local/Homebrew
# patch -p1 < "$WORKDIR/filename.patch" || true
#)
brew tap hhvm/hhvm
DEPS=$(brew deps --include-build hhvm-nightly)
brew install $DEPS || brew link --overwrite $DEPS
gpg --import <<ENDKEY
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFn8koEBEAC2tPtkphj8gZYHI9mTNUHfQalDo+MNWTGUTNB42asjhTNjipzM
VSxjaZSl5cMLg5YCRuT0AbSIe529FH23yEElc03cGVGgoEnmXtE4+2v7Xa30wCGO
5oUxKfbVatsxEs1y8QEr5Gt+CUFmsApOKgiZq0MsPYmFAuC9CbWdXYa8+E00bXOa
cHCpe+GncCxQmExm7TlrUnURnf3RnNWSEkuPKED/aVggzxNVN6RgRRm4ssZJasM3
TwoI1nVysO5jMfPClvupYscoktO44HBZzH2EeEdpjSV+toD3aZCbmWzXyZjogrFN
j4k5Mme0Xqr4DvRPk5M9SxcQASsCQ8VTyu+ZBUG6zJbddLDEA1BMNIZOG5MyX58O
zed255Q85SAyjHu8pltkfGLd56+MYsckpHaBPMFoCFM4iPcpXOlgcU96pdXJbrR2
mjYI4Le9qRJYYP2kGPkopPwK8nbZJ5Wr7xaclxEc/ODH3mv57KJD7lzmwpnvvmsn
kR/wUHOqwrXojp/oZCUK8KembLiT+MMkY3bne+IY9ef/1qwu4flVBP1CpoaMQEwh
dqzihfwyQ+57ATZHJaj8V9pKAxWh/Df4iFN5mMWA15eBLhRMbAWKJIo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QVf9xlVhnR7N597aKtU5GrpbvtlJy
CoQVtzBqYKcuLC4ZFRiB33HwZrZIxTPH27UUaj1QBz748zIMC6wvtldshjNAAeRr
Jz28twPO2D7svNIaPt2+OXAuRs2yUhitcsDLBV0UlOQ8xH+hzWANyhaJAS7p0k35
kyFOG+n6+2qQkGdlHHuqEzdCL3EiOiK6RrvbWNUnwiG3BdZWgs43hZZBAseX3CHu
MM3vIX/Fc/kuuaCWi2ysyKf7jyi/RiVIAKuLbxAB8eHsyo2G5lA=
=3DTP
-----END PGP PUBLIC KEY BLOCK-----
ENDKEY
HOMEBREW_PREFIX="$(brew config --quiet | awk '/HOMEBREW_PREFIX/ {print $NF}')"
cd "$HOMEBREW_PREFIX/Homebrew/Library/Taps/hhvm/homebrew-hhvm"
git config remote.origin.url [email protected]:hhvm/homebrew-hhvm.git
git config user.name "HHVM Homebrew Bot (Azure)"
git config user.email [email protected]
exec ./build-release.sh "$VERSION" "$REBUILD_NUM"