中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁(yè) > news >正文

上海找做網(wǎng)站公司哪家好google google

上海找做網(wǎng)站公司哪家好,google google,個(gè)人網(wǎng)站 如何做推廣,舒城做網(wǎng)站1.告訴目標(biāo)服務(wù)器拉取哪個(gè)鏡像 2.判斷當(dāng)前有沒(méi)有正在運(yùn)行此容器,有就刪除 3.接著查看拉取的鏡像目標(biāo)服務(wù)器上是否已存在,有就刪除 4.拉取Harbor鏡像 5.運(yùn)行容器 目標(biāo)服務(wù)器編寫(xiě)腳本 創(chuàng)建個(gè)部署腳本 vim deploy.sh告訴目標(biāo)服務(wù)器Harbor地址、倉(cāng)庫(kù)、鏡像…

1.告訴目標(biāo)服務(wù)器拉取哪個(gè)鏡像

2.判斷當(dāng)前有沒(méi)有正在運(yùn)行此容器,有就刪除

3.接著查看拉取的鏡像目標(biāo)服務(wù)器上是否已存在,有就刪除

4.拉取Harbor鏡像

5.運(yùn)行容器

目標(biāo)服務(wù)器編寫(xiě)腳本

創(chuàng)建個(gè)部署腳本

vim deploy.sh

告訴目標(biāo)服務(wù)器Harbor地址、倉(cāng)庫(kù)、鏡像、版本號(hào)、端口信息

#第一個(gè)參數(shù),倉(cāng)庫(kù)地址
harbor_addr=$1
#第二個(gè)參數(shù),倉(cāng)庫(kù)名
harbor_warehouse=$2
#第三個(gè)參數(shù),鏡像名
harbor_image=$3
#第四個(gè)參數(shù),鏡像版本號(hào)
image_version=$4
#第五個(gè)參數(shù),宿主機(jī)端口號(hào)
host_port=$5
#第六個(gè)參數(shù),容器端口號(hào)
container_port=$6#1.將參數(shù)都拼接起來(lái),告知服務(wù)器要拉取的鏡像
imageName=$harbor_addr/$harbor_warehouse/$harbor_image:$image_version#2.判斷當(dāng)前有沒(méi)有正在運(yùn)行此容器,有就刪除
#獲取當(dāng)前容器的ID
containerId=`docker ps -a | grep ${harbor_image} | awk '{print $1}'`
#判斷容器是否存在
if [ "$containerId" != "" ] ; then
docker stop $containerId
docker rm $containerId
fi#3.接著查看拉取的鏡像目標(biāo)服務(wù)器上是否已存在,有就刪除
images=`docker images | grep ${harbor_image} | awk '{print $2}'`
#判斷語(yǔ)句,包含我要拉取的鏡像就執(zhí)行刪除動(dòng)作
if [[ "$images" =~ $image_version ]] ; then
docker rmi $images
fi#4.拉取Harbor鏡像
#登錄Harbor
docker login -u admin -p Harbor12345 $harbor_addr:80/$harbor_warehouse/$harbor_image:$image_version
#拉取鏡像
docker pull $imageName
#運(yùn)行容器
docker run -d --name $harbor_image -p $host_port:$container_port $imageName

添加權(quán)限,讓所有用戶(hù)可執(zhí)行腳本

chmod a+x deploy.sh

將deploy腳本移到bin目錄下,讓其在任何位置都能直接使用

mv deploy.sh /usr/bin/

修改Jenkins任務(wù)

在鏡像推送到Harbor倉(cāng)庫(kù)步驟的下面,再添加一個(gè)構(gòu)建后操作

在這里插入圖片描述
選擇目標(biāo)服務(wù)器,添加執(zhí)行腳本和參數(shù)命令

deploy.sh 192.168.170.111:80 monster ${JOB_NAME} $version $host_port $container_port

直接deploy.sh,目標(biāo)服務(wù)器放在bin目錄下可以直接運(yùn)行

緊跟著Harbor地址,Monster倉(cāng)庫(kù)

JOB_NAME就是當(dāng)前Jenkins任務(wù)的名稱(chēng)mytest

version就是獲取上面拉取的Gitlab標(biāo)簽版本號(hào)

在這里插入圖片描述
host_port、container_port兩個(gè)參數(shù)現(xiàn)在是獲取不到的

所以需要再添加兩個(gè)參數(shù),在上面的參數(shù)化構(gòu)建添加字符參數(shù)

在這里插入圖片描述
一個(gè)宿主機(jī)端口host_port,默認(rèn)值8081

一個(gè)容器端口container_port,默認(rèn)值8080

在這里插入圖片描述

構(gòu)建驗(yàn)證

開(kāi)始構(gòu)建,界面可以看見(jiàn)多了兩個(gè)默認(rèn)值的參數(shù)

