update build settings

This commit is contained in:
shibao 2022-02-25 22:19:06 -05:00
parent e57e3f10e8
commit b357d44c0e

View File

@ -2,16 +2,24 @@ kind: pipeline
type: docker type: docker
name: lokal name: lokal
cache: steps:
- name: restore-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount: mount:
- _build - _build
- deps - deps
- assets/node_modules/
steps:
- name: test - name: test
image: bitwalker/alpine-elixir-phoenix:1.13 image: bitwalker/alpine-elixir-phoenix:1.13
environment: environment:
TEST_DATABASE_URL: ecto://postgres:postgres@database/lokal_test TEST_DATABASE_URL: ecto://postgres:postgres@database/lokal_test
HOST: testing.example.tld
commands: commands:
- mix local.rebar --force - mix local.rebar --force
- mix local.hex --force - mix local.hex --force
@ -19,15 +27,44 @@ steps:
- npm install --prefix assets - npm install --prefix assets
- mix test - mix test
- name: build and publish - name: build and publish stable
image: plugins/docker image: plugins/docker
settings: settings:
repo: shibaobun/lokal repo: shibaobun/lokal
tags: latest
username: username:
from_secret: docker_username from_secret: docker_username
password: password:
from_secret: docker_password from_secret: docker_password
tags: latest
when:
branch:
- stable
- name: build and publish tagged version
image: plugins/docker
settings:
repo: shibaobun/lokal
username:
from_secret: docker_username
password:
from_secret: docker_password
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/
services: services:
- name: database - name: database
@ -36,3 +73,11 @@ services:
POSTGRES_USER: postgres POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres POSTGRES_DB: postgres
volumes:
- name: cache
host:
path: /tmp/drone-cache
- name: docker_sock
host:
path: /var/run/docker.sock