fix: remove unused variables + https from url
This commit is contained in:
parent
dab3dad0c4
commit
2c7bab8c91
22
action.yaml
22
action.yaml
@ -1,17 +1,12 @@
|
||||
name: kaniko
|
||||
inputs:
|
||||
dockerfile:
|
||||
description: Dockerfile path
|
||||
required: true
|
||||
default: ./Dockerfile
|
||||
registry:
|
||||
description: Registry URL
|
||||
tag:
|
||||
description: Image tag
|
||||
required: true
|
||||
default: ${{ gitea.server_url }}
|
||||
image:
|
||||
description: Image name
|
||||
required: true
|
||||
default: ${{ gitea.repository }}:latest
|
||||
default: ${{ gitea.ref_name }}
|
||||
username:
|
||||
description: Registry username
|
||||
required: true
|
||||
@ -19,19 +14,14 @@ inputs:
|
||||
password:
|
||||
description: Registry password
|
||||
required: true
|
||||
default: ${{ gitea.token }}
|
||||
tls:
|
||||
description: Prevent push to http
|
||||
required: true
|
||||
default: true
|
||||
|
||||
runs:
|
||||
using: docker
|
||||
image: Dockerfile
|
||||
args:
|
||||
- ACTION_DOCKERFILE=${{ inputs.dockerfile }}
|
||||
- ACTION_REGISTRY=${{ inputs.registry }}
|
||||
- ACTION_IMAGE=${{ inputs.image }}
|
||||
- ACTION_TAG=${{ inputs.tag }}
|
||||
- ACTION_REGISTRY=${{ gitea.server_url }}
|
||||
- ACTION_IMAGE=${{ gitea.repository }}
|
||||
- ACTION_USERNAME=${{ inputs.username }}
|
||||
- ACTION_PASSWORD=${{ inputs.password }}
|
||||
- ACTION_TLS=${{ inputs.tls }}
|
||||
|
12
build.sh
12
build.sh
@ -3,8 +3,6 @@
|
||||
# source environment from args
|
||||
eval "$*"
|
||||
|
||||
ACTION=/kaniko/executor
|
||||
|
||||
cat <<EOF > /kaniko/.docker/config.json
|
||||
{
|
||||
"auths": {
|
||||
@ -16,12 +14,8 @@ cat <<EOF > /kaniko/.docker/config.json
|
||||
}
|
||||
EOF
|
||||
|
||||
case "$ACTION_TLS" in
|
||||
[fF]alse) ACTION="$ACTION --insecure" ;;
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
exec $ACTION \
|
||||
REGISTRY="$(echo "$ACTION_REGISTRY" | sed 's .*:// ')"
|
||||
/kaniko/executor \
|
||||
--context "${ACTION_DOCKERFILE%/*}" \
|
||||
--dockerfile "$ACTION_DOCKERFILE" \
|
||||
--destination "$ACTION_REGISTRY/$ACTION_IMAGE"
|
||||
--destination "$REGISTRY/$ACTION_IMAGE:$ACTION_TAG"
|
||||
|
Loading…
Reference in New Issue
Block a user