个人练习之-jenkins

时间:2024-04-15 07:23:14

虚拟机环境搭建(买不起服务器 like me)

重点:
0 虚拟机防火墙关闭
systemctl stop firewalld.service
systemctl disable firewalld.service

1 (centos7.6)网络配置 (vmware 编辑 -> 虚拟网络编辑器 -> 选择NAT模式 ->NAT设置查看网关)

	vim /etc/sysconfig/network-scripts/ifcfg-en33

	BOOTPROTO: static
	IPADDR:IP地址(前三段要和网关地址前三段一致)
	GATEWAY:网关(使用查看到的网关即可)
	NETMASK:子网掩码(固定的 255.255.255.0)
	ONBOOT:开机启动网络,设置为yes

2 gitlab docker 安装 docker-compose

version: '3.1'
services:
  gitlab: 
    image: 'gitlab/gitlab-ce:latest'
    container_name: gitlab
    restart: always
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://虚拟机的ip:8929'
        gitlab_rails['gitlab_shell_ssh_port'] = 2224
    ports:
      - '8929:8929'
      - '2224:2224'
    volumes:
      - './config:/etc/gitlab'
      - './log:/var/log/gitlab'
      - './data:/var/opt/gitlab'

3 jenkins docker 安装 docker-compose

version: '3.1'
services:
  jenkins: 
    image: 'jenkins/jenkins:2.319.1-lts'
    container_name: jenkins
    ports:
      - 8080:8080
      - 50000:50000
    volumes:
      - './data:/var/jenkins_home/'