[fix] CI/CD fixes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Piotr Biernat 2022-04-21 22:39:44 +02:00
parent 9ce9efe574
commit 2bf49c405b
3 changed files with 20 additions and 23 deletions

View File

@ -3,7 +3,7 @@ type: docker
name: default name: default
steps: steps:
- name: static_check - name: go_static_check
image: golang:latest image: golang:latest
commands: commands:
- go install honnef.co/go/tools/cmd/staticcheck@latest - go install honnef.co/go/tools/cmd/staticcheck@latest
@ -12,7 +12,7 @@ steps:
- name: gopath - name: gopath
path: /go path: /go
- name: lint - name: go_lint
image: golang:latest image: golang:latest
commands: commands:
- go install golang.org/x/lint/golint@latest - go install golang.org/x/lint/golint@latest
@ -21,7 +21,7 @@ steps:
- name: gopath - name: gopath
path: /go path: /go
- name: vet - name: go_vet
image: golang:latest image: golang:latest
commands: commands:
- go vet ./pkg/... - go vet ./pkg/...
@ -34,6 +34,10 @@ steps:
commands: commands:
- sleep 5 - sleep 5
- ./deploy/build_image.sh - ./deploy/build_image.sh
depends_on:
- go_static_check
- go_lint
- go_vet
volumes: volumes:
- name: docker-sock - name: docker-sock
path: /var/run path: /var/run
@ -47,6 +51,8 @@ steps:
from_secret: registry_password from_secret: registry_password
commands: commands:
- ./deploy/publish_image.sh - ./deploy/publish_image.sh
depends_on:
- build_image
volumes: volumes:
- name: docker-sock - name: docker-sock
path: /var/run path: /var/run

View File

@ -1,14 +1,10 @@
#!/bin/sh #!/bin/sh
set -e set -evx
set -x
# BRANCH="dev/ci-docker-builder" branch=${DRONE_TAG:=$CI_COMMIT_BRANCH}
# BRANCH="develop" branch=$(echo $branch | grep -v /) || echo $branch ;
# BRANCH=$CI_COMMIT_BRANCH p1=$(echo $branch | cut -d / -f1 -s) &&
p2=$(echo $branch | cut -d / -f2 -s) &&
branch=$(echo $CI_COMMIT_BRANCH | grep -v /) || echo $CI_COMMIT_BRANCH ;
p1=$(echo $CI_COMMIT_BRANCH | cut -d / -f1 -s) &&
p2=$(echo $CI_COMMIT_BRANCH | cut -d / -f2 -s) &&
tag=${branch:=$p1-$p2} && tag=${branch:=$p1-$p2} &&
echo "Building" $tag echo "Building" $tag

View File

@ -1,16 +1,11 @@
#!/bin/sh #!/bin/sh
set -e set -evx
set -x
# BRANCH="dev/ci-docker-builder" branch=${DRONE_TAG:=$CI_COMMIT_BRANCH}
# BRANCH="develop" branch=$(echo $branch | grep -v /) || echo $branch ;
# BRANCH=$CI_COMMIT_BRANCH p1=$(echo $branch | cut -d / -f1 -s) &&
p2=$(echo $branch | cut -d / -f2 -s) &&
tag=${branch:=$p1-$p2} &&
branch=$(echo $CI_COMMIT_BRANCH | grep -v /) || echo $CI_COMMIT_BRANCH ;
p1=$(echo $CI_COMMIT_BRANCH | cut -d / -f1 -s) &&
p2=$(echo $CI_COMMIT_BRANCH | cut -d / -f2 -s) &&
tag=${branch:=$p1-$p2} &&
echo "Publishing" $tag echo "Publishing" $tag
echo $DOCKER_PASSWORD | docker login git.pbiernat.dev -u $DOCKER_USERNAME --password-stdin && echo $DOCKER_PASSWORD | docker login git.pbiernat.dev -u $DOCKER_USERNAME --password-stdin &&