DevOps 360° CI / CD is an introduction to CI/CD with Drone, Ansible and ReactJS. For more details about the project, please check: http://slides.com/floriandambrine/devops360
- Continuous Integration (CI):
- Continuous Delivery (CD):
📍 ................. 🔀 ................. 🔀 ................. 🔀 ................. 🔀 ................. 🏁
- Continuous Deployment (CDD):
📍 ................. 🔀 ................. 🔀 ................. 🔀 ................. 🔀 ................. 🔀 ................. 🏁
-
Follow the Github documentation to setup an OAuth App
-
Spin up the CI/CD stack using Ansible. Make sure your inventory file
ansible/inventories/vms/hosts
and your group_varsansible/inventories/vms/group_vars/all/libvirt/vars.yml
are configured properly. -
Run
ansible-galaxy install -r requirements.yml
in order to install role's dependencies from Ansible Galaxy -
Create a group_vars override in
ansible/inventories/vms/group_vars/drone/drone/vars.yml
to override multiple Drone settings:
☝️ Note that sensible data should be encrypted using
ansible-vault
. A good practice is to create aansible/inventories/vms/group_vars/drone/drone/vault.yml
file along side with yourvars.yml
files:
---
# vars.yml
drone_host: tp110.ccm.u13.org
drone_admins:
- Lowess
# Secrets stored in vault.yml
drone_oauth_client: "{{ vault_drone_oauth_client }}"
drone_oauth_secret: "{{ vault_drone_oauth_secret }}"
---
# vault.yml
vault_drone_oauth_client: <GitHub OAuth Client>
vault_drone_oauth_secret: <GitHub OAuth Scret>
- Run the following ansible playbook to setup Drone (Note that if you used
ansible-vault
to encrypt secrets you will need to add--vault-password-file <path-to-vault-file>
to your command):
cd ansible
# Setup the Drone CI CD server
ansible-playbook -i inventories/vms drone.yml
-
Fork the DevOps-360-react app project
-
Create a group_vars override in
ansible/inventories/vms/group_vars/web/spa/vars.yml
to point the automation to your own DevOps-360-react app fork
# Setup the Webserver running the SPA
ansible-playbook -i inventories/vms spa.yml
3. Stage 3 - Create the CI / CD pipeline for DevOps-360-react app withg Drone
- On the Drone server, activate the DevOps-360-react app repository so that Drone can track the git activity:
- Create a
.drone.yml
file under the root of the DevOps-360-react app with the following content:
pipeline:
echo:
image: node:alpine
commands:
- echo 'Run CI / CD Pipeline on Drone'
- Commit and push the file and see what happens on Drone.
Use the following docs and write the corresponding pipeline steps to integrate your application:
Use the following docs and write the corresponding pipeline steps to release your application:
Use the following docs and write the corresponding pipeline steps to deploy your application:
Once you're done with the whole CI / CD / CDD, play with the Webapp and fake a real development process:
- Create a
feature
branch - Iterate over the commits
- Merge into
master
- Create a
tag
and push it to create a release