nginx-php/scripts/drone-publish.sh
Piotr Biernat f8f8388665
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
[fix] Cleanup drone scripts
2021-11-23 23:13:36 +01:00

30 lines
668 B
Bash
Executable File

#!/bin/sh
contains() {
string="$1"
substring="$2"
if test "${string#*$substring}" != "$string"
then
return 0 # $substring is in $string
else
return 1 # $substring is not in $string
fi
}
branch=$CI_COMMIT_BRANCH
event=$CI_BUILD_EVENT
source_branch=$DRONE_SOURCE_BRANCH
docker login docker.pbiernat.dev -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
if { [ "$branch" = develop ] && [ "$event" = pull_request ]; } ; then
docker push docker.pbiernat.dev/nginx-php:$source_branch
return 0
fi
if { [ "$branch" = develop ] && [ "$event" = push ]; } ; then
docker push docker.pbiernat.dev/nginx-php:dev
return 0
fi