-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3932 from deitch/build-args-with-versions
include source repo, revision and go package version as build-args
- Loading branch information
Showing
7 changed files
with
109 additions
and
4 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM alpine:3.17 | ||
|
||
ARG SOURCE=FAILED | ||
ARG REVISION=FAILED | ||
ARG GOPKGVERSION=FAILED | ||
|
||
RUN echo "printf \"Build-arg test source $SOURCE\\n\"" >> check.sh | ||
RUN echo "printf \"Build-arg test revision $REVISION\\n\"" >> check.sh | ||
RUN echo "printf \"Build-arg test gopkgversion $GOPKGVERSION\\n\"" >> check.sh | ||
|
||
ENTRYPOINT ["/bin/sh", "/check.sh"] |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
image: build-args-test | ||
network: true | ||
arches: | ||
- amd64 | ||
- arm64 |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
# SUMMARY: Check that the build-args are correctly passed to Dockerfiles | ||
# LABELS: | ||
# REPEAT: | ||
|
||
set -ex | ||
|
||
# Source libraries. Uncomment if needed/defined | ||
#. "${RT_LIB}" | ||
. "${RT_PROJECT_ROOT}/_lib/lib.sh" | ||
|
||
# Test code goes here | ||
echo Linuxkit is "$(which linuxkit)" | ||
RESULT="$(2>&1 linuxkit pkg build --force . | grep 'Build-arg test' || echo)" | ||
echo RESULT="${RESULT}" | ||
echo "${RESULT}" | grep -v "FAILED" | ||
|
||
exit 0 |