auth-api/.gitea/test-and-build.sh
lilleman 8cf3e9a894
All checks were successful
Test and build / build (push) Successful in 23s
Added image push for db migrations
2024-02-04 04:23:21 +01:00

25 lines
977 B
Bash
Executable File

#!/bin/sh
curl \
--fail-with-body \
-H "Authorization: ${RUNNER_API_KEY}" \
-XPOST 192.168.1.186 \
-H 'Content-Type: application/json; charset=utf-8' \
--data-binary @- <<EOF
{
"commands": [
"git clone --single-branch --branch ${GITHUB_REF_NAME} --depth 1 ssh://git@gitea.larvit.se:21022/pwrpln/auth-api.git",
"cd auth-api",
"docker compose build",
"docker compose --profile tests build",
"docker compose run --rm tests",
"docker compose down -v --remove-orphans -t0",
"echo \"${DOCKER_PASSWORD}\" | docker login gitea.larvit.se --username ${DOCKER_USERNAME} --password-stdin",
"docker build -t gitea.larvit.se/pwrpln/auth-api:${GITHUB_REF_NAME} .",
"docker push gitea.larvit.se/pwrpln/auth-api:${GITHUB_REF_NAME}",
"docker build -t gitea.larvit.se/pwrpln/auth-api-db-migrations:${GITHUB_REF_NAME} -f ./Dockerfile.migrations .",
"docker push gitea.larvit.se/pwrpln/auth-api-db-migrations:${GITHUB_REF_NAME}"
]
}
EOF