Init deployment via drone CI
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
teutat3s 2023-02-27 16:48:08 +01:00
parent 8c62767ca5
commit de9fafb8e6
Signed by: teutat3s
GPG key ID: 18DAE600A6BBE705
2 changed files with 49 additions and 28 deletions

49
.drone.yml Normal file
View file

@ -0,0 +1,49 @@
kind: pipeline
type: docker
name: check-build
steps:
- name: check
image: denoland/deno:alpine-1.30.3
commands:
- ./build.sh
when:
event:
- push
- name: build documentation image
image: plugins/docker
settings:
registry: registry.greenbaum.cloud
repo: registry.greenbaum.cloud/pub_solar/miom.space
tags:
- latest
- ${DRONE_TAG}
username:
from_secret: docker_username
password:
from_secret: docker_password
when:
event:
- tag
- name: deploy
image: registry.greenbaum.cloud/library/triton-docker
environment:
TRITON_SSH_KEY:
from_secret: triton_ssh_key
TRITON_ACCOUNT:
from_secret: triton_account
TRITON_URL: https://lev-1.api.greenbaum.cloud
TRITON_KEY_ID: 59:9f:5a:6f:c4:e2:3b:32:7f:13:1f:de:b7:59:80:85
PROJECT_NAME: miomspace
commands:
- mkdir -p /home/node/.ssh
- echo -e "$TRITON_SSH_KEY" > /home/node/.ssh/id_rsa
- ./deploy.sh $DRONE_TAG
when:
event:
- promote
- rollback
target:
- production

View file

@ -16,34 +16,6 @@ if [[ -z "$TAG" ]]; then
exit 1
fi
# Workaround for SSL: CERTIFICATE_VERIFY_FAILED error with docker-compose
if [ -z "$CURL_CA_BUNDLE" ]; then
if [ ! -f ~/Downloads/cacert-2022-03-29.pem ]; then
echo
echo "Couldn't find required CURL_CA_BUNDLE env variable..."
echo "Downloading https://curl.se/ca/cacert-2022-03-29.pem to ~/Downloads/cacert-2022-03-29.pem"
echo
curl https://curl.se/ca/cacert-2022-03-29.pem -o ~/Downloads/cacert-2022-03-29.pem
fi
export CURL_CA_BUNDLE=~/Downloads/cacert-2022-03-29.pem
fi
# Make sure we're using the local docker host for building our image
eval "$(triton env --unset)"
# Build the image locally
docker build --tag registry.greenbaum.cloud/pub_solar/miom.space:"$TAG" .
# Login to Greenbaum's private docker registry and push the image
docker login registry.greenbaum.cloud
docker push registry.greenbaum.cloud/pub_solar/miom.space:"$TAG"
# Change DOCKER_HOST env var to remote docker host (Greenbaum's docker API)
eval "$(triton --account=pub_solar --url=https://lev-1.api.greenbaum.cloud env)"
#
# Login to Greenbaum's private docker registry with Triton, too
docker login registry.greenbaum.cloud
# Use our tag for docker-compose
export DEPLOY_TAG="$TAG"