init commit
This commit is contained in:
parent
41e5caef58
commit
275c20f8a0
22
.metroline.yml
Normal file
22
.metroline.yml
Normal file
@ -0,0 +1,22 @@
|
||||
version: '1'
|
||||
image: docker
|
||||
docker:
|
||||
auth: '{{DOCKER_AUTH_JSON}}'
|
||||
jobs:
|
||||
remove_docker_before:
|
||||
allowFailure: true
|
||||
script:
|
||||
- docker image rm docker.leffler.media/leffler.media/drone-cf-purge
|
||||
build_docker:
|
||||
script:
|
||||
- docker build -t docker.leffler.media/leffler.media/drone-cf-purge .
|
||||
- echo '{{DOCKER_PASS}}' | docker login -u '{{DOCKER_USER}}' --password-stdin https://docker.leffler.media
|
||||
- docker push "docker.leffler.media/leffler.media/drone-cf-purge"
|
||||
dependencies:
|
||||
- remove_docker_before
|
||||
remove_docker_after:
|
||||
allowFailure: true
|
||||
script:
|
||||
- docker image rm docker.leffler.media/leffler.media/drone-cf-purge
|
||||
dependencies:
|
||||
- build_docker
|
5
Dockerfile
Normal file
5
Dockerfile
Normal file
@ -0,0 +1,5 @@
|
||||
FROM alpine
|
||||
ADD run.sh /bin/
|
||||
RUN chmod +x /bin/run.sh
|
||||
RUN apk -Uuv add curl ca-certificates bash
|
||||
#ENTRYPOINT /bin/run.sh
|
19
run.sh
Normal file
19
run.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
set +x
|
||||
|
||||
if [[ -z "${URL}" ]]
|
||||
then
|
||||
echo "Please defind a URL"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z "${BUNNYCDN_API}" ]]
|
||||
then
|
||||
echo "Please define API_TOKEN"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curl -s -X POST \
|
||||
-H 'AccessKey: '"${BUNNYCDN_API}"'' \
|
||||
-H 'Content-Length: 0' \
|
||||
'https://api.bunny.net/purge?url='"${URL}"
|
Loading…
Reference in New Issue
Block a user