Skip to content

Instantly share code, notes, and snippets.

@TommyTheTribe

TommyTheTribe/config.yml

Last active May 31, 2021
Embed
What would you like to do?
version: "2.1"
executors:
node:
docker:
- image: circleci/node:14.16.0
ubuntu:
machine:
image: ubuntu-2004:202010-01
jobs:
build-docker-image:
docker:
- image: circleci/node:14.15.0
working_directory: ~/project
steps:
- setup_remote_docker:
version: 19.03.13
- run: docker login rg.fr-par.scw.cloud/thetribe -u nologin -p $SCW_SECRET_KEY # ICI VALUER LE BON REGISTRY DOCKER
- run:
command: sh build.sh --push
no_output_timeout: 30m
deploy-staging:
docker:
- image: ansible/ansible:ubuntu1604
working_directory: ~/project
environment:
ANSIBLE_HOST_KEY_CHECKING: false
steps:
- add_ssh_keys:
fingerprints:
- "91:76:19:c1:05:1b:09:71:03:56:31:de:a7:3b:c6:b1"
- run:
name: Create var folder
command: "mkdir ansible/vars"
- run:
name: Set scaleway registry
command: 'echo -e "---\nscaleway_token: $SCW_SECRET_KEY \nscaleway_user: nologin \nscaleway_token: $SCW_SECRET_KEY " > ansible/vars/scaleway_credentials.yml'
- run:
name: Install ansible
command: python -m pip install pip==20.1.1 && python -m pip install ansible && python -m pip install jmespath
- run:
name: Deploy to staging
command: cd ansible && ansible-playbook -i staging deployment.yml
workflows:
version: "2"
build:
jobs:
- build-docker-image:
- deploy-staging:
requires:
- build-docker-image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment