Giter Site home page Giter Site logo

jameshall1999 / jenkins-workshop Goto Github PK

View Code? Open in Web Editor NEW

This project forked from willgibson/jenkins-workshop

0.0 0.0 0.0 24 KB

A hacked together flask api in a docker container

License: MIT License

Dockerfile 58.85% Python 29.13% Shell 12.02%

jenkins-workshop's Introduction

An Introduction to Jenkins & Continous Integration

Just a little something to introduce some people to CI/CD with Jenkins

Requirements

You will need Docker and Docker Compose, check you have both with this command...

docker -v && docker-compose -v 

Preparation

Fork https://github.com/WillGibson/jenkins-workshop to your GitHub account, clone your fork. to your machine and cd jenkins-workshop.

Sample App

A hacked together Flask API in a docker container

Build: ./build.sh

Run: ./run.sh

Test: ./dockertest.sh

Jenkins

Setting up Jenkins

  • Move into the jenkins folder cd jenkins

  • Fire up Jenkins in a Docker container with Docker Compose docker-compose up

  • Hit http://localhost:8080/ and log in with the admin password you got in the output from the previous command

  • Install suggested plugins

  • Create your admin user and click through past "Save and continue"

Setting up our pipeline

  • Click "Create a job"

  • Enter a name, select "Pipeline" and click "OK"

  • General

    • Check "Do not allow concurrent builds"

    • Check "GitHub project" and enter the URL "https://github.com/<your_github_username>/jenkins-workshop"

    • Check "This project is parameterised"

      • Select "String parameter"
      • Enter "BRANCH" for the name
      • Enter "master" as the default
  • Build Triggers

    • Ignore this for now
  • Advanced Project Options

    • Ignore this for now
  • Pipeline

    • Select "Pipeline script from SCM" (Source Code Management)

    • Enter the repository URL "https://github.com/<your_github_username>/jenkins-workshop"

    • Delete the "Branch Specifier" (so it can build any branch based on the branch parameter)

    • Uncheck "Lightweight checkout"

  • Click "Save"

Deploying to Heroku

  • (Create a Heroku account](https://signup.heroku.com/login)

  • Create a Heroku app

  • Set the stack of your app to container heroku stack:set container

  • Connect the app to your Git repository

  • Create a deploy key

  • Add the deploy key to you GitHub repo with write access

Useful commands

  • Log into the jenkins container docker exec -it jenkins_workshop /bin/bash

  • Run the Jenkins container in the background docker-compose up -d

  • Stop the Jenkins container if you ran it in the background docker-compose down

References

jenkins-workshop's People

Contributors

willgibson avatar stephenthomson avatar jameshall1999 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.