-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add clone-key option for local with private go modules (#257)
Co-authored-by: Andrew Gouin <[email protected]>
- Loading branch information
1 parent
67a28bb
commit ade9d02
Showing
2 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,17 @@ ARG BUILD_DIR | |
|
||
ADD ${BUILD_DIR}/go.mod ${BUILD_DIR}/go.sum ./ | ||
|
||
ARG CLONE_KEY | ||
|
||
RUN if [ ! -z "${CLONE_KEY}" ]; then\ | ||
mkdir -p ~/.ssh;\ | ||
echo "${CLONE_KEY}" | base64 -d > ~/.ssh/id_ed25519;\ | ||
chmod 600 ~/.ssh/id_ed25519;\ | ||
apk add openssh;\ | ||
git config --global --add url."ssh://[email protected]/".insteadOf "https://github.com/";\ | ||
ssh-keyscan github.com >> ~/.ssh/known_hosts;\ | ||
fi | ||
|
||
# Download go mod dependencies, if there is no custom build directory | ||
# Note: a custom build dir indicates a monorepo with potential dependencies we can't anticipate atm | ||
RUN set -eux; \ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,23 +15,32 @@ RUN if [ "${TARGETARCH}" = "arm64" ] && [ "${BUILDARCH}" != "arm64" ]; then\ | |
ARG GITHUB_ORGANIZATION | ||
ARG REPO_HOST | ||
|
||
WORKDIR /go/src/${REPO_HOST}/${GITHUB_ORGANIZATION} | ||
WORKDIR /go/src/${REPO_HOST}/${GITHUB_ORGANIZATION}/${GITHUB_REPO} | ||
|
||
ARG GITHUB_REPO | ||
ARG VERSION | ||
ARG BUILD_TIMESTAMP | ||
|
||
ADD . . | ||
|
||
WORKDIR /go/src/${REPO_HOST}/${GITHUB_ORGANIZATION}/${GITHUB_REPO} | ||
|
||
ARG BUILD_TARGET | ||
ARG BUILD_ENV | ||
ARG BUILD_TAGS | ||
ARG PRE_BUILD | ||
ARG BUILD_DIR | ||
ARG WASMVM_VERSION | ||
|
||
ARG CLONE_KEY | ||
|
||
RUN if [ ! -z "${CLONE_KEY}" ]; then\ | ||
mkdir -p ~/.ssh;\ | ||
echo "${CLONE_KEY}" | base64 -d > ~/.ssh/id_ed25519;\ | ||
chmod 600 ~/.ssh/id_ed25519;\ | ||
apk add openssh;\ | ||
git config --global --add url."ssh://[email protected]/".insteadOf "https://github.com/";\ | ||
ssh-keyscan github.com >> ~/.ssh/known_hosts;\ | ||
fi | ||
|
||
RUN set -eux;\ | ||
LIBDIR=/lib;\ | ||
if [ "${TARGETARCH}" = "arm64" ]; then\ | ||
|