diff --git a/Dockerfile b/Dockerfile index 47c62ce6..7a6c2c0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,7 +41,7 @@ COPY controllers/ controllers/ # Build RUN CGO_ENABLED=0 GOOS=linux go build -o manager main.go -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9-1161 +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10-1018 WORKDIR / COPY licenses/ licenses/ COPY --from=builder /workspace/manager . diff --git a/build/pr_check_inner.sh b/build/pr_check_inner.sh index 1e62f2b8..cf6b4a5b 100755 --- a/build/pr_check_inner.sh +++ b/build/pr_check_inner.sh @@ -2,13 +2,16 @@ set -exv +cd "$HOME" + # copy the workspace from the Jenkins job off the ro volume into this container -mkdir -p /container_workspace -cp -r /workspace/. /container_workspace -cd /container_workspace +mkdir container_workspace +cd container_workspace + +cp -r /workspace/. . -mkdir -p /container_workspace/bin -cp /root/go/* /container_workspace/bin +mkdir bin +cp /root/go/* bin/ mkdir -p artifacts diff --git a/build/template_check.sh b/build/template_check.sh index be527781..fb1013b5 100755 --- a/build/template_check.sh +++ b/build/template_check.sh @@ -2,7 +2,6 @@ set -exv - python3 -m venv "build/.build_venv" source build/.build_venv/bin/activate pip install pyyaml diff --git a/pr_check.sh b/pr_check.sh index 3828ab48..688e5e22 100755 --- a/pr_check.sh +++ b/pr_check.sh @@ -4,11 +4,11 @@ set -exv mkdir -p "$PWD/.docker" +ghprbPullId=${ghprbPullId:-0001} CONTAINER_NAME="${FEO_CONTAINER_NAME:-frontend-operator-pr-check-$ghprbPullId}" docker rm -f $CONTAINER_NAME docker rm -f $CONTAINER_NAME-run - # We're mounting the jenkins workspace over the root of the container # This means that the pr_check_inner.sh script will be run in the context of the jenkins workspace # This confused me for a while because pr_check_inner.sh is also copied into the pr check container at build time @@ -17,13 +17,13 @@ docker rm -f $CONTAINER_NAME-run docker buildx build --platform linux/amd64 -t $CONTAINER_NAME -f build/Dockerfile.pr . docker buildx build --load -t $CONTAINER_NAME -f build/Dockerfile.pr . -docker run -i --name $CONTAINER_NAME-run -v $PWD:/workspace:ro $CONTAINER_NAME /workspace/build/pr_check_inner.sh +docker run -i --name $CONTAINER_NAME-run -v $PWD:/workspace:Z $CONTAINER_NAME /workspace/build/pr_check_inner.sh TEST_RESULT=$? mkdir -p artifacts -docker cp $CONTAINER_NAME-run:/container_workspace/artifacts/ $PWD +docker cp $CONTAINER_NAME-run:container_workspace/artifacts/ $PWD docker rm -f $CONTAINER_NAME docker rm -f $CONTAINER_NAME-run