-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
9 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,17 @@ | ||
version: 2.1 | ||
jobs: | ||
build: | ||
parameters: | ||
build-domain: | ||
type: string | ||
ssh-port: | ||
type: integer | ||
environment: | ||
COMPOSE_PROJECT_NAME: lucos_private | ||
BUILD_DOMAIN: << parameters.build-domain >> | ||
SSH_PORT: << parameters.ssh-port >> | ||
docker: | ||
- image: circleci/buildpack-deps:buster | ||
steps: | ||
- run: | ||
name: Check BUILD_DOMAIN | ||
command: echo "Building on host \"$BUILD_DOMAIN\"" | ||
- add_ssh_keys: | ||
fingerprints: | ||
- "3b:d2:84:bc:c8:2e:09:b7:2f:e7:50:23:46:41:cf:23" | ||
- run: | ||
name: Populate known_hosts | ||
command: ssh-keyscan -p $SSH_PORT -H $BUILD_DOMAIN >> ~/.ssh/known_hosts | ||
- run: | ||
name: Remote build | ||
command: ssh $DEPLOY_USERNAME@$BUILD_DOMAIN -o "StrictHostKeyChecking no" -A -p $SSH_PORT CIRCLE_REPOSITORY_URL=$CIRCLE_REPOSITORY_URL DOCKERHUB_USERNAME=$DOCKERHUB_USERNAME DOCKERHUB_PASSWORD=$DOCKERHUB_PASSWORD quickbuild.sh | ||
deploy: | ||
parameters: | ||
host-domain: | ||
type: string | ||
environment: | ||
COMPOSE_PROJECT_NAME: lucos_private | ||
PRODUCTION: true | ||
HOSTDOMAIN: << parameters.host-domain >> | ||
docker: | ||
- image: circleci/buildpack-deps:buster | ||
steps: | ||
- run: | ||
name: Check HOSTDOMAIN | ||
command: echo "Deploying onto host \"$HOSTDOMAIN\"" | ||
- checkout | ||
- add_ssh_keys: | ||
fingerprints: | ||
- "3b:d2:84:bc:c8:2e:09:b7:2f:e7:50:23:46:41:cf:23" | ||
- run: | ||
name: Populate known_hosts | ||
command: ssh-keyscan -H $HOSTDOMAIN >> ~/.ssh/known_hosts | ||
- run: | ||
name: Pull container onto remote box | ||
command: DOCKER_HOST="ssh://$DEPLOY_USERNAME@$HOSTDOMAIN" docker-compose pull | ||
- run: | ||
name: Deploy using docker-compose | ||
command: DOCKER_HOST="ssh://$DEPLOY_USERNAME@$HOSTDOMAIN" docker-compose up -d --no-build | ||
orbs: | ||
lucos: lucos/deploy@0 | ||
workflows: | ||
version: 2 | ||
build-deploy: | ||
jobs: | ||
- build: | ||
- lucos/build-arm: | ||
context: docker | ||
build-domain: xwing.s.l42.eu | ||
ssh-port: 2222 | ||
- deploy: | ||
- lucos/deploy-xwing: | ||
context: docker | ||
host-domain: xwing.s.l42.eu | ||
requires: | ||
- build | ||
- lucos/build-arm | ||
filters: | ||
branches: | ||
only: | ||
- main |