Skip to content

brandonroyal/mta_ci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker MTA "CI in a Box"

Self-contained solution for CI within MTA Infrastructure for automated builds

Pre-Installation

  1. Install UCP and join at least one (1) linux worker node.

Installation

We'll be installing CI services on a dedicated node in UCP

  1. Set environment variables and secrets
#VERSION of images
export VERSION=0.5.1
#HOSTNAME within swarm on which you want to pin the services. a single swarm work is recommended (HINT: get your desired hostname using `docker node ls`)
export HOSTNAME=<node_hostname>
#JENKINS_USERNAME
export JENKIN_USERNAME=admin
#Jenkins default username
echo $JENKIN_USERNAME | docker secret create jenkins-user -

#Jenkins password
read -s password && echo $password | docker secret create jenkins-pass -

#MySQL root password
read -s password && echo $password | docker secret create mysql-root-pass -
  1. Download compose file and deploy stack
wget https://raw.githubusercontent.com/BrandonRoyal/mta_ci/master/docker-compose.yml
docker stack deploy -c docker-compose.yml mtaci
  1. Browse to gogs app at http://<hostname>:3000, click Register and register with your own username, email and password then login (NOTE: you will become the admin user by default)

image

  1. Create organization named mta

image

  1. Create new Migration using the following configurations:

    • Clone Address: https://github.com/brandonroyal/mta_projecttemplate-linux
    • Owner: mta
    • Repository Name: app1

image

  1. Add Jenkins webhook by navigating to app1 >> Settings >> Webhooks and clicking Add Webhook >> Gogs

image

  1. Include the following information in your webhook. Save when complete.

    • Payload URL: http://automation:8080/gogs-webhook/?job=mta
    • Content Type: application/json

image

Usage

  1. Clone app1 repo to your working machine and change to app1 directory
git clone http://<hostname>:3000/mta/app1.git
cd app1

Contributing

  1. Build images
sh build.sh
  1. Set environment variables
export JENKINS_USERNAME=admin
export JENKINS_PASSWORD=password
  1. Deploy stack
sh deploy.sh

Project Structure

project
│
└───bootstrap
│   │   ...
│
└───configs
│   │   ...
│   └───automation
│       │   ...
│   └───git
│       │   ...
│
└───services
│   │   ...
│   └───automation
│       │   ...
│   └───git
│       │   ...
│   └───git_db
│       │   ...

bootstrap

Location for templated MTA PoC project structure. Include a working Jenkinsfile for automating builds

configs

Configuration files for services used to preset the git (Gogs) and automation (Jenkins) services

services

Services for self contained MTA CI

Credits

Jenkins setup automation - Viktor Farcic (Docker Captain)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published