77 lines
1.6 KiB
YAML
77 lines
1.6 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: default
|
|
|
|
steps:
|
|
- name: greeting
|
|
image: alpine
|
|
commands:
|
|
- echo hello
|
|
- echo world
|
|
|
|
- name: test
|
|
image: golang
|
|
volumes:
|
|
- name: deps
|
|
path: /go
|
|
commands:
|
|
- go test ./...
|
|
|
|
- name: build
|
|
image: golang
|
|
volumes:
|
|
- name: deps
|
|
path: /go
|
|
commands:
|
|
- go build ./...
|
|
|
|
# - name: deploy code
|
|
# image: appleboy/drone-ssh
|
|
# volumes:
|
|
# - name: ssh_key
|
|
# path: /root/.ssh
|
|
# settings:
|
|
# host: bosub-kub-int.metacoaching.pro
|
|
# username: mtc
|
|
# port: 21022
|
|
# key_path: /root/.ssh/id_rsa.kubehost
|
|
# script:
|
|
# - echo "Target host name :\ `hostname`"
|
|
|
|
- name: test volumes
|
|
image: alpine
|
|
volumes:
|
|
- name: ssh_key
|
|
path: /root/.ssh
|
|
commands:
|
|
- chmod 0400 /root/.ssh/id_rsa.kubehost
|
|
- ls -lah /root/.ssh/id_rsa.kubehost
|
|
- apk add --no-cache openssh
|
|
- ssh -p21022 -o StrictHostKeyChecking=accept-new -i /root/.ssh/id_rsa.kubehost mtc@bosub-kub-int.metacoaching.pro "hostname"
|
|
|
|
- name: notify
|
|
image: pluie/alpine
|
|
environment:
|
|
ZULIP_HOST: https://zulip.meta-tech.academy
|
|
ZULIP_STREAM: gitea
|
|
ZULIP_TOPIC: build
|
|
ZULIP_STATUS: ":check:"
|
|
ZULIP_USER:
|
|
from_secret: ZULIP_BOT
|
|
ZULIP_TKN:
|
|
from_secret: ZULIP_TOKEN
|
|
commands:
|
|
- if [ "${DRONE_BUILD_STATUS}" != "success" ]; then export ZULIP_STATUS=":prohibited:"; fi
|
|
- export ZULIP_MESSAGE=${DRONE_COMMIT_MESSAGE}
|
|
- export ZULIP_COMMIT=${DRONE_COMMIT}
|
|
- echo $SHORT_COMMIT
|
|
- echo $ZULIP_STATUS
|
|
- echo $ZULIP_MESSAGE
|
|
- bach -c "echo $${ZULIP_COMMIT:0:7}"
|
|
|
|
volumes:
|
|
- name: deps
|
|
temp: {}
|
|
- name: ssh_key
|
|
host:
|
|
path: /home/repo/drone |