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:
|
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 }}
|
|
||||||
|
12
build.sh
12
build.sh
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user