Git Product home page Git Product logo

devops-360-ci-cd's Introduction

DevOps 360° CI / CD

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

1. Stage 1 - Design a CI / CD / CDD Workflow

  • Continuous Integration (CI):

📍 ................. 🔀 ................. 🔀 ................. 🔀 ................. 🏁

  • Continuous Delivery (CD):

📍 ................. 🔀 ................. 🔀 ................. 🔀 ................. 🔀 ................. 🏁

  • Continuous Deployment (CDD):

📍 ................. 🔀 ................. 🔀 ................. 🔀 ................. 🔀 ................. 🔀 ................. 🏁

2. Stage 2 - Setup the CI / CD Server

CI CD Infrastructure

2.1. GitHub OAuth App setup

2.2. Ansible setup

2.2.1. Drone

  • Spin up the CI/CD stack using Ansible. Make sure your inventory file ansible/inventories/vms/hosts and your group_vars ansible/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 a ansible/inventories/vms/group_vars/drone/drone/vault.yml file along side with your vars.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

2.2.2. Webserver SPA

# 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

3.1. Integrate the Webapp repository with Drone

  • On the Drone server, activate the DevOps-360-react app repository so that Drone can track the git activity:

Drone repository activation

  • Now click on Drone arrow to go to the project and then make sure the hooks in the settings are set as follows:

Drone repository activation

pipeline:
  echo:
    image: node:alpine
    commands:
      - echo 'Run CI / CD Pipeline on Drone'
  • Commit and push the file and see what happens on Drone.

3.2. Write the CI steps for the pipeline

Use the following docs and write the corresponding pipeline steps to integrate your application:

3.2. Write the CD steps for the pipeline

Use the following docs and write the corresponding pipeline steps to release your application:

3.3. Write the CDD steps for the pipeline

Use the following docs and write the corresponding pipeline steps to deploy your application:

4. Stage 4 - Play and understand how CI / CD / CDD pipelines enhance a development process

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

devops-360-ci-cd's People

Contributors

lowess avatar louis-iteracode avatar

Watchers

James Cloos avatar Louis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.