updates
This commit is contained in:
@@ -2,12 +2,12 @@ name: docker-build-push
|
|||||||
description: Clone app repo, build Docker image, and push it to the private registry
|
description: Clone app repo, build Docker image, and push it to the private registry
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
git_base_url:
|
git_server_url:
|
||||||
description: Base Git host without scheme path, for example git.example.com
|
description: Full Git server URL, for example https://git.example.com
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
git_repository:
|
git_repository:
|
||||||
description: Repository path, for example example/signup_app
|
description: Repository path, for example example/testapp
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
git_sha:
|
git_sha:
|
||||||
@@ -24,7 +24,7 @@ inputs:
|
|||||||
|
|
||||||
registry:
|
registry:
|
||||||
description: OCI registry host
|
description: OCI registry host
|
||||||
required: true
|
required: false
|
||||||
default: zmeyka.exocortex.ru
|
default: zmeyka.exocortex.ru
|
||||||
|
|
||||||
registry_user:
|
registry_user:
|
||||||
@@ -36,7 +36,7 @@ inputs:
|
|||||||
required: true
|
required: true
|
||||||
|
|
||||||
image_name:
|
image_name:
|
||||||
description: Image path inside registry, for example example/signup_app
|
description: Image path inside registry, for example example/testapp
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
image_tag:
|
image_tag:
|
||||||
@@ -59,7 +59,7 @@ runs:
|
|||||||
- name: Run build and push script
|
- name: Run build and push script
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
INPUT_GIT_BASE_URL: ${{ inputs.git_base_url }}
|
INPUT_GIT_SERVER_URL: ${{ inputs.git_server_url }}
|
||||||
INPUT_GIT_REPOSITORY: ${{ inputs.git_repository }}
|
INPUT_GIT_REPOSITORY: ${{ inputs.git_repository }}
|
||||||
INPUT_GIT_SHA: ${{ inputs.git_sha }}
|
INPUT_GIT_SHA: ${{ inputs.git_sha }}
|
||||||
INPUT_GIT_USER: ${{ inputs.git_user }}
|
INPUT_GIT_USER: ${{ inputs.git_user }}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
: "${INPUT_GIT_BASE_URL:?missing INPUT_GIT_BASE_URL}"
|
: "${INPUT_GIT_SERVER_URL:?missing INPUT_GIT_SERVER_URL}"
|
||||||
: "${INPUT_GIT_REPOSITORY:?missing INPUT_GIT_REPOSITORY}"
|
: "${INPUT_GIT_REPOSITORY:?missing INPUT_GIT_REPOSITORY}"
|
||||||
: "${INPUT_GIT_SHA:?missing INPUT_GIT_SHA}"
|
: "${INPUT_GIT_SHA:?missing INPUT_GIT_SHA}"
|
||||||
: "${INPUT_GIT_USER:?missing INPUT_GIT_USER}"
|
: "${INPUT_GIT_USER:?missing INPUT_GIT_USER}"
|
||||||
@@ -17,7 +17,7 @@ set -euo pipefail
|
|||||||
case "${INPUT_IMAGE_NAME}" in
|
case "${INPUT_IMAGE_NAME}" in
|
||||||
*/*) ;;
|
*/*) ;;
|
||||||
*)
|
*)
|
||||||
echo "INPUT_IMAGE_NAME must include owner/name, for example: example/signup_app" >&2
|
echo "INPUT_IMAGE_NAME must include owner/name, for example: example/testapp" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -38,7 +38,8 @@ mkdir -p "${workdir}"
|
|||||||
|
|
||||||
git init "${workdir}"
|
git init "${workdir}"
|
||||||
cd "${workdir}"
|
cd "${workdir}"
|
||||||
git remote add origin "https://${INPUT_GIT_USER}:${INPUT_GIT_TOKEN}@${INPUT_GIT_BASE_URL}/${INPUT_GIT_REPOSITORY}.git"
|
git remote add origin "${INPUT_GIT_SERVER_URL}/${INPUT_GIT_REPOSITORY}.git"
|
||||||
|
git config http.extraHeader "Authorization: Basic $(printf '%s:%s' "${INPUT_GIT_USER}" "${INPUT_GIT_TOKEN}" | base64 -w0)"
|
||||||
git fetch --depth=1 origin "${INPUT_GIT_SHA}"
|
git fetch --depth=1 origin "${INPUT_GIT_SHA}"
|
||||||
git checkout --detach FETCH_HEAD
|
git checkout --detach FETCH_HEAD
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user