其他分享
首页 > 其他分享> > 002-Devops Practice-Jenkins,Maven

002-Devops Practice-Jenkins,Maven

作者:互联网

[root@devops ~]# docker pull jenkins/jenkins:2.361.1-lts
[root@devops ~]# cat devops/jenkins/docker-compose.yaml
version: '3.3'
services:
  jenkins:
    image: jenkins/jenkins:2.361.1-lts
    restart: unless-stopped
    privileged: true
    user: root
    ports:
      - 8080:8080
    container_name: jenkins
    volumes:
      - /root/devops/jenkins:/var/jenkins_home
      - /var/run/docker.sock:/var/run/docker.sock
      - /usr/bin/docker:/usr/bin/docker
[root@devops ~]# cd devops/jenkins/ && docker-compose up -d
[root@devops jenkins]# docker-compose logs
[root@devops ~]# docker exec -it jenkins cat /var/jenkins_home/secrets/initialAdminPassword
104544c40af646a3958275f8c5edef04

After setup complete,then install plugin: Publish Over SSH Git Parameter Kubernetes

[root@devops devops]# wget https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz
[root@devops devops]# tar -zxvf apache-maven-3.8.6-bin.tar.gz && mv apache-maven-3.8.6 maven
[root@devops devops]# vim maven/conf/settings.xml   # appends below settings to xml file
  <mirrors>
    <mirror>
    <id>aliyunmaven</id>
    <mirrorOf>central</mirrorOf>
    <name>aliyun maven</name>
    <url>https://maven.aliyun.com/repository/public </url>
    </mirror>
  </mirrors>
  <profile>
    <id>jdk8</id>
    <activation>
        <activeByDefault>true</activeByDefault>
        <jdk>1.8</jdk>
    </activation>
    <properties>
      <maven.compiler.source>1.8</maven.compiler.source>
      <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
    </properties>
  </profile>
  <activeProfiles>
    <activeProfile>jdk8</activeProfile>
  </activeProfiles>
# we will need maven in jenkins later
[root@devops devops]# wget https://download.oracle.com/otn/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-linux-x64.tar.gz?AuthParam=1662820870_bc2da312076fc5255286e57081c6a475
[root@devops devops]# tar -zxvf jdk-8u202-linux-x64.tar.gz && mv jdk1.8.0_202 jdk8
# We will need jdk in jenkins later as well
[root@devops devops]# mv maven/ jdk8/ jenkins/ # move maven and jdk to jenkins home, jdk and maven can be found from jenkins dashboard

标签:maven,Practice,devops,Maven,002,https,jenkins,docker,root
来源: https://www.cnblogs.com/aboa/p/16683335.html