Replace sr.ht builds by internal drone CI
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
3f3c835598
commit
37310e16ab
3 changed files with 37 additions and 54 deletions
37
.build.yml
37
.build.yml
|
@ -1,37 +0,0 @@
|
||||||
image: alpine/edge
|
|
||||||
packages:
|
|
||||||
- elixir
|
|
||||||
- postgresql
|
|
||||||
- postgresql-contrib
|
|
||||||
- docker
|
|
||||||
artifacts:
|
|
||||||
- meta/_build/prod/rel/meta.tar.gz
|
|
||||||
sources:
|
|
||||||
- https://code.recycled.cloud/RecycledCloud/met.git
|
|
||||||
tasks:
|
|
||||||
- setup: |
|
|
||||||
sudo service postgresql setup
|
|
||||||
sudo service postgresql start
|
|
||||||
sudo service docker start
|
|
||||||
cd meta
|
|
||||||
mix local.hex --force
|
|
||||||
mix local.rebar --force
|
|
||||||
mix deps.get
|
|
||||||
- build: |
|
|
||||||
cd meta
|
|
||||||
MIX_ENV=test mix deps.compile
|
|
||||||
MIX_ENV=test mix compile
|
|
||||||
- test: |
|
|
||||||
cd meta
|
|
||||||
sudo docker pull code.ungleich.ch:5050/fnux/e-durable-oci-images/openldap-playground:latest
|
|
||||||
CALL_CONTAINER_RUNTIME_AS_ROOT=1 LDAP_WAIT_LOOPS=100 MIX_ENV=test mix test
|
|
||||||
- lint: |
|
|
||||||
cd meta
|
|
||||||
MIX_ENV=test mix credo
|
|
||||||
- release: |
|
|
||||||
cd meta
|
|
||||||
MIX_ENV=prod mix compile
|
|
||||||
MIX_ENV=prod mix phx.digest
|
|
||||||
MIX_ENV=prod mix release
|
|
||||||
cd _build/prod/rel
|
|
||||||
tar cvzf meta.tar.gz met/
|
|
37
.drone.yml
Normal file
37
.drone.yml
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: fetch-dependencies
|
||||||
|
image: edurable/apmbc-reporting-build-environment:latest
|
||||||
|
commands:
|
||||||
|
- cd web
|
||||||
|
- mix deps.get
|
||||||
|
- name: build-release
|
||||||
|
image: edurable/apmbc-reporting-build-environment:latest
|
||||||
|
environment:
|
||||||
|
MIX_ENV: prod
|
||||||
|
commands:
|
||||||
|
- cd web
|
||||||
|
- mix compile
|
||||||
|
- mix phx.digest
|
||||||
|
- mix release
|
||||||
|
- cd _build/prod/rel
|
||||||
|
- tar czf "meta-$(git describe --exact-match --tags $(git log -n1 --pretty='%h') || git rev-parse HEAD).tar.gz" meta/
|
||||||
|
- name: publish-release-archive
|
||||||
|
image: edurable/apmbc-reporting-build-environment:latest
|
||||||
|
environment:
|
||||||
|
LFTP_PASSWORD:
|
||||||
|
from_secret: ssh_password
|
||||||
|
commands:
|
||||||
|
- cd web/_build/prod/rel
|
||||||
|
- apt-get install -y lftp
|
||||||
|
- mkdir ~/.ssh
|
||||||
|
- ssh-keyscan static.recycled.cloud > ~/.ssh/known_hosts
|
||||||
|
- lftp "sftp://artifacts:$LFTP_PASSWORD@static.recycled.cloud" -e "cd htdocs; put meta-$(git describe --exact-match --tags $(git log -n1 --pretty='%h') || git rev-parse HEAD).tar.gz; bye"
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: secret
|
||||||
|
name: ssh_password
|
||||||
|
data: qdcw1yGdz1iDaGmovTD7Afj1piyjcZ/H4NXNKPpmUWgagBvA
|
17
run-ci.sh
17
run-ci.sh
|
@ -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-meta" \
|
|
||||||
-X POST $BUILDS_INSTANCE/api/jobs | jq
|
|
Loading…
Reference in a new issue