GithubHelp home page GithubHelp logo

cicd_learning_lab's Introduction

CICD Learning Lab

Lab Agenda

  1. Environment Prep
  2. Stage 1 - Continuous Integration
  3. Stage 2 - Continuous Delivery
  4. Install the Application
  5. Stage 3 - Continuous Deployment
  6. Stage 4 - Monitoring and Notify Phase
  7. Bonus - CICD In Action!
  8. Clean-Up

Here are links to each part of the lab. They do build on each other so be sure to go in order.

Introduction

This lab is intended to be an introduction to setting up a very basic CI/CD (Continuous Integration/Continuous Delivery) Pipeline. There are many different technologies and methods that can be used for CI/CD, in this lab we will use:

Prerequisites

To run through this lab, you will need to have accounts (all free) created with the following services, as well as a set of tools properly setup on your laptop or workstation.

Accounts

  • You will also use your Spark login to retrieve the Spark API token. Go to developer.ciscospark.com, where you will find your token by logging into the developer portal, clicking on your image in the upper right corner, and clicking Copy

  • Note: if you are using 2FA for your GitHub account, let the admin know, as that will change how you do authentication later in the lab exerices.

Laptop or Workstation

To successfully complete this lab, you must have a supported working environment (i.e. laptop/workstation). There are two options for meeting this requirement:

  1. Natively use your own workstation by installing and configuring the below list of software and utilities.
  2. Run the lab within the provided Docker container to avoid the need to install additional software on your workstation.
    • For this option, you will need to have the ability to run a Docker container on your workstation. Options for this include native Docker installation, boot2docker, or docker-machine options.

Though Windows Operation Systems are becoming more common with developers, and many development tools and utilities are being made available natively for Windows users, the exercises in this lab are NOT supported on Windows Natively. If you are working from a Windows machine, please use the provided Docker Container option.

Option 1: Leverage your Native Workstation

If you will be completing the lab using your native workstation, you will need to ensure the following components are installed and functioning correctly.

  • git
  • docker
    • for platforms with native docker available (ie Linux/Mac) having the docker daemon installed and running can be used
    • docker-machine is also fully acceptable for this lab
    • Installation Instructions: https://docs.docker.com/engine/installation/
      • Optionally, you can install the full Docker toolbox for Mac, Linux, or Windows
  • Python 2.7
  • drone command line tools
    • drone is the CICD tool used for this lab, and the command line tools are used to properly secure the secret information (i.e. userids, passwords) used for all the services utilized
    • the tools require docker to be installed and working
    • Installation Instructions: http://readme.drone.io/devs/cli
    • Basic Installation Steps
      • Linux
        • curl http://downloads.drone.io/drone-cli/drone_linux_amd64.tar.gz | tar zx
        • sudo install -t /usr/local/bin drone
      • Mac
        • curl http://downloads.drone.io/drone-cli/drone_darwin_amd64.tar.gz | tar zx
        • sudo cp drone /usr/local/bin

Option 2: Run the Lab within a Container

hpreston/devbox

If your workstation is Windows based, or you prefer to NOT use your native workstation, you can run the lab exercises from within a Docker container.

To use this method, you will need to be able to run a Docker container on a host machine somewhere.

From your Docker host, run the following command to pull down and enter an interactive shell on the provided development container.

# It may take some time to complete this command while the full container is downloaded
docker run -it --name cicdlab hpreston/devbox:cicdlab

[root@cf95a414877e coding]#

This will put you at a prompt similar to the above. The container is a Linux based working environment with the following utilities and software installed and ready to use.

  • nano
    • Provided as a text editor to use for executing the lab steps
  • git
  • docker
    • the container has the docker tools installed, but the docker run command above will NOT enable you to run additional containers from inside

    • running containers is not a required step in the lab, but if you would like to do so, you can use the following command instead

      docker run -it --name cicdlab -v /var/run/docker.sock:/var/run/docker.sock hpreston/devbox:cicdlab
      
    • this command will link the docker daemon on the host machine into the container

  • drone cli tools

If you exit out of the container before completing the lab and want to continue from where you left off, do not execute a docker run command again. This will create a new clean container that lacks any of your work. Instead follow the below to start the original container.

# Verify that you have  a container in a stopped state
docker ps -a

CONTAINER ID        IMAGE                         COMMAND             CREATED             STATUS                        PORTS               NAMES
cf95a414877e        hpreston/devbox:cicdlab       "/bin/bash"         2 minutes ago       Exited (0) 10 seconds ago                         cicdlab

# Restart your stopped container
docker start -i cicdlab

[root@cf95a414877e coding]#

Lab Environment Details

  • Drone Build Server Address (referred to as DRONE_SERVER)
  • Mantl Control Server Address (referred to as "Mantl Control Server")
  • Mantl Username & Password
  • Mantl Application Domain (referred to as "Lab Application domain")
  • Spark RoomId for Notifications (a hash key provided for Spark Room notifications and referred to as SPARK_ROOM)

For this lab you will be leveraging a Lab Mantl Instance and Drone Build Server. Your lab admin will provide the following information. Make a note of these details as you will need them periodically during the following lab exercises.

Next Step!

Now that you've got all the pre-reqs setup, move onto the next step.

  1. Environment Prep

cicd_learning_lab's People

Contributors

hpreston avatar kecorbin avatar

Watchers

James Cloos avatar  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.