zoukankan      html  css  js  c++  java
  • gitlab-ci 全自动打jar包,生成docker镜像

    image: harbor.javalabs.com.cn/javalabs-tools/commonbase:0.0.1
    
    variables:
      image: 7
      tag: 0.0.1
      mvnrepo: /root/.m2/repository
      groupid: 1 
      grouppath: 2 
      artifactid: 3 
      artifactid_admin: 4 
      version: 5 
      jarname: 6 
      harborurl: harbor.javalabs.com.cn/operation-vems
    
    before_script:
      - ls /usr/local/pythonfolder/
      - cp /usr/local/pythonfolder/readpom.py ./
      - gid_aid_ver=$(python readpom.py)
      - echo $gid_aid_ver
      - IFS=',' arr=($gid_aid_ver) 
      - groupid=${arr[0]}
      - grouppath=${arr[3]}
      - artifactid=${arr[1]}
      - artifactid_admin=$artifactid-admin
      - version=${arr[2]}
      - jarname=$artifactid_admin-$version.jar
      - image=(${artifactid_admin,,})
      - pwd
      - echo $groupid
      - echo $artifactid
      - echo $version
      - echo $grouppath
      
    stages:
      - makepushjar
      - makepushimage
    
    
    make_push_jar:
      stage: makepushjar
      script:
      - echo "----------------------make_push_jar start -----------------------------------------"
      - echo $groupid
      - echo $artifactid
      - echo $version
      - mvn clean install -U -Dmaven.test.skip=true
      - ls
      - mvn deploy:deploy-file -DgroupId=$groupid -DartifactId=$artifactid -Dversion=$version -Dpackaging=jar -Dfile=$mvnrepo/$grouppath/$artifactid_admin/$version/$jarname -Durl=https://nexus.javalabs.com.cn/repository/javalabs-nexus/ -DrepositoryId=javalabs-nexus
      - echo "----------------------make_push_jar end -------------------------------------------"
    
    make_push_image:
      stage: makepushimage
      script:
      - echo "----------------------make_push_image start -----------------------------------------"
      - cp $mvnrepo/$grouppath/$artifactid_admin/$version/$jarname ./$jarname
      - docker build -t $image:$tag --build-arg JARNAME=$artifactid_admin-$version .
      - rm -rf $mvnrepo/$grouppath/$artifactid_admin/$version/
      - rm -rf ./$jarname
      - docker login --username=admin --password=Harbor12345 harbor.javalabs.com.cn
      - docker tag $image:$tag $harborurl/$image:$tag
      - docker push $harborurl/$image:$tag
      - docker images
      - docker ps -a
      - echo "----------------------make_push_image end -------------------------------------------"
  • 相关阅读:
    8.池化内存分配
    7.netty内存管理-ByteBuf
    6.ChannelPipeline
    5.接入客户端连接
    4.Netty执行IO事件和非IO任务
    3.NioEventLoop的启动和执行
    2.NioEventLoop的创建
    1.netty服务端的创建
    微信订阅号开发初探
    jmeter自动化脚本编写
  • 原文地址:https://www.cnblogs.com/chuyuan/p/12197925.html
Copyright © 2011-2022 走看看