fix: remove unused variables + https from url

This commit is contained in:
ange 2024-04-30 23:12:36 +02:00
parent dab3dad0c4
commit 2c7bab8c91
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
2 changed files with 9 additions and 25 deletions

View File

@ -1,17 +1,12 @@
name: kaniko
inputs: inputs:
dockerfile: dockerfile:
description: Dockerfile path description: Dockerfile path
required: true required: true
default: ./Dockerfile default: ./Dockerfile
registry: tag:
description: Registry URL description: Image tag
required: true required: true
default: ${{ gitea.server_url }} default: ${{ gitea.ref_name }}
image:
description: Image name
required: true
default: ${{ gitea.repository }}:latest
username: username:
description: Registry username description: Registry username
required: true required: true
@ -19,19 +14,14 @@ inputs:
password: password:
description: Registry password description: Registry password
required: true required: true
default: ${{ gitea.token }}
tls:
description: Prevent push to http
required: true
default: true
runs: runs:
using: docker using: docker
image: Dockerfile image: Dockerfile
args: args:
- ACTION_DOCKERFILE=${{ inputs.dockerfile }} - ACTION_DOCKERFILE=${{ inputs.dockerfile }}
- ACTION_REGISTRY=${{ inputs.registry }} - ACTION_TAG=${{ inputs.tag }}
- ACTION_IMAGE=${{ inputs.image }} - ACTION_REGISTRY=${{ gitea.server_url }}
- ACTION_IMAGE=${{ gitea.repository }}
- ACTION_USERNAME=${{ inputs.username }} - ACTION_USERNAME=${{ inputs.username }}
- ACTION_PASSWORD=${{ inputs.password }} - ACTION_PASSWORD=${{ inputs.password }}
- ACTION_TLS=${{ inputs.tls }}

View File

@ -3,8 +3,6 @@
# source environment from args # source environment from args
eval "$*" eval "$*"
ACTION=/kaniko/executor
cat <<EOF > /kaniko/.docker/config.json cat <<EOF > /kaniko/.docker/config.json
{ {
"auths": { "auths": {
@ -16,12 +14,8 @@ cat <<EOF > /kaniko/.docker/config.json
} }
EOF EOF
case "$ACTION_TLS" in REGISTRY="$(echo "$ACTION_REGISTRY" | sed 's .*:// ')"
[fF]alse) ACTION="$ACTION --insecure" ;; /kaniko/executor \
*) ;;
esac
exec $ACTION \
--context "${ACTION_DOCKERFILE%/*}" \ --context "${ACTION_DOCKERFILE%/*}" \
--dockerfile "$ACTION_DOCKERFILE" \ --dockerfile "$ACTION_DOCKERFILE" \
--destination "$ACTION_REGISTRY/$ACTION_IMAGE" --destination "$REGISTRY/$ACTION_IMAGE:$ACTION_TAG"