mirror of
https://github.com/anchore/syft.git
synced 2026-02-12 02:26:42 +01:00
fix: ensure java image build failures stop the build (#4531)
--------- Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
parent
3ea6a03cd0
commit
ed339e4fed
@ -13,12 +13,11 @@ jobs:
|
||||
|
||||
Publish:
|
||||
name: "Publish test fixture image cache"
|
||||
# runs-on.com: memory-optimized instances for building test fixture cache
|
||||
# runs-on.com: general purpose instances for building test fixture cache
|
||||
# spot disabled: can run up to an hour, avoid interruptions
|
||||
# disk=large: need more storage for docker images and fixture cache
|
||||
# s3-cache: faster actions cache
|
||||
# tmpfs: faster io-intensive workflows
|
||||
runs-on: runs-on=${{ github.run_id }}/cpu=4+8/ram=64+128/family=r5+r6+r7+r8/spot=false/extras=s3-cache+tmpfs
|
||||
# family: note that m*d instances have local nvme storage which is beneficial for building large test fixture images
|
||||
runs-on: "runs-on=${{ github.run_id }}/cpu=8+16/ram=32+64/family=m5d+m5ad+m5dn+m6gd+m6id+m6idn+m7gd+m8gd/spot=false/extras=s3-cache"
|
||||
if: github.repository == 'anchore/syft' # only run for main repo
|
||||
permissions:
|
||||
packages: write
|
||||
|
||||
@ -373,6 +373,9 @@ tasks:
|
||||
# this will look for `test-fixtures/Makefile` and invoke the `fixtures` target to generate any and all test fixtures
|
||||
cmds:
|
||||
- |
|
||||
# we want to stop on the first build error
|
||||
set -e
|
||||
|
||||
BOLD='\033[1m'
|
||||
YELLOW='\033[0;33m'
|
||||
RESET='\033[0m'
|
||||
@ -381,7 +384,7 @@ tasks:
|
||||
for dir in $(find . -type d -name 'test-fixtures'); do
|
||||
if [ -f "$dir/Makefile" ]; then
|
||||
echo -e "${YELLOW}${BOLD}generating fixtures in $dir${RESET}"
|
||||
(make -C "$dir" fixtures)
|
||||
make -C "$dir" fixtures
|
||||
fi
|
||||
done
|
||||
echo -e "${BOLD}generated all fixtures${RESET}"
|
||||
|
||||
@ -3,13 +3,13 @@
|
||||
default:
|
||||
@for dir in $(shell find . -mindepth 1 -maxdepth 1 -type d); do \
|
||||
if [ -f "$$dir/Makefile" ]; then \
|
||||
$(MAKE) -C $$dir; \
|
||||
$(MAKE) -C $$dir || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
%:
|
||||
@for dir in $(shell find . -mindepth 1 -maxdepth 1 -type d); do \
|
||||
if [ -f "$$dir/Makefile" ]; then \
|
||||
$(MAKE) -C $$dir $@; \
|
||||
$(MAKE) -C $$dir $@ || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
@ -3,13 +3,13 @@
|
||||
default:
|
||||
@for dir in $(shell find . -mindepth 1 -maxdepth 1 -type d); do \
|
||||
if [ -f "$$dir/Makefile" ]; then \
|
||||
$(MAKE) -C $$dir; \
|
||||
$(MAKE) -C $$dir || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
%:
|
||||
@for dir in $(shell find . -mindepth 1 -maxdepth 1 -type d); do \
|
||||
if [ -f "$$dir/Makefile" ]; then \
|
||||
$(MAKE) -C $$dir $@; \
|
||||
$(MAKE) -C $$dir $@ || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
@ -3,13 +3,13 @@
|
||||
default:
|
||||
@for dir in $(shell find . -mindepth 1 -maxdepth 1 -type d); do \
|
||||
if [ -f "$$dir/Makefile" ]; then \
|
||||
$(MAKE) -C $$dir; \
|
||||
$(MAKE) -C $$dir || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
%:
|
||||
@for dir in $(shell find . -mindepth 1 -maxdepth 1 -type d); do \
|
||||
if [ -f "$$dir/Makefile" ]; then \
|
||||
$(MAKE) -C $$dir $@; \
|
||||
$(MAKE) -C $$dir $@ || exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
@ -11,7 +11,6 @@ function cleanup() {
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
set +e
|
||||
|
||||
docker cp "$(pwd)/example-java-app" "${CTRID}:/"
|
||||
docker start -a "${CTRID}"
|
||||
|
||||
@ -11,7 +11,6 @@ function cleanup() {
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
set +e
|
||||
|
||||
docker cp "$(pwd)/example-java-app" "${CTRID}:/"
|
||||
docker start -a "${CTRID}"
|
||||
|
||||
@ -3,16 +3,14 @@ set -uxe
|
||||
|
||||
PKGSDIR=$1
|
||||
|
||||
CTRID=$(docker create -v /example-java-app ghcr.io/graalvm/native-image:22.2.0 -cp /example-java-app/example-java-app-maven-0.1.0.jar -XX:-UseContainerSupport --no-fallback -H:Class=hello.HelloWorld -H:Name=example-java-app)
|
||||
CTRID=$(docker create -v /example-java-app ghcr.io/graalvm/native-image:22.2.0 -J-XX:-UseContainerSupport -cp /example-java-app/example-java-app-maven-0.1.0.jar --no-fallback -H:Class=hello.HelloWorld -H:Name=example-java-app)
|
||||
|
||||
function cleanup() {
|
||||
docker rm "${CTRID}"
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
set +e
|
||||
|
||||
docker cp "${PKGSDIR}/example-java-app-maven-0.1.0.jar" "${CTRID}:/example-java-app/"
|
||||
|
||||
docker start -a "${CTRID}"
|
||||
docker cp "${CTRID}:/app/example-java-app" $PKGSDIR
|
||||
docker cp "${CTRID}:/app/example-java-app" "$PKGSDIR"
|
||||
|
||||
@ -11,7 +11,6 @@ function cleanup() {
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
set +e
|
||||
|
||||
docker cp "$(pwd)/example-jenkins-plugin" "${CTRID}:/"
|
||||
docker start -a "${CTRID}"
|
||||
|
||||
@ -11,7 +11,6 @@ function cleanup() {
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
set +e
|
||||
|
||||
docker cp "$(pwd)/example-sb-app" "${CTRID}:/"
|
||||
docker start -a "${CTRID}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user