first commit
This commit is contained in:
commit
71166e2407
3
Dockerfile
Normal file
3
Dockerfile
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
FROM gcr.io/kaniko-project/executor:debug
|
||||||
|
COPY build.sh /usr/local/bin/
|
||||||
|
ENTRYPOINT ["build.sh"]
|
37
action.yaml
Normal file
37
action.yaml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
name: kaniko
|
||||||
|
inputs:
|
||||||
|
dockerfile:
|
||||||
|
description: Dockerfile path
|
||||||
|
required: true
|
||||||
|
default: ./Dockerfile
|
||||||
|
registry:
|
||||||
|
description: Registry URL
|
||||||
|
required: true
|
||||||
|
default: git.gmoker.com
|
||||||
|
image:
|
||||||
|
description: Image name
|
||||||
|
required: true
|
||||||
|
default: ${{ gitea.repository }}:latest
|
||||||
|
username:
|
||||||
|
description: Registry username
|
||||||
|
required: true
|
||||||
|
default: ${{ gitea.repository_owner }}
|
||||||
|
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_USERNAME=${{ inputs.username }}
|
||||||
|
- ACTION_PASSWORD=${{ inputs.password }}
|
||||||
|
- ACTION_TLS=${{ inputs.tls }}
|
26
build.sh
Executable file
26
build.sh
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/sh -ex
|
||||||
|
|
||||||
|
# source environment from args
|
||||||
|
eval "$*"
|
||||||
|
|
||||||
|
ACTION=/kaniko/executor
|
||||||
|
|
||||||
|
cat <<EOF > /kaniko/.docker/config.json
|
||||||
|
{
|
||||||
|
"auths": {
|
||||||
|
"$ACTION_REGISTRY": {
|
||||||
|
"username": "$ACTION_USERNAME",
|
||||||
|
"password": "$ACTION_PASSWORD"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
case "$ACTION_TLS" in
|
||||||
|
[fF]alse) ACTION="$ACTION --insecure" ;;
|
||||||
|
*) ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exec $ACTION \
|
||||||
|
--dockerfile "$ACTION_DOCKERFILE" \
|
||||||
|
--destination "$ACTION_REGISTRY/$ACTION_IMAGE"
|
Loading…
Reference in New Issue
Block a user