From 3f61272b803fe922603940b5d937c3d22f8e1487 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Tue, 23 Nov 2021 22:45:05 +0100 Subject: [PATCH] [fix] Cleanup --- .drone.yml | 24 +----------------------- scripts/drone-build.sh | 6 +++--- scripts/drone-publish.sh | 2 -- 3 files changed, 4 insertions(+), 28 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8ec2a0f..9796771 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,10 +6,6 @@ name: Build steps: - name: build_release image: plugins/docker - commands: - - sleep 5 - - docker build -t docker.pbiernat.dev/nginx-php . - - docker images | grep nginx-php when: event: tag volumes: @@ -23,10 +19,6 @@ steps: from_secret: registry_username DOCKER_PASSWORD: from_secret: registry_password - commands: - - sleep 5 -# - docker login docker.pbiernat.dev -u $DOCKER_USERNAME -p $DOCKER_PASSWORD -# - docker push docker.pbiernat.dev/nginx-php when: event: tag volumes: @@ -36,8 +28,6 @@ steps: - name: build_develop image: plugins/docker commands: - - sleep 5 - #- env - ./scripts/drone-build.sh when: branch: develop @@ -49,16 +39,12 @@ steps: - name: publish_develop image: plugins/docker -# privileged: true environment: DOCKER_USERNAME: from_secret: registry_username DOCKER_PASSWORD: from_secret: registry_password commands: - - sleep 5 -# - docker login docker.pbiernat.dev -u $DOCKER_USERNAME -p $DOCKER_PASSWORD -# - docker push docker.pbiernat.dev/nginx-php:dev - ./scripts/drone-publish.sh when: branch: develop @@ -71,10 +57,6 @@ steps: - name: build_feature image: plugins/docker commands: - - env - - sleep 5 - #- docker build -t docker.pbiernat.dev/nginx-php:$CI_COMMIT_BRANCH . - #- docker images --format "{{.Repository}}:{{.Tag}}" | grep nginx-php:${CI_COMMIT_BRANCH} - ./scripts/drone-build.sh when: branch: @@ -89,17 +71,12 @@ steps: - name: publish_feature image: plugins/docker -# privileged: true environment: DOCKER_USERNAME: from_secret: registry_username DOCKER_PASSWORD: from_secret: registry_password commands: -# - env - - sleep 5 - #- docker login docker.pbiernat.dev -u $DOCKER_USERNAME -p $DOCKER_PASSWORD - #- docker push docker.pbiernat.dev/nginx-php:$CI_COMMIT_BRANCH - ./scripts/drone-publish.sh when: branch: develop @@ -120,3 +97,4 @@ services: volumes: - name: docker-sock temp: {} + diff --git a/scripts/drone-build.sh b/scripts/drone-build.sh index 8e68fc1..0cc9e32 100755 --- a/scripts/drone-build.sh +++ b/scripts/drone-build.sh @@ -21,19 +21,19 @@ source_branch=$DRONE_SOURCE_BRANCH step_name=$DRONE_STEP_NAME if { contains "$branch" "feature_" && [ "$event" = push ]; } ; then - echo "BUILD FEATURE: $branch" + sleep 5 docker build -t docker.pbiernat.dev/nginx-php:$branch . return 0 fi if { [ "$branch" = develop ] && [ "$event" = pull_request ]; } ; then - echo "BUILD FEATURE(FROM DEV): $source_branch" + sleep 5 docker build -t docker.pbiernat.dev/nginx-php:$source_branch . return 0 fi if { [ "$branch" = develop ] && [ "$event" = push ] && [ "$step_name" != build_feature ]; } ; then - echo "BUILD DEV" + sleep 5 docker build -t docker.pbiernat.dev/nginx-php:dev . return 0 fi diff --git a/scripts/drone-publish.sh b/scripts/drone-publish.sh index 572645d..12d098e 100755 --- a/scripts/drone-publish.sh +++ b/scripts/drone-publish.sh @@ -20,13 +20,11 @@ source_branch=$DRONE_SOURCE_BRANCH docker login docker.pbiernat.dev -u $DOCKER_USERNAME -p $DOCKER_PASSWORD if { [ "$branch" = develop ] && [ "$event" = pull_request ]; } ; then - echo "PUSH FEATURE: $source_branch" docker push docker.pbiernat.dev/nginx-php:$source_branch return 0 fi if { [ "$branch" = develop ] && [ "$event" = push ]; } ; then - echo "PUSH DEV: $branch" docker push docker.pbiernat.dev/nginx-php:dev return 0 fi