在這里插入圖片描述

Started by user 我是真滴帥
Running as SYSTEM
Building in workspace /var/jenkins_home/workspace/mytest
The recommended git tool is: NONE
No credentials specified> git rev-parse --resolve-git-dir /var/jenkins_home/workspace/mytest/.git # timeout=10
Fetching changes from the remote Git repository> git config remote.origin.url http://192.168.170.111:8888/root/jenkins-cicd-mytest.git # timeout=10
Fetching upstream changes from http://192.168.170.111:8888/root/jenkins-cicd-mytest.git> git --version # timeout=10> git --version # 'git version 2.30.2'> git fetch --tags --force --progress -- http://192.168.170.111:8888/root/jenkins-cicd-mytest.git +refs/heads/*:refs/remotes/origin/* # timeout=10> git rev-parse refs/remotes/origin/main^{commit} # timeout=10
Checking out Revision b92e927c41d08ab99a8ac8a462535deadc68c972 (refs/remotes/origin/main)> git config core.sparsecheckout # timeout=10> git checkout -f b92e927c41d08ab99a8ac8a462535deadc68c972 # timeout=10
Commit message: "刪除docker-compose.yml,修改頁(yè)面內(nèi)容"> git rev-list --no-walk b92e927c41d08ab99a8ac8a462535deadc68c972 # timeout=10
[mytest] $ /bin/sh -xe /tmp/jenkins13710554383855071698.sh
+ git checkout v1.0.2
HEAD is now at b92e927 刪除docker-compose.yml,修改頁(yè)面內(nèi)容
[mytest] $ /var/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/maven/bin/mvn clean package -DskipTests
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------------< com.monster:mytest >-------------------------
[INFO] Building mytest 0.0.1-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] Parameter 'archive' is unknown for plugin 'spring-boot-maven-plugin:2.6.13:repackage (repackage)'
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ mytest ---
[INFO] Deleting /var/jenkins_home/workspace/mytest/target
[INFO] 
[INFO] --- resources:3.3.1:resources (default-resources) @ mytest ---
[INFO] Copying 2 resources from src/main/resources to target/classes
[INFO] 
[INFO] --- compiler:3.8.1:compile (default-compile) @ mytest ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to /var/jenkins_home/workspace/mytest/target/classes
[INFO] 
[INFO] --- resources:3.3.1:testResources (default-testResources) @ mytest ---
[INFO] skip non existing resourceDirectory /var/jenkins_home/workspace/mytest/src/test/resources
[INFO] 
[INFO] --- compiler:3.8.1:testCompile (default-testCompile) @ mytest ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /var/jenkins_home/workspace/mytest/target/test-classes
[INFO] 
[INFO] --- surefire:3.2.2:test (default-test) @ mytest ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- jar:3.3.0:jar (default-jar) @ mytest ---
[INFO] Building jar: /var/jenkins_home/workspace/mytest/target/mytest.jar
[INFO] 
[INFO] --- spring-boot:2.6.13:repackage (repackage) @ mytest ---
[INFO] Replacing main artifact with repackaged archive
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.677 s
[INFO] Finished at: 2024-03-16T17:27:43Z
[INFO] ------------------------------------------------------------------------
[mytest] $ /var/jenkins_home/sonar-scanner/bin/sonar-scanner -Dsonar.host.url=http://192.168.170.111:9000 ******** -Dsonar.projectKey=mytest -Dsonar.projectname=mytest -Dsonar.java.binaries=target -Dsonar.source=./ -Dsonar.projectBaseDir=/var/jenkins_home/workspace/mytest
INFO: Scanner configuration file: /var/jenkins_home/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 5.0.1.3006
INFO: Java 17.0.7 Eclipse Adoptium (64-bit)
INFO: Linux 3.10.0-1160.el7.x86_64 amd64
INFO: User cache: /var/jenkins_home/.sonar/cache
INFO: Analyzing on SonarQube server 9.2.3
INFO: Default locale: "en", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=614ms
INFO: Server id: 54000601-AYjKh1Zs1hD1Rss9XdjF
INFO: User cache: /var/jenkins_home/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=218ms
INFO: Plugin [l10nzh] defines 'l10nen' as base plugin. This metadata can be removed from manifest of l10n plugins since version 5.2.
INFO: Load/download plugins (done) | time=297ms
INFO: Process project properties
INFO: Process project properties (done) | time=1ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=1ms
INFO: Project key: mytest
INFO: Base dir: /var/jenkins_home/workspace/mytest
INFO: Working dir: /var/jenkins_home/workspace/mytest/.scannerwork
INFO: Load project settings for component key: 'mytest'
INFO: Load project settings for component key: 'mytest' (done) | time=191ms
INFO: Load project branches
INFO: Load project branches (done) | time=253ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=26ms
INFO: Load branch configuration
INFO: Load branch configuration (done) | time=1ms
INFO: Auto-configuring with CI 'Jenkins'
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=600ms
INFO: Auto-configuring with CI 'Jenkins'
INFO: Load active rules
INFO: Load active rules (done) | time=2826ms
INFO: Indexing files...
INFO: Project configuration:
INFO: 10 files indexed
INFO: 14 files ignored because of scm ignore settings
INFO: Quality profile for java: Easyspeed
INFO: Quality profile for web: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: ------------- Run sensors on module mytest
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=111ms
INFO: Sensor JavaSensor [java]
INFO: Configured Java source version (sonar.java.source): none
INFO: JavaClasspath initialization
INFO: JavaClasspath initialization (done) | time=7ms
INFO: JavaTestClasspath initialization
INFO: JavaTestClasspath initialization (done) | time=0ms
INFO: Java "Main" source files AST scan
INFO: 5 source files to be analyzed
INFO: Load project repositories
INFO: Load project repositories (done) | time=225ms
INFO: 5/5 source files have been analyzed
WARN: Dependencies/libraries were not provided for analysis of SOURCE files. The 'sonar.java.libraries' property is empty. Verify your configuration, as you might end up with less precise results.
WARN: Unresolved imports/types have been detected during analysis. Enable DEBUG mode to see them.
INFO: Java "Main" source files AST scan (done) | time=1189ms
INFO: No "Test" source files to scan.
INFO: No "Generated" source files to scan.
INFO: Sensor JavaSensor [java] (done) | time=1406ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=2ms
INFO: Sensor CSS Rules [javascript]
WARN: Error when running: 'node -v'. Is Node.js available during analysis?
INFO: Sensor CSS Rules [javascript] (done) | time=1721ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=16ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor SurefireSensor [java]
INFO: parsing [/var/jenkins_home/workspace/mytest/target/surefire-reports]
INFO: Sensor SurefireSensor [java] (done) | time=2ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=50ms
INFO: Sensor XML Sensor [xml]
INFO: 1 source file to be analyzed
INFO: 1/1 source file has been analyzed
INFO: Sensor XML Sensor [xml] (done) | time=179ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=1ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=12ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
INFO: Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerPullRequestPropertySensor
INFO: Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerPullRequestPropertySensor (done) | time=0ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=7ms
INFO: Sensor Java CPD Block Indexer
INFO: Sensor Java CPD Block Indexer (done) | time=22ms
INFO: CPD Executor 3 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 3 files
INFO: CPD Executor CPD calculation finished (done) | time=6ms
INFO: Load New Code definition
INFO: Load New Code definition (done) | time=22ms
INFO: Analysis report generated in 88ms, dir size=101.0 kB
INFO: Analysis report compressed in 25ms, zip size=24.7 kB
INFO: Analysis report uploaded in 55ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://ci.hkeasyspeed.com/dashboard?id=mytest
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://ci.hkeasyspeed.com/api/ce/task?id=AY5IRf2h3PsONgf4Xut0
INFO: Analysis total time: 9.763 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 11.504s
INFO: Final Memory: 18M/67M
INFO: ------------------------------------------------------------------------
[mytest] $ /bin/sh -xe /tmp/jenkins15276106874998699608.sh
+ mv target/mytest.jar docker
+ docker build -t mytest:v1.0.2 docker/
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.Install the buildx component to build images with BuildKit:https://docs.docker.com/go/buildx/Sending build context to Docker daemon  17.57MBStep 1/4 : FROM daocloud.io/library/java:8u40-jdk---> 4aefdb29fd43
Step 2/4 : COPY mytest.jar /usr/local/---> ee2b2d803137
Step 3/4 : WORKDIR /usr/local---> Running in 174dacdeaca1---> Removed intermediate container 174dacdeaca1---> 8759ed1a2fd5
Step 4/4 : CMD java -jar mytest.jar---> Running in 735d3d6093e4---> Removed intermediate container 735d3d6093e4---> 7180e79a6982
Successfully built 7180e79a6982
Successfully tagged mytest:v1.0.2
+ docker login -u admin -p Harbor12345 192.168.170.111:80
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /var/jenkins_home/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-storeLogin Succeeded
+ docker tag mytest:v1.0.2 192.168.170.111:80/monster/mytest:v1.0.2
+ docker push 192.168.170.111:80/monster/mytest:v1.0.2
The push refers to repository [192.168.170.111:80/monster/mytest]
b4d16baca513: Preparing
50ecdabc71b7: Preparing
3e9cda2eceec: Preparing
5f70bf18a086: Preparing
5f70bf18a086: Preparing
5f70bf18a086: Preparing
bb7b60f93aea: Preparing
0ef3d186e2bd: Preparing
1e0931f30489: Preparing
5f70bf18a086: Preparing
fd97e4a10f39: Preparing
5f70bf18a086: Preparing
0ef3d186e2bd: Waiting
1e0931f30489: Waiting
fd97e4a10f39: Waiting
3e9cda2eceec: Layer already exists
bb7b60f93aea: Layer already exists
5f70bf18a086: Layer already exists
50ecdabc71b7: Layer already exists
fd97e4a10f39: Layer already exists
0ef3d186e2bd: Layer already exists
1e0931f30489: Layer already exists
b4d16baca513: Pushed
v1.0.2: digest: sha256:bdcbb6cfc266ddb11da8c16f021ecb90785546a8300582dff7c5969d044f0882 size: 2828
SSH: Connecting from host [1dc2bb3ce84f]
SSH: Connecting with configuration [應(yīng)用服務(wù)器-170.111] ...
SSH: EXEC: completed after 13,608 ms
SSH: Disconnecting configuration [應(yīng)用服務(wù)器-170.111] ...
SSH: Transferred 0 file(s)
Build step 'Send files or execute commands over SSH' changed build result to SUCCESS
Finished: SUCCESS

