More CICD fixes again again again
Some checks failed
CICD Start / Sanity and Base Decision (pull_request) Failing after 35s
Some checks failed
CICD Start / Sanity and Base Decision (pull_request) Failing after 35s
Signed-off-by: copilotcoder <copilotcoder@darkhelm.org>
This commit is contained in:
@@ -57,8 +57,6 @@ jobs:
|
||||
|
||||
- name: Compute base hash and base-needed signal
|
||||
id: base-decision
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
run: |
|
||||
set -e
|
||||
|
||||
@@ -68,34 +66,14 @@ jobs:
|
||||
sha256sum "${file1}" "${file2}" | sha256sum | cut -c1-16
|
||||
}
|
||||
|
||||
if [ -f "Dockerfile.cicd-base" ] && [ -f ".dockerignore" ]; then
|
||||
BASE_HASH=$(compute_hash "Dockerfile.cicd-base" ".dockerignore")
|
||||
else
|
||||
umask 077
|
||||
trap 'rm -f ~/.ssh/id_rsa' EXIT
|
||||
|
||||
if [ -z "${SSH_PRIVATE_KEY}" ]; then
|
||||
echo "❌ SSH_PRIVATE_KEY is empty"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p ~/.ssh /tmp/base-hash-repo
|
||||
echo "${SSH_PRIVATE_KEY}" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan -p "${GITEA_SSH_PORT}" "${GITEA_SSH_HOST}" >> ~/.ssh/known_hosts 2>/dev/null
|
||||
|
||||
cd /tmp/base-hash-repo
|
||||
git init -q
|
||||
git remote add origin "${GITEA_REPO_SSH_URL}"
|
||||
GIT_SSH_COMMAND="ssh -i ~/.ssh/id_rsa -o IdentitiesOnly=yes -o StrictHostKeyChecking=no" \
|
||||
git fetch --depth 1 origin "${GITHUB_SHA}"
|
||||
|
||||
git show FETCH_HEAD:Dockerfile.cicd-base > /tmp/Dockerfile.cicd-base
|
||||
git show FETCH_HEAD:.dockerignore > /tmp/.dockerignore
|
||||
|
||||
BASE_HASH=$(compute_hash "/tmp/Dockerfile.cicd-base" "/tmp/.dockerignore")
|
||||
if [ ! -f "Dockerfile.cicd-base" ] || [ ! -f ".dockerignore" ]; then
|
||||
echo "❌ Required hash inputs are missing in workspace"
|
||||
ls -la
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BASE_HASH=$(compute_hash "Dockerfile.cicd-base" ".dockerignore")
|
||||
|
||||
BASE_REF_HASH="${GITEA_REGISTRY}/darkhelm.org/plex-playlist-cicd-base:${BASE_HASH}"
|
||||
|
||||
echo "Base hash: ${BASE_HASH}"
|
||||
|
||||
Reference in New Issue
Block a user