fix(ci): avoid precreated root-owned build directory
This commit is contained in:
1 parent
979745c7a0
commit
5edb902c0a
1 file changed
+4
-4
@@ -179,8 +179,7 @@ spec:
|
||||
EOF
|
||||
chmod 0600 "$AUTH_HOME/.netrc"
|
||||
export HOME="$AUTH_HOME"
|
||||
mkdir -p "$SOURCE_DIR"
|
||||
find "$SOURCE_DIR" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
|
||||
rm -rf "$SOURCE_DIR"
|
||||
git clone --quiet --no-tags "$REPO_URL" "$SOURCE_DIR"
|
||||
git -C "$SOURCE_DIR" checkout --quiet --detach "$REVISION"
|
||||
ACTUAL_REVISION="$(git -C "$SOURCE_DIR" rev-parse HEAD)"
|
||||
@@ -190,7 +189,7 @@ spec:
|
||||
fi
|
||||
- name: build-and-push
|
||||
image: docker.io/moby/buildkit:v0.31.1-rootless@sha256:946cf909534b789c9b84af75e6d4f8cb23c3b9cb387daec5ba0f4878a3e4647c
|
||||
workingDir: /workspace/build/source
|
||||
workingDir: /workspace/build
|
||||
computeResources:
|
||||
requests: {cpu: "1", memory: 2Gi}
|
||||
limits: {cpu: "4", memory: 8Gi}
|
||||
@@ -226,6 +225,7 @@ spec:
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
cd /workspace/build/source
|
||||
buildctl-daemonless.sh build \
|
||||
--frontend dockerfile.v0 \
|
||||
--local context=. \
|
||||
@@ -236,7 +236,7 @@ spec:
|
||||
--metadata-file "$(results.image-digest.path)"
|
||||
- name: record-digest
|
||||
image: docker.io/mikefarah/yq:4.47.2@sha256:76def1f56f456ecc1c3173ea275218ee17139bc2018c5a07887b15afd88ec03e
|
||||
workingDir: /workspace/build/source
|
||||
workingDir: /workspace/build
|
||||
computeResources:
|
||||
requests: {cpu: 50m, memory: 64Mi}
|
||||
limits: {cpu: 250m, memory: 256Mi}
|
||||
|
||||
Reference in new issue
Block a user