当前位置:   article > 正文

jenkins jenkinsci/blueocean 使用_jenkinsci/blueocean:latest与jenkins/jenkins:latest

jenkinsci/blueocean:latest与jenkins/jenkins:latest

系统

[root@i-vzdytl5t jdk1.8.0_144]# cat /etc/redhat-release 
CentOS Linux release 7.5.1804 (Core) 
  • 1
  • 2

安装docker

yum install docker -y 
systemctl enable docker
systemctl start docker
  • 1
  • 2
  • 3
  • 4

启动 jenkinsci/blueocean

[root@i-vzdytl5t jenkinsblue]# ls -l
total 4
-rwxr-xr-x 1 root root 213 Jun 23 17:20 blue.sh
[root@i-vzdytl5t jenkinsblue]# cat blue.sh 
#!/bin/sh
docker run \
  --rm \
  -u root \
  -p 9999:8080 \
  -v /opt/jenkins-data:/var/jenkins_home \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /opt/jenkinsci/blueocean:/home \
  jenkinsci/blueocean


[root@i-vzdytl5t jenkinsblue]# sh blue.sh 
Unable to find image 'jenkinsci/blueocean:latest' locally
Trying to pull repository docker.io/jenkinsci/blueocean ... 
latest: Pulling from docker.io/jenkinsci/blueocean
ff3a5c916c92: Already exists 
a8906544047d: Pull complete 
ae9db8d675e1: Pull complete 
85fba234e19f: Pull complete 
6afa091c7023: Pull complete 
c6c8a38990e0: Pull complete 
880f546870ba: Pull complete 
b1203e84c055: Pull complete 
51bd360e7147: Pull complete 
987a4c2872a9: Pull complete 
2f35dab8a15d: Pull complete 
53116fdf277c: Pull complete 
...
...

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

271f66e863c74499aee96b5d910f65fc

This may also be found at: /var/jenkins_home/secrets/initialAdminPassword

*************************************************************
*************************************************************
...
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44

271f66e863c74499aee96b5d910f65fc记录下来,用来初始化jenkinsci

ww

111

执行的脚本

node{
    stage('get clone'){
        //check CODE
        echo 'Checkout==========》》》'
                checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://source.enncloud.cn/qinzhao/spring-boot-demo.git']]])
    }

    //定义mvn环境
    def mvnHome = tool 'M3'
    env.PATH = "${mvnHome}/bin:${env.PATH}"

    stage('mvn test'){
        //mvn 测试
        sh "mvn test"
    }

    stage('mvn build'){
        //mvn构建
        sh "mvn clean install -Dmaven.test.skip=true"
    }

    stage('deploy'){
        //执行部署脚本
        sh "ls -l target"
        echo "deploy ......" 
    }
    def dockerfile = 'Dockerfile'
    def customImage = docker.build("10.39.47.22/qinzhao/demo:v1.1", "-f ${dockerfile} .")
    customImage.push()

}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

点击【Open Blue Ocean】按钮
009

添加执行按钮
00

执行完成
99

参考:
build-a-java-app-with-maven

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/169564
推荐阅读
相关标签
  

闽ICP备14008679号