Skip to content

Commit 5fa30b2

Browse files
committed
chore(pack): change pack to go build
1 parent a5cf60f commit 5fa30b2

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

stacks/pack/build.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@
66
# Implement build function
77
function build() {
88
generate-stack-path
9-
if [[ "${OS_ARCH}" == "amd64" ]]; then
10-
pack_download_url="https://github.com/buildpacks/pack/releases/download/v${STACK_VERSION}/pack-v${STACK_VERSION}-linux.tgz"
11-
else
12-
pack_download_url="https://github.com/buildpacks/pack/releases/download/v${STACK_VERSION}/pack-v${STACK_VERSION}-linux-${OS_ARCH}.tgz"
13-
fi
149
BIN_DIR="${DATA_DIR}"/bin
1510
mkdir -p "${BIN_DIR}"
16-
curl -sSL "${pack_download_url}" | tar xvz -C "${BIN_DIR}"
11+
install-stack go "${GO_VERSION}"
12+
. init-stack
13+
curl -fsSL -o tmp.tar.gz https://github.com/buildpacks/pack/archive/refs/tags/v${STACK_VERSION}.tar.gz
14+
tar -xvzf tmp.tar.gz
15+
cd pack-${STACK_VERSION}
16+
# fix CVE-2022-28948
17+
go get -u ./...; go mod tidy; go mod vendor
18+
19+
go build -o "${BIN_DIR}"/"${STACK_NAME}"
20+
cd ..
21+
rm -rf pack-${STACK_VERSION} tmp.tar.gz
1722
}
1823

1924
# call build stack

0 commit comments

Comments
 (0)