Skip to content

tuanvuPresent/cicd-jenkins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install docker and docker-compose

sudo apt-get update
sudo apt install docker.io

https://docs.docker.com/compose/install/

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Create the docker group if it does not exist

sudo groupadd docker

Add your user to the docker group.

sudo usermod -aG docker $USER
newgrp docker

Install portainer

docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

Install Jenkins

https://hub.docker.com/_/jenkins?tab=description&page=1&ordering=last_updated

docker run -d --restart=always -p 8080:8080 --privileged -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):$(which docker) -v jenkins_home:/var/jenkins_home -v  /usr/local/bin/docker-compose:/usr/local/bin/docker-compose --user root:root --name jenkins-server4 jenkins/jenkins:lts

install by docker-compose

version: '3.7'
services:
  jenkins:
    image: jenkins/jenkins:lts
    privileged: true
    user: root
    ports:
      - 8080:8080
      - 50000:50000
    container_name: jenkins
    volumes:
      - /jenkins_home:/var/jenkins_home
      - /var/run/docker.sock:/var/run/docker.sock
      - /usr/bin/docker:/usr/bin/docker
      - /usr/local/bin/docker-compose:/usr/local/bin/docker-compose

Hướng dẫn setup jenkins

  • Get key

2022-07-02_185607

  • Tạo new project

2022-07-02_191743

  • Setup repo manager

2022-07-02_191812

  • Setup triger

2022-07-02_191826

  • Pipeline

2022-07-02_192453

2022-07-02_192506

  • End

2022-07-02_192633


Setup webhook github

  • Vào settings -> webhook

Chọn Let me select individual events. Chọn push và pull requests 2022-07-02_192744

2022-07-02_192938

About

Setup jenkins guide

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages