Last active
May 31, 2021 15:30
-
-
Save TommyTheTribe/74f019be1f7b839b3cb98a70a5fcee9c to your computer and use it in GitHub Desktop.
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
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