diff --git a/.drone.yml b/.drone.yml index 854013e..0d208f0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,38 +3,44 @@ type: docker name: default steps: -- name: static_check - image: golang:1.18 - commands: - - go install honnef.co/go/tools/cmd/staticcheck@latest - - staticcheck ./pkg/... - volumes: - - name: gopath - path: /go +# - name: static_check +# image: golang:1.18 +# commands: +# - go install honnef.co/go/tools/cmd/staticcheck@latest +# - staticcheck ./pkg/... +# volumes: +# - name: gopath +# path: /go -- name: lint - image: golang:1.18 - commands: - - go install golang.org/x/lint/golint@latest - - golint -set_exit_status ./pkg/... - volumes: - - name: gopath - path: /go +# - name: lint +# image: golang:1.18 +# commands: +# - go install golang.org/x/lint/golint@latest +# - golint -set_exit_status ./pkg/... +# volumes: +# - name: gopath +# path: /go -- name: vet - image: golang:1.18 - commands: - - go vet ./pkg/... - volumes: - - name: gopath - path: /go +# - name: vet +# image: golang:1.18 +# commands: +# - go vet ./pkg/... +# volumes: +# - name: gopath +# path: /go - name: build_image image: plugins/docker commands: - - p1=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f1) && - p2=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f2) && - docker build -t git.pbiernat.dev/golang/vegvisir:$p1-$p2 -f Dockerfile.build . + - echo "develop" | grep -s '/' + - echo "develop/fix" | grep -s '/' + - echo "develop" | grep -s -v '/' + - echo "develop/fix" | grep -s -v '/' + # - simple=$(echo $CI_COMMIT_BRANCH | grep '/') ; + # p1=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f1 -s) && + # p2=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f2 -s) && + # tag=${simple:-$p1-$p2} && + # docker build -t git.pbiernat.dev/golang/vegvisir:$tag -f Dockerfile.build . volumes: - name: docker-sock path: /var/run @@ -47,10 +53,12 @@ steps: DOCKER_PASSWORD: from_secret: registry_password commands: - - p1=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f1) && - p2=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f2) && - docker login git.pbiernat.dev -u $DOCKER_USERNAME -p $DOCKER_PASSWORD && - docker push git.pbiernat.dev/golang/vegvisir:$p1-$p2 + - simple=$(echo $CI_COMMIT_BRANCH | grep '/') ; + p1=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f1 -s) && + p2=$(echo $CI_COMMIT_BRANCH | cut -d '/' -f2 -s) && + tag=${simple:=$p1-$p2} && + echo $DOCKER_PASSWORD | docker login git.pbiernat.dev -u $DOCKER_USERNAME --password-stdin && + docker push git.pbiernat.dev/golang/vegvisir:$tag volumes: - name: docker-sock path: /var/run