-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildenv
110 lines (95 loc) · 3.57 KB
/
buildenv
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
# bump: buildkite-version /BUILDKITE_VERSION="(.*)"/ https://github.com/buildkite/agent.git|semver:*
BUILDKITE_VERSION="3.61.0"
export ZOPEN_STABLE_TAG="v${BUILDKITE_VERSION}"
export ZOPEN_STABLE_URL="https://github.com/buildkite/agent.git"
export ZOPEN_STABLE_DEPS="comp_go git curl"
export ZOPEN_BUILD_LINE="STABLE"
export ZOPEN_CATEGORIES="development"
export ZOPEN_NAME="buildkite"
export ZOPEN_COMP=GO
export ZOPEN_CONFIGURE="zopen_config"
export ZOPEN_CONFIGURE_MINIMAL=1
export ZOPEN_MAKE="go"
export ZOPEN_MAKE_OPTS="build -o buildkite-agent ./agent"
export ZOPEN_MAKE_MINIMAL=1
export ZOPEN_INSTALL="zopen_install"
export ZOPEN_CHECK="skip"
export ZOPEN_CLEAN="zopen_clean"
zopen_init()
{
export CGO_ENABLED=0
export GOBIN=$ZOPEN_INSTALL_DIR/bin
mkdir -p $ZOPEN_INSTALL_DIR/bin
unset CC CXX
}
zopen_config()
{
RISTRETTO_TAG=$(cat go.mod | grep ristretto | cut -d ' ' -f 2)
MACHINEID_TAG=$(cat go.mod | grep machineid | cut -d ' ' -f 2)
AZURESDK=$(cat go.mod | grep azure-sdk-for-go/sdk/storage/azblob | cut -d ' ' -f 2)
AZURESDK_TAG="sdk-storage-azblob-${AZURESDK}"
PTY_TAG=$(cat go.mod | grep pty | cut -d ' ' -f 2)
cd .. && echo ""
git clone https://github.com/outcaste-io/ristretto.git
echo "Checking out $RISTRETTO_TAG"
cd ristretto && git -c advice.detachedHead=false checkout $RISTRETTO_TAG
curl -s -o ristretto--$RISTRETTO_TAG.patch "https://raw.githubusercontent.com/ZOSOpenTools/wharf/main/deps-patches/ristretto--$RISTRETTO_TAG.patch"
git apply -v ristretto--$RISTRETTO_TAG.patch
cd .. && echo ""
git clone https://github.com/denisbrodbeck/machineid.git
echo "Checking out $MACHINEID_TAG"
cd machineid && git -c advice.detachedHead=false checkout $MACHINEID_TAG
go mod init && go mod tidy
curl -s -o machineid--$MACHINEID_TAG.patch "https://raw.githubusercontent.com/ZOSOpenTools/wharf/main/deps-patches/machineid--$MACHINEID_TAG.patch"
git apply -v machineid--$MACHINEID_TAG.patch
cd .. && echo ""
git clone https://github.com/Azure/azure-sdk-for-go.git
echo "Checking out $AZURESDK_TAG"
cd azure-sdk-for-go && git -c advice.detachedHead=false checkout "sdk/storage/azblob/$AZURESDK"
curl -s -o azure-sdk-for-go--$AZURESDK_TAG.patch "https://raw.githubusercontent.com/ZOSOpenTools/wharf/main/deps-patches/azure-sdk-for-go--$AZURESDK_TAG.patch"
git apply -v azure-sdk-for-go--$AZURESDK_TAG.patch
cd .. && echo ""
git clone https://github.com/creack/pty.git
echo "Checking out $PTY_TAG"
cd pty && git -c advice.detachedHead=false checkout $PTY_TAG
curl -s -o pty--$PTY_TAG.patch "https://raw.githubusercontent.com/ZOSOpenTools/wharf/main/deps-patches/pty--$PTY_TAG.patch"
git apply -v pty--$PTY_TAG.patch
cd .. && echo ""
go work init ./agent ./ristretto ./machineid ./azure-sdk-for-go/sdk/storage/azblob ./pty
}
zopen_install()
{
echo "here-at-install $PWD"
cd agent
go install
}
zopen_post_install()
{
echo "here-at-post $PWD"
echo "here-at-post $ZOPEN_INSTALL_DIR"
mv $ZOPEN_INSTALL_DIR/bin/agent $ZOPEN_INSTALL_DIR/bin/buildkite-agent
}
zopen_clean()
{
echo "here-at-clean $PWD"
# rm -rf go.work go.work.sum
chmod -R 755 go
rm -rf go* buildkite-agent agent ristretto machineid azure-sdk-for-go pty
}
zopen_check_results()
{
dir="$1"
pfx="$2"
chk="$1/$2_check.log"
# Echo the following information to gauge build health
echo "actualFailures:0"
echo "totalTests:1"
echo "expectedFailures:0"
echo "expectedTotalTests:1"
}
zopen_get_version()
{
# Modify to echo the version of your tool/library
# Rather than hardcoding the version, obtain the version by running the tool/library
echo "${BUILDKITE_VERSION}"
}