Hexbear is the engine that powers Chapochat. It is a customization of the Lemmy project.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

158 lines
3.2 KiB

---
kind: pipeline
type: docker
name: build
trigger:
branch:
- main
event:
- push
- pull_request
- tag
clone:
skip_verify: true
steps:
- name: fetch
image: alpine/git
commands:
- git fetch --tags
- git submodule update --init
- name: prepare_cargo_cache
image: busybox
commands:
- mkdir -p /cache/${DRONE_REPO}/cargo
volumes:
- name: cache
path: /cache
- name: build_backend
image: rust:1.47
env:
- CARGO_TARGET_DIR=/var/cache/drone/cargo
- CARGO_HOME=/var/cache/drone/cargo
commands:
- cd server
- cargo build --target-dir /var/cache/drone/cargo
volumes:
- name: cargo
path: /var/cache/drone/cargo
depends_on: [ fetch, prepare_cargo_cache ]
- name: notify-matrix
image: plugins/matrix
settings:
homeserver: https://matrix.chapo.chat
roomid: "!TjshsDXBWkOhmZIrmL:chapo.chat"
username:
from_secret: matrix_username
password:
from_secret: matrix_password
depends_on: [build_backend]
when:
status:
- success
- failure
volumes:
- name: cache
host:
path: /var/cache
- name: cargo
host:
path: /var/cache/${DRONE_REPO}/cargo
---
kind: pipeline
type: docker
name: deploy
trigger:
event:
- promote
target:
- dev
- prod
clone:
skip_verify: true
globals:
- &docker_settings
username:
from_secret: CHAPO_REGISTRY_USER
password:
from_secret: CHAPO_REGISTRY_TOKEN
registry:
from_secret: CHAPO_REGISTRY_URL
repo:
from_secret: CHAPO_REGISTRY_URL_REPO
steps:
- name: fetch
image: alpine/git
commands:
- git fetch --tags
- git submodule update --init
- name: prepare_docker_cache
image: busybox
commands:
- mkdir -p /cache/${DRONE_REPO}/docker
volumes:
- name: cache
path: /cache
- name: docker_build
image: plugins/docker
settings:
<<: *docker_settings
use_cache: true
dockerfile: docker/prod/Dockerfile
build_args:
- FRONTEND_TAG=${DRONE_DEPLOY_TO}-latest
tags:
- ${DRONE_DEPLOY_TO}-latest
- ${DRONE_BRANCH}
- ${DRONE_COMMIT_SHA:0:8}
- ${DRONE_BRANCH}-${DRONE_COMMIT}
- ${DRONE_DEPLOY_TO}-${DRONE_COMMIT}
cache_from:
- registry.chapo.chat/hexbear:${DRONE_BRANCH}
- registry.chapo.chat/hexbear:${DRONE_DEPLOY_TO}-latest
purge: false
volumes:
- name: docker
path: /var/lib/docker
- name: dockersock
path: /var/run/docker.sock
depends_on: [ fetch, prepare_docker_cache ]
- name: notify-matrix
image: plugins/matrix
settings:
homeserver: https://matrix.chapo.chat
roomid: "!TjshsDXBWkOhmZIrmL:chapo.chat"
username:
from_secret: matrix_username
password:
from_secret: matrix_password
depends_on: [ docker_build ]
when:
status:
- success
- failure
volumes:
- name: cache
host:
path: /var/cache
- name: docker
host:
path: /var/cache/${DRONE_REPO}/docker
- name: dockersock
host:
path: /var/run/docker.sock