GithubHelp home page GithubHelp logo

jenkins-pipeline's Introduction

Jenkins Pipeline for CI/CD

Prerequisites

Getting Started

  • Download and install Jenkins.
  • In Jenkins, make sure to install docker and docker-compose.

Jenkins Pipeline

  • From the Jenkin's Dashboard, select New Item.

    • Enter an Item Name and select Pipeline
    • Select OK

    New Item

  • Click on the Pipeline Tab

    • Definition: Pipeline script from SCM
    • SCM: Git
    • Repositories: Input the repository URL and credentials [select None if it's a public repository]
    • Branches to build: For this example, I used */master. You can also create a parameterized project.
    • Script Path: Jenkinsfile
  • Click SAVE.

    Pipeline SCM

Jenkins Pipeline Stage View

  • Cleanup Workspace
    • Cleanup workspace before building the project.
    • Delete exited containers.
  • Checkout
    • Checkout the branch to build
  • Build
  • Unit Test
  • Deploy
    • Wait for the approver's signal before executing this stage. Otherwise, abort pipeline.

Stage View

Jenkins Pipeline Approval Stage

Approval

docker-compose.yml

Do not forget to update MYSQL's root password.

...
  service-stock-mysql:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: <YOUR_DB_PASSWORD>
...

Adjust the number of replica accordingly.

...
  php:
    image: custom-php:latest
    deploy:
      replicas: 2
    volumes:
      - ./:/var/www/
...

jenkins-pipeline's People

Contributors

mmshin avatar

Watchers

 avatar

Forkers

ch680351034

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.