mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-01 15:08:33 +00:00
include source repo, revision and go package version as build-args
Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
@@ -10,7 +10,7 @@ set -ex
|
||||
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
|
||||
|
||||
# Test code goes here
|
||||
echo Linuxkig is "$(which linuxkit)"
|
||||
echo Linuxkit is "$(which linuxkit)"
|
||||
RESULT="$(2>&1 linuxkit pkg build --force . | grep PASSED)"
|
||||
echo RESULT="${RESULT}"
|
||||
echo "${RESULT}" | grep "Build-arg test PASSED"
|
||||
|
11
test/cases/000_build/031_fixed_build_args/Dockerfile
Normal file
11
test/cases/000_build/031_fixed_build_args/Dockerfile
Normal file
@@ -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"]
|
5
test/cases/000_build/031_fixed_build_args/build.yml
Normal file
5
test/cases/000_build/031_fixed_build_args/build.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
image: build-args-test
|
||||
network: true
|
||||
arches:
|
||||
- amd64
|
||||
- arm64
|
18
test/cases/000_build/031_fixed_build_args/test.sh
Executable file
18
test/cases/000_build/031_fixed_build_args/test.sh
Executable file
@@ -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
|
Reference in New Issue
Block a user