hardcode URL for runner
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 0s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 0s
This commit is contained in:
@@ -16,9 +16,7 @@ jobs:
|
|||||||
- name: Checkout repository (shell)
|
- name: Checkout repository (shell)
|
||||||
run: |
|
run: |
|
||||||
REPO_DIR="repo"
|
REPO_DIR="repo"
|
||||||
SERVER_URL="${GITHUB_SERVER_URL:-$GITEA_SERVER_URL}"
|
REPO_CLONE_URL="https://gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu/j.r/template-code-location.git"
|
||||||
SERVER_SCHEME="https"
|
|
||||||
SERVER_HOST="${SERVER_URL}"
|
|
||||||
CLONE_USER="${{ secrets.REGISTRY_USERNAME }}"
|
CLONE_USER="${{ secrets.REGISTRY_USERNAME }}"
|
||||||
CLONE_PASS="${{ secrets.REGISTRY_PASSWORD }}"
|
CLONE_PASS="${{ secrets.REGISTRY_PASSWORD }}"
|
||||||
REF_NAME="${GITHUB_REF_NAME}"
|
REF_NAME="${GITHUB_REF_NAME}"
|
||||||
@@ -26,30 +24,16 @@ jobs:
|
|||||||
REF_NAME="${GITHUB_REF#refs/heads/}"
|
REF_NAME="${GITHUB_REF#refs/heads/}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${SERVER_URL}" ]; then
|
|
||||||
echo "Missing GITHUB_SERVER_URL/GITEA_SERVER_URL"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "${CLONE_USER}" ] || [ -z "${CLONE_PASS}" ]; then
|
if [ -z "${CLONE_USER}" ] || [ -z "${CLONE_PASS}" ]; then
|
||||||
echo "Missing REGISTRY_USERNAME or REGISTRY_PASSWORD secret"
|
echo "Missing REGISTRY_USERNAME or REGISTRY_PASSWORD secret"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "${SERVER_URL}" in
|
|
||||||
http://*)
|
|
||||||
SERVER_SCHEME="http"
|
|
||||||
SERVER_HOST="${SERVER_URL#http://}"
|
|
||||||
;;
|
|
||||||
https://*)
|
|
||||||
SERVER_SCHEME="https"
|
|
||||||
SERVER_HOST="${SERVER_URL#https://}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
rm -rf "${REPO_DIR}"
|
rm -rf "${REPO_DIR}"
|
||||||
|
AUTH_HEADER="$(printf '%s:%s' "${CLONE_USER}" "${CLONE_PASS}" | base64 | tr -d '\n')"
|
||||||
git clone --depth 1 --branch "${REF_NAME}" \
|
git clone --depth 1 --branch "${REF_NAME}" \
|
||||||
"${SERVER_SCHEME}://${CLONE_USER}:${CLONE_PASS}@${SERVER_HOST}/${GITHUB_REPOSITORY}.git" \
|
-c "http.extraHeader=Authorization: Basic ${AUTH_HEADER}" \
|
||||||
|
"${REPO_CLONE_URL}" \
|
||||||
"${REPO_DIR}"
|
"${REPO_DIR}"
|
||||||
|
|
||||||
if [ ! -f "${REPO_DIR}/Dockerfile" ]; then
|
if [ ! -f "${REPO_DIR}/Dockerfile" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user