commands test

This commit is contained in:
Ruben Momoa
2024-08-22 15:06:08 +02:00
parent f937cbbd23
commit c7ff9f4a28

View File

@@ -5,37 +5,33 @@ when:
event: [ cron, release, push, manual ]
steps:
test1:
cron_pre_check:
image: docker
commands:
- docker pull php:8-fpm-alpine
- docker pull vistanarvas/simple-laravel:dev-alpine
- BASE_IMG=$(docker inspect php:8-fpm-alpine --format='{{.Created}}' | cut -d '.' -f 1)
- PREV_IMG=$(docker inspect vistanarvas/simple-laravel:dev-alpine --format='{{.Created}}' | cut -d '.' -f 1)
- echo $BASE_IMG
- echo $PREV_IMG
- BASE_DATE=$(date -D "%Y-%m-%dT%H:%M:%S" -d "$BASE_IMG" +%s)
- PREV_DATE=$(date -D "%Y-%m-%dT%H:%M:%S" -d "$PREV_IMG" +%s)
- echo $BASE_DATE
- echo $PREV_DATE
- if [ "$PREV_DATE" -gt "$BASE_DATE" ]; then echo "PREV is newer"; fi
- if [ "$PREV_DATE" -gt "$BASE_DATE" ]; then touch SKIP_BUILD; fi
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# dev_alpine_build_and_publish:
# image: woodpeckerci/plugin-docker-buildx
# settings:
# username: vistanarvas
# password:
# from_secret: DOCKERHUB_TOKEN
# context: ./build
# repo: vistanarvas/${CI_REPO_NAME}
# tag: ${CI_COMMIT_BRANCH}-alpine
# dockerfile: Dockerfile_alpine
# when:
# branch:
# exclude: [ main, master ]
# path:
# include: [ '.woodpecker/build_alpine.yml', 'build/*', 'Dockerfile_alpine' ]
# event: [ push, manual ]
dev_alpine_build_and_publish:
image: woodpeckerci/plugin-docker-buildx
settings:
username: vistanarvas
password:
from_secret: DOCKERHUB_TOKEN
context: ./build
repo: vistanarvas/${CI_REPO_NAME}
tag: ${CI_COMMIT_BRANCH}-alpine
dockerfile: Dockerfile_alpine
when:
evaluate: '! test -f "SKIP_BUILD"'
branch:
exclude: [ main, master ]
path:
include: [ '.woodpecker/build_alpine.yml', 'build/*', 'Dockerfile_alpine' ]
event: [ push, manual ]