在這里插入圖片描述

http://www.risenshineclean.com/news/53651.html

相關(guān)文章:

  • 重慶網(wǎng)站聯(lián)盟鄭州競(jìng)價(jià)代運(yùn)營(yíng)公司
  • 國(guó)外最大的設(shè)計(jì)網(wǎng)站有哪些方面seo外鏈網(wǎng)
  • 《商務(wù)網(wǎng)站開(kāi)發(fā)》 實(shí)訓(xùn)報(bào)告書(shū)網(wǎng)絡(luò)營(yíng)銷(xiāo)的主要傳播渠道是
  • 珠海做網(wǎng)站方案熱搜榜上2023年熱門(mén)話(huà)題
  • 深圳寶安網(wǎng)站建設(shè)廣告公司推廣軟文
  • 專(zhuān)業(yè)網(wǎng)站定制設(shè)計(jì)公司網(wǎng)絡(luò)營(yíng)銷(xiāo)過(guò)程步驟
  • 淘客怎么建網(wǎng)站做推廣seo程序
  • 無(wú)錫網(wǎng)站建設(shè)技術(shù)搜索引擎營(yíng)銷(xiāo)分類(lèi)
  • 成都個(gè)人學(xué)做網(wǎng)站如何推廣小程序平臺(tái)
  • 海淀做網(wǎng)站好的公司google免費(fèi)入口
  • 自己如何做團(tuán)購(gòu)網(wǎng)站信息流廣告素材網(wǎng)站
  • 網(wǎng)站制作服務(wù)合同寧波seo整站優(yōu)化軟件
  • wordpress做論壇網(wǎng)站全域seo
  • 有經(jīng)驗(yàn)的順德網(wǎng)站建設(shè)成人職業(yè)技能培訓(xùn)班
  • 大網(wǎng)站制作公司成都培訓(xùn)機(jī)構(gòu)排名前十
  • 萊蕪網(wǎng)站建設(shè)電話(huà)長(zhǎng)沙網(wǎng)站制作策劃
  • 貴州省住房和城鄉(xiāng)建設(shè)廳網(wǎng)站官網(wǎng)企業(yè)文化
  • 南通做外貿(mào)的公司網(wǎng)站seo怎么弄
  • 介紹好的電影網(wǎng)站模板下載優(yōu)化排名seo
  • 做網(wǎng)站換服務(wù)器怎么整免費(fèi)個(gè)人主頁(yè)網(wǎng)站
  • 北京國(guó)互網(wǎng)網(wǎng)站建設(shè)電話(huà)標(biāo)題seo是什么意思
  • 山東今天新冠疫情最新消息新鄉(xiāng)seo網(wǎng)絡(luò)推廣費(fèi)用
  • 推廣網(wǎng)站的軟件網(wǎng)頁(yè)查詢(xún)
  • 杭州的網(wǎng)站建設(shè)公司有哪些百度搜索熱度指數(shù)
  • 響應(yīng)式網(wǎng)站開(kāi)發(fā)步驟商鋪營(yíng)銷(xiāo)推廣方案
  • 公司做網(wǎng)站費(fèi)用外貿(mào)網(wǎng)站建站和推廣
  • 什么是網(wǎng)站微商城的建設(shè)seo建站教學(xué)
  • 騰訊官方網(wǎng)站網(wǎng)絡(luò)營(yíng)銷(xiāo)成功案例
  • 北京旅游設(shè)計(jì)網(wǎng)站建設(shè)網(wǎng)站優(yōu)化推廣seo公司
  • 商城手機(jī)網(wǎng)站制作口碑營(yíng)銷(xiāo)有哪些