fix(ci): use owned directory for native builds
This commit is contained in:
1 parent
966e109d28
commit
979745c7a0
1 file changed
+7
-6
@@ -159,14 +159,14 @@ spec:
|
|||||||
- name: credentials
|
- name: credentials
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: build-source
|
- name: build-source
|
||||||
mountPath: /workspace/build-source
|
mountPath: /workspace/build
|
||||||
env:
|
env:
|
||||||
- name: REPO_URL
|
- name: REPO_URL
|
||||||
value: https://git.dahyeon.us/dahyeon/lolympus-tournament-support.git
|
value: https://git.dahyeon.us/dahyeon/lolympus-tournament-support.git
|
||||||
script: |
|
script: |
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
SOURCE_DIR=/workspace/build-source
|
SOURCE_DIR=/workspace/build/source
|
||||||
REVISION="$(params.revision)"
|
REVISION="$(params.revision)"
|
||||||
AUTH_HOME="$(mktemp -d)"
|
AUTH_HOME="$(mktemp -d)"
|
||||||
trap 'rm -rf "$AUTH_HOME"' EXIT
|
trap 'rm -rf "$AUTH_HOME"' EXIT
|
||||||
@@ -179,6 +179,7 @@ spec:
|
|||||||
EOF
|
EOF
|
||||||
chmod 0600 "$AUTH_HOME/.netrc"
|
chmod 0600 "$AUTH_HOME/.netrc"
|
||||||
export HOME="$AUTH_HOME"
|
export HOME="$AUTH_HOME"
|
||||||
|
mkdir -p "$SOURCE_DIR"
|
||||||
find "$SOURCE_DIR" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
|
find "$SOURCE_DIR" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
|
||||||
git clone --quiet --no-tags "$REPO_URL" "$SOURCE_DIR"
|
git clone --quiet --no-tags "$REPO_URL" "$SOURCE_DIR"
|
||||||
git -C "$SOURCE_DIR" checkout --quiet --detach "$REVISION"
|
git -C "$SOURCE_DIR" checkout --quiet --detach "$REVISION"
|
||||||
@@ -189,7 +190,7 @@ spec:
|
|||||||
fi
|
fi
|
||||||
- name: build-and-push
|
- name: build-and-push
|
||||||
image: docker.io/moby/buildkit:v0.31.1-rootless@sha256:946cf909534b789c9b84af75e6d4f8cb23c3b9cb387daec5ba0f4878a3e4647c
|
image: docker.io/moby/buildkit:v0.31.1-rootless@sha256:946cf909534b789c9b84af75e6d4f8cb23c3b9cb387daec5ba0f4878a3e4647c
|
||||||
workingDir: /workspace/build-source
|
workingDir: /workspace/build/source
|
||||||
computeResources:
|
computeResources:
|
||||||
requests: {cpu: "1", memory: 2Gi}
|
requests: {cpu: "1", memory: 2Gi}
|
||||||
limits: {cpu: "4", memory: 8Gi}
|
limits: {cpu: "4", memory: 8Gi}
|
||||||
@@ -207,7 +208,7 @@ spec:
|
|||||||
- name: dockerconfig
|
- name: dockerconfig
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: build-source
|
- name: build-source
|
||||||
mountPath: /workspace/build-source
|
mountPath: /workspace/build
|
||||||
- name: buildkit-state
|
- name: buildkit-state
|
||||||
mountPath: /home/user/.local/share/buildkit
|
mountPath: /home/user/.local/share/buildkit
|
||||||
env:
|
env:
|
||||||
@@ -235,7 +236,7 @@ spec:
|
|||||||
--metadata-file "$(results.image-digest.path)"
|
--metadata-file "$(results.image-digest.path)"
|
||||||
- name: record-digest
|
- name: record-digest
|
||||||
image: docker.io/mikefarah/yq:4.47.2@sha256:76def1f56f456ecc1c3173ea275218ee17139bc2018c5a07887b15afd88ec03e
|
image: docker.io/mikefarah/yq:4.47.2@sha256:76def1f56f456ecc1c3173ea275218ee17139bc2018c5a07887b15afd88ec03e
|
||||||
workingDir: /workspace/build-source
|
workingDir: /workspace/build/source
|
||||||
computeResources:
|
computeResources:
|
||||||
requests: {cpu: 50m, memory: 64Mi}
|
requests: {cpu: 50m, memory: 64Mi}
|
||||||
limits: {cpu: 250m, memory: 256Mi}
|
limits: {cpu: 250m, memory: 256Mi}
|
||||||
@@ -249,7 +250,7 @@ spec:
|
|||||||
- ALL
|
- ALL
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: build-source
|
- name: build-source
|
||||||
mountPath: /workspace/build-source
|
mountPath: /workspace/build
|
||||||
script: |
|
script: |
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|||||||
Reference in new issue
Block a user