tholok97 / imt3005-project-cicd

This repo serves as the Puppet control-repo for my project in IMT3005 - Infrastructure as Code. It also contains the OpenStack Heat infrastructure definition for the project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Repo for project "CI/CD with Jenkins and Beaker" in IMT3005 - Infrastructure as Code

Introduction

The goal of the project is to experiment with CI/CD using OpenStack, Jenkins and Beaker. I'm trying to accomplish an infrastructure with a Puppet Master, a Jenkins server and an application server that runs CI/CD on any changes made, and ultimately deploys them into production.

Please see the report for more details about the project itself. It was created from the LaTeX found in report/.

Structure

This repository is mainly a control repository based on this template, but it also contains an infrastructure definition in OpenStack Heat that brings up a stack running the control-repo. The original README from the template is stored here.

Here's a visual representation of the structure of this repository:

imt3005-project-cicd/
├── data/                                 # Hiera data directory.
│   ├── nodes/                            # Node-specific data goes here.
│   └── common.yaml                       # Common data goes here.
├── infrastructure/                       # OpenStack Heat infrastructure definition that defines a stack running this control-repo.
├── manifests/
│   └── site.pp                           # The "main" manifest that contains a default node definition.
├── report/                               # Contains the LaTeX report.
├── scripts/
│   ├── code_manager_config_version.rb    # A config_version script for Code Manager.
│   ├── config_version.rb                 # A config_version script for r10k.
│   └── config_version.sh                 # A wrapper that chooses the appropriate config_version script.
├── site/                                 # This directory contains site-specific modules and is added to $modulepath.
│   ├── profile/                          # The profile module.
│   └── role/                             # The role module.
├── LICENSE
├── Puppetfile                            # A list of external Puppet modules to deploy with an environment.
├── README.md
├── README_original.md                    # Original readme from Puppetlabs template.
├── environment.conf                      # Environment-specific settings. Configures the moduelpath and config_version.
├── hiera.yaml                            # Hiera's configuration file. The Hiera hierarchy is defined here.
└── report.pdf                            # PDF of report. Produced by LaTeX code in `report/` directory.

Related repositories

Other repositories involved with this project. They are discussed in my report.

Usage

The Vagrant environment described in the above section includes everything you need in terms of tools. You do however need access to an Openstack cloud environment to deploy the stack in.

To create the stack

  1. (Either fork this repository and make r10k clone your forked repository, or alter the boot script of manager to pull using HTTPS, not SSH. This is because you need my private Github key to clone the repository with ssh. This is an unfortunate barrier of entry, but I have not had time to fix it.)
  2. Provide your own environment file based on infrastructure/topology_env_example.yaml. (e.g. cp infrastructure/topology_env_example.yaml infrastructure/topology_env.yaml, and fill it with your environment specific settings).
  3. Create the stack defined in infrastructure/topology.yaml, and provide the environment file you made earlier. (e.g. openstack create -t infrastructure/topology.yaml -e infrastructure/topology_env.yaml cicd_stack)
  4. Profit! The stack should configure itself. Find the floating IP address of the Jenkins server and browse to it on port 8080. When the stack is fully provisioned you will see a Jenkins server running here with a few jobs. The admin username/password is insecureAdmin/insecurePassword.

TODO

(WONTFIX, as project is finished)

  • Configure Blue Ocean plugin for Jenkins.
  • Include security groups in infrastructure definition.
  • Separate out general installation in own boot script (to be used with CI).
  • Implement missing functionality described in report.

References

Note that this is a subset of the references found in my report.

About

This repo serves as the Puppet control-repo for my project in IMT3005 - Infrastructure as Code. It also contains the OpenStack Heat infrastructure definition for the project.

License:Apache License 2.0


Languages

Language:TeX 84.0%Language:Puppet 6.9%Language:Shell 5.6%Language:Ruby 3.0%Language:Dockerfile 0.6%