core/.drone.yml

64 lines
1.5 KiB
YAML
Raw Normal View History

2023-12-12 22:55:19 +00:00
kind: pipeline
2023-12-12 22:59:18 +00:00
type: docker
2023-12-12 22:55:19 +00:00
name: default
steps:
2023-12-12 22:59:18 +00:00
- name: greeting
image: alpine
commands:
- echo hello
- echo world
2023-12-12 22:55:19 +00:00
- name: test
image: golang
volumes:
- name: deps
path: /go
commands:
- go test ./...
- name: build
image: golang
volumes:
- name: deps
path: /go
commands:
- go build ./...
2023-12-13 21:31:33 +00:00
- name: notify
image: pluie/alpine
commands:
2023-12-13 23:17:06 +00:00
- export msg=${DRONE_COMMIT_MESSAGE}
2023-12-13 23:52:09 +00:00
- export msg="${msg:0:10}"
2023-12-14 00:00:06 +00:00
- /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} ...\""
2023-12-13 23:58:24 +00:00
2023-12-14 00:33:04 +00:00
# - 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
2023-12-13 23:58:24 +00:00
volumes:
2023-12-14 00:22:13 +00:00
- name: ssh_key
2023-12-14 00:23:55 +00:00
path: /root/.ssh
2023-12-14 00:33:04 +00:00
commands:
2023-12-14 00:35:14 +00:00
- chmod 0400 /root/.ssh/id_rsa.kubehost
2023-12-14 00:33:04 +00:00
- ls -lah /root/.ssh/id_rsa.kubehost
2023-12-14 00:36:52 +00:00
- apk add --no-cache openssh
2023-12-14 00:35:14 +00:00
- ssh -p21022 -i /root/.ssh/id_rsa.kubehost mtc@bosub-kub-int.metacoaching.pro "hostname"
2023-12-13 23:52:09 +00:00
2023-12-12 22:55:19 +00:00
volumes:
- name: deps
2023-12-13 23:58:24 +00:00
temp: {}
2023-12-14 00:14:24 +00:00
- name: ssh_key
host:
2023-12-14 00:23:55 +00:00
path: /home/repo/drone