Replace srht CI by internal drone pipeline
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Timothée Floure 2022-04-20 11:00:21 +02:00
parent b9aa3eeb98
commit 90187f03c9
Signed by: tfloure
GPG Key ID: 4502C902C00A1E12
3 changed files with 34 additions and 36 deletions

View File

@ -1,19 +0,0 @@
image: alpine/latest
packages:
- elixir
artifacts:
- ha-handler/_build/prod/rel/ha-handler.tar.gz
sources:
- https://code.recycled.cloud/RecycledCloud/ha-handler.git
tasks:
- setup: |
cd ha-handler
mix local.hex --force
mix local.rebar --force
mix deps.get
- release: |
cd ha-handler
MIX_ENV=prod mix compile
MIX_ENV=prod mix release
cd _build/prod/rel
tar cvzf ha-handler.tar.gz ha_handler/

34
.drone.yml Normal file
View File

@ -0,0 +1,34 @@
---
kind: pipeline
name: default
steps:
- name: build-release
image: alpine:latest
environment:
MIX_ENV: prod
commands:
- apk add elixir git
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
- mix compile
- mix release
- cd _build/prod/rel
- tar czf "apmbc-$(git describe --exact-match --tags $(git log -n1 --pretty='%h') || git rev-parse HEAD).tar.gz" apmbc/
- name: publish-release-archive
image: alpine:latest
environment:
LFTP_PASSWORD:
from_secret: ssh_password
commands:
- apk add git lft
- 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 apmbc-$(git describe --exact-match --tags $(git log -n1 --pretty='%h') || git rev-parse HEAD).tar.gz; bye"
---
kind: secret
name: ssh_password
data: aRTqi4c0MkO0arILOMZOFPeRg4HrCRkR52NcxwWRKI6ju69L

View File

@ -1,17 +0,0 @@
#!/bin/sh
set -e
BUILDS_INSTANCE=https://builds.sr.ht
MANIFEST=.build.yml
if [ -z "$SRHT_ACCESS_TOKEN" ]; then
echo "Please set SRHT_ACCESS_TOKEN before calling this script." >&2
exit 1
fi
curl \
-H Authorization:"token $SRHT_ACCESS_TOKEN" \
--data "manifest=$(jq -R -r --slurp < $MANIFEST)" \
--data "note=recycledcloud-ha-handler" \
-X POST $BUILDS_INSTANCE/api/jobs | jq