cannery/.drone.yml

96 lines
1.9 KiB
YAML
Raw Normal View History

2022-01-23 00:00:11 -05:00
kind: pipeline
type: docker
name: lokal
steps:
2022-02-25 22:19:06 -05:00
- name: restore-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount:
- _build
- deps
- assets/node_modules/
2022-01-23 00:00:11 -05:00
- name: test
2022-07-30 16:08:31 -04:00
image: elixir:1.13.4-alpine
2022-01-23 00:00:11 -05:00
environment:
TEST_DATABASE_URL: ecto://postgres:postgres@database/lokal_test
2022-02-25 22:19:06 -05:00
HOST: testing.example.tld
2022-01-23 00:00:11 -05:00
commands:
2022-07-30 16:08:31 -04:00
- apk add --no-cache build-base npm git python3
2022-01-23 00:00:11 -05:00
- mix local.rebar --force
- mix local.hex --force
- mix deps.get
2022-07-30 16:08:31 -04:00
- mix deps.compile
- npm --prefix ./assets ci --progress=false --no-audit --loglevel=error
- npm run --prefix ./assets deploy
- mix do phx.digest, gettext.extract
2022-01-23 00:00:11 -05:00
- mix test
2022-02-25 22:19:06 -05:00
- name: build and publish stable
2022-07-30 16:08:31 -04:00
image: thegeeklab/drone-docker-buildx
privileged: true
2022-02-12 02:38:15 -05:00
settings:
repo: shibaobun/lokal
2022-07-30 16:08:31 -04:00
purge: true
compress: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
2022-02-25 22:19:06 -05:00
username:
from_secret: docker_username
password:
from_secret: docker_password
2022-02-12 02:38:15 -05:00
tags: latest
2022-02-25 22:19:06 -05:00
when:
branch:
- stable
- name: build and publish tagged version
2022-07-30 16:08:31 -04:00
image: thegeeklab/drone-docker-buildx
privileged: true
2022-02-25 22:19:06 -05:00
settings:
repo: shibaobun/lokal
2022-07-30 16:08:31 -04:00
purge: true
compress: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
2022-02-12 02:38:15 -05:00
username:
from_secret: docker_username
password:
from_secret: docker_password
2022-02-25 22:19:06 -05:00
tags:
- ${DRONE_TAG}
when:
event:
- tag
- name: rebuild-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- _build
- deps
- assets/node_modules/
2022-02-12 02:38:15 -05:00
2022-01-23 00:00:11 -05:00
services:
- name: database
image: postgres:13
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
2022-02-25 22:19:06 -05:00
volumes:
- name: cache
host:
2022-07-30 16:08:31 -04:00
path: /run/media/default/ssdsrv/gitea/drone-cache
2022-02-25 22:19:06 -05:00
- name: docker_sock
host:
path: /var/run/docker.sock