core/.drone.yml
mahdi 1cd9a09d6e
Some checks reported errors
continuous-integration/drone/push Build encountered an error
devops - drone test
2023-12-14 01:06:40 +01:00

51 lines
1.2 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: notify
image: pluie/alpine
commands:
- export msg=${DRONE_COMMIT_MESSAGE}
- export msg="${msg:0:10}"
- /bin/bash -c "curl -s -k -X POST https://zulip.meta-tech.academy/api/v1/messages -u drone-bot@zulip.meta-tech.academy:iIm8Hc2VuvK06iDxUODUIndlRu6As6bO --data-urlencode type=stream --data-urlencode 'to=\"gitea\"' --data-urlencode topic=build --data-urlencode content=\"build n° ${DRONE_BUILD_NUMBER} - ${DRONE_REPO}/${DRONE_REPO_BRANCH}/${DRONE_COMMIT} by ${DRONE_COMMIT_AUTHOR} > ${DRONE_BUILD_STATUS} < $${msg} ...\""
- name: deploy code
image: appleboy/drone-ssh
volumes:
- /home/repo/drone/id_rsa.kubehost:/root/ssh/id_rsa.drone
key_path: /root/ssh/id_rsa.drone
settings:
host: bosub-kub-int.metacoaching.pro
username: mtc
port: 21022
key_path: /root/ssh/id_rsa.drone
script:
- echo "Target host name :\ `hostname`"
volumes:
- name: deps
temp: {}