pepebot/.drone.yml

231 lines
4.2 KiB
YAML
Raw Normal View History

2022-04-09 17:21:25 +02:00
kind: pipeline
type: kubernetes
2022-05-11 14:33:07 +02:00
name: pepebot_build_amd64
2022-05-11 10:48:20 +02:00
platform:
os: linux
arch: amd64
2022-04-09 17:21:25 +02:00
steps:
2022-05-11 14:28:02 +02:00
- name: build-pepebot
2022-05-11 15:10:22 +02:00
image: golang:1.16.4
2022-05-11 14:28:02 +02:00
volumes:
- name: build
2022-05-11 15:01:54 +02:00
path: /drone/src/build
2022-05-11 14:28:02 +02:00
environment:
CGO_ENABLED: 0
GOOS: linux
commands:
2022-05-11 15:01:54 +02:00
- go build -a -installsuffix cgo -o ./build/app ./discord
2022-05-11 14:28:02 +02:00
- name: build-publish-image
2022-04-09 17:21:25 +02:00
image: plugins/docker
2022-05-11 14:33:07 +02:00
privileged: true
2022-05-11 14:28:02 +02:00
volumes:
- name: build
2022-05-11 15:01:54 +02:00
path: /drone/src/build
2022-04-09 17:21:25 +02:00
settings:
2022-05-11 13:45:31 +02:00
cache_from:
- "dutchellie/pepebot:latest"
2022-04-09 17:21:25 +02:00
username:
from_secret: docker_username
password:
from_secret: docker_password
2022-05-11 10:48:20 +02:00
dockerfile: Dockerfile
repo: dutchellie/pepebot
tags:
2022-05-11 12:48:37 +02:00
- latest-amd64
2022-05-11 14:28:02 +02:00
volumes:
- name: build
temp: {}
---
kind: pipeline
type: kubernetes
2022-05-11 14:33:07 +02:00
name: pepebot_service_build_amd64
2022-05-11 14:28:02 +02:00
platform:
os: linux
arch: amd64
steps:
- name: build-pepebot_service
2022-05-11 15:10:22 +02:00
image: golang:1.17
2022-05-11 14:28:02 +02:00
volumes:
- name: build
2022-05-11 15:06:00 +02:00
path: /drone/src/build
2022-05-11 14:28:02 +02:00
environment:
CGO_ENABLED: 0
GOOS: linux
commands:
- cd ./pepeservice
2022-05-11 15:06:00 +02:00
- go build -a -installsuffix cgo -o ../build/app .
2022-05-11 10:48:20 +02:00
- name: build-service
image: plugins/docker
2022-05-11 14:33:07 +02:00
privileged: true
2022-05-11 14:28:02 +02:00
volumes:
- name: build
2022-05-11 15:06:00 +02:00
path: /drone/src/build
2022-05-11 10:48:20 +02:00
settings:
2022-05-11 13:45:31 +02:00
cache_from:
- "dutchellie/pepebot_service:latest"
2022-05-11 10:48:20 +02:00
username:
from_secret: docker_username
password:
from_secret: docker_password
dockerfile: pepeservice/Dockerfile
repo: dutchellie/pepebot_service
tags:
2022-05-11 12:48:37 +02:00
- latest-amd64
2022-05-11 10:48:20 +02:00
2022-05-11 14:28:02 +02:00
volumes:
- name: build
temp: {}
2022-05-11 10:48:20 +02:00
---
kind: pipeline
type: docker
name: pepebot_build_arm64
platform:
os: linux
arch: arm64
steps:
2022-05-11 14:28:02 +02:00
- name: build-pepebot
2022-05-11 15:10:22 +02:00
image: golang:1.16.4
2022-05-11 14:28:02 +02:00
volumes:
- name: build
2022-05-11 15:06:00 +02:00
path: /drone/src/build
2022-05-11 14:28:02 +02:00
environment:
CGO_ENABLED: 0
GOOS: linux
commands:
2022-05-11 15:06:00 +02:00
- go build -a -installsuffix cgo -o ./build/app ./discord
2022-05-11 14:28:02 +02:00
- name: build-publish-image
2022-05-11 10:48:20 +02:00
image: plugins/docker
2022-05-11 14:33:07 +02:00
privileged: true
2022-05-11 14:28:02 +02:00
volumes:
- name: build
2022-05-11 15:06:00 +02:00
path: /drone/src/build
2022-05-11 10:48:20 +02:00
settings:
2022-05-11 13:45:31 +02:00
cache_from:
- "dutchellie/pepebot:latest"
2022-05-11 10:48:20 +02:00
username:
from_secret: docker_username
password:
from_secret: docker_password
dockerfile: Dockerfile
repo: dutchellie/pepebot
tags:
2022-05-11 12:48:37 +02:00
- latest-arm64
2022-05-11 14:28:02 +02:00
volumes:
- name: build
temp: {}
---
kind: pipeline
type: docker
name: pepebot_service_build_arm64
platform:
os: linux
arch: arm64
steps:
- name: build-pepebot_service
2022-05-11 15:10:22 +02:00
image: golang:1.17
2022-05-11 14:28:02 +02:00
volumes:
- name: build
2022-05-11 15:06:00 +02:00
path: /drone/src/build
2022-05-11 14:28:02 +02:00
environment:
CGO_ENABLED: 0
GOOS: linux
commands:
- cd ./pepeservice
2022-05-11 15:06:00 +02:00
- go build -a -installsuffix cgo -o ../build/app .
2022-05-11 10:48:20 +02:00
- name: build-service
image: plugins/docker
2022-05-11 14:33:07 +02:00
privileged: true
2022-05-11 14:28:02 +02:00
volumes:
- name: build
2022-05-11 15:06:00 +02:00
path: /drone/src/build
2022-05-11 10:48:20 +02:00
settings:
2022-05-11 13:45:31 +02:00
cache_from:
- "dutchellie/pepebot_service:latest"
2022-05-11 10:48:20 +02:00
username:
from_secret: docker_username
password:
from_secret: docker_password
dockerfile: pepeservice/Dockerfile
repo: dutchellie/pepebot_service
2022-04-09 17:21:25 +02:00
tags:
2022-05-11 12:41:37 +02:00
- latest-arm64
2022-05-11 14:28:02 +02:00
volumes:
- name: build
temp: {}
2022-05-11 12:41:37 +02:00
---
kind: pipeline
type: kubernetes
name: manifest
steps:
- name: manifest-main
image: plugins/manifest
settings:
platforms:
2022-05-11 12:48:37 +02:00
- linux/amd64
2022-05-11 12:41:37 +02:00
- linux/arm64
2022-05-11 12:48:37 +02:00
target: dutchellie/pepebot:latest
template: dutchellie/pepebot:latest-ARCH
2022-05-11 12:41:37 +02:00
username:
from_secret: docker_username
password:
from_secret: docker_password
- name: manifest-pepebotservice
image: plugins/manifest
settings:
platforms:
2022-05-11 12:48:37 +02:00
- linux/amd64
2022-05-11 12:41:37 +02:00
- linux/arm64
2022-05-11 12:48:37 +02:00
target: dutchellie/pepebot_service:latest
template: dutchellie/pepebot_service:latest-ARCH
2022-05-11 12:41:37 +02:00
username:
from_secret: docker_username
password:
from_secret: docker_password
depends_on:
- pepebot_build_arm64
2022-05-11 14:33:07 +02:00
- pepebot_build_amd64
- pepebot_service_build_arm64
2022-05-19 13:36:14 +02:00
- pepebot_service_build_amd64
---
kind: pipeline
type: kubernetes
name: deploy_on_pi
trigger:
branch:
- main
steps:
- name: deploy
image: appleboy/drone-ssh
settings:
host: home.dutchellie.nl
port: 223
username: ellie
key:
from_secret: ssh_key
script:
- cd /home/ellie/pepebot
- docker-compose pull app
- docker-compose pull pepe_service
- docker-compose up -d
depends_on:
- manifest