ha-handler/.drone.yml
Timothée Floure 06b52b3b2a
All checks were successful
continuous-integration/drone/push Build is passing
Pin build image to Alpine 3.15
2022-06-09 08:54:13 +02:00

34 lines
1,007 B
YAML

---
kind: pipeline
name: default
steps:
- name: build-release
image: alpine:3.15
environment:
MIX_ENV: prod
commands:
- apk add elixir git make gcc libc-dev
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
- mix compile
- mix release
- cd _build/prod/rel
- tar czf "ha-handler-$(git describe --exact-match --tags $(git log -n1 --pretty='%h') || git rev-parse HEAD).tar.gz" ha_handler/
- name: publish-release-archive
image: alpine:3.15
environment:
LFTP_PASSWORD:
from_secret: ssh_password
commands:
- apk add git lftp openssh-client
- cd _build/prod/rel
- mkdir ~/.ssh
- ssh-keyscan static.recycled.cloud > ~/.ssh/known_hosts
- lftp "sftp://artifacts:$LFTP_PASSWORD@static.recycled.cloud" -e "cd htdocs; put ha-handler-$(git describe --exact-match --tags $(git log -n1 --pretty='%h') || git rev-parse HEAD).tar.gz; bye"
---
kind: secret
name: ssh_password
data: aRTqi4c0MkO0arILOMZOFPeRg4HrCRkR52NcxwWRKI6ju69L