87 lines
1.4 KiB
YAML
87 lines
1.4 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
steps:
|
|
- name: greeting
|
|
group: echo
|
|
image: alpine
|
|
commands:
|
|
- echo hello
|
|
- echo world
|
|
- echo done
|
|
|
|
- name: en
|
|
group: echo
|
|
image: alpine
|
|
commands:
|
|
- echo hello world
|
|
|
|
- name: fr
|
|
group: echo
|
|
image: alpine
|
|
commands:
|
|
- echo bonjour monde
|
|
|
|
- name: build
|
|
image: golang:1.17-alpine
|
|
pull: if-not-exists
|
|
environment:
|
|
CGO_ENABLED: 0
|
|
GOOS: linux
|
|
GOARCH: amd64
|
|
commands:
|
|
- env
|
|
- go build -ldflags="-s -w" -tags timetzdata -o app main.go
|
|
|
|
- name: publish
|
|
image: plugins/docker
|
|
settings:
|
|
repo: esinio/helloworld
|
|
username:
|
|
from_secret: docker_username
|
|
password:
|
|
from_secret: docker_password
|
|
|
|
trigger:
|
|
branch:
|
|
- master
|
|
event:
|
|
- push
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
type: docker
|
|
name: deploy
|
|
|
|
# drone-ssh doc
|
|
# http://plugins.drone.io/appleboy/drone-ssh/
|
|
steps:
|
|
- name: deploy-staging
|
|
# image: appleboy/drone-ssh
|
|
image: alpine
|
|
pull: if-not-exists
|
|
settings:
|
|
script:
|
|
- echo "deply to staging"
|
|
- env
|
|
when:
|
|
event:
|
|
- promote
|
|
target:
|
|
-production
|
|
|
|
- name: deploy-production
|
|
# image: appleboy/drone-ssh
|
|
image: alpine
|
|
pull: if-not-exists
|
|
settings:
|
|
script:
|
|
- echo "deply to production"
|
|
- env
|
|
when:
|
|
event:
|
|
- promote
|
|
target:
|
|
- production |