diff --git a/.drone.yml b/.drone.yml index 67fbee7..6247c9c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,8 +3,41 @@ kind: pipeline name: linux-amd64 type: kubernetes +platform: + os: linux + arch: amd64 + steps: -- name: docker +- name: build-push + pull: always + image: golang:1.16 + commands: + - "go build -v -ldflags '-X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-packer" + environment: + CGO_ENABLED: 0 + when: + event: + exclude: + - tag + +- name: build-tag + pull: always + image: golang:1.16 + commands: + - "go build -v -ldflags '-X main.version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -a -o release/linux/amd64/drone-packer" + environment: + CGO_ENABLED: 0 + when: + event: + - tag + +- name: executable + pull: always + image: golang:1.16 + commands: + - ./release/linux/amd64/drone-packer --help + +- name: publish image: plugins/docker settings: repo: porto.interlegis.leg.br/library/drone-packer @@ -16,4 +49,14 @@ steps: username: from_secret: porto_user password: - from_secret: porto_pw \ No newline at end of file + from_secret: porto_pw + when: + event: + exclude: + - pull_request + +trigger: + ref: + - refs/heads/master + - "refs/pull/**" + - "refs/tags/**" \ No newline at end of file