当前位置: 首页 > news >正文

免费素材网站素材库搜索引擎优化与关键词的关系

免费素材网站素材库,搜索引擎优化与关键词的关系,全国生猪价格,iis7怎么安装php网站什么是Jenkins Jenkins是一个自动化平台,它允许你使用pipelines去部署应用。它也可以自动化其他任务。 BUILDTESTDEPLOYMENT Jenkins 架构 首先,你拥有一个Master Server,它控制pipelines和安排Build到你的Agent上; 其次&…

什么是Jenkins

Jenkins是一个自动化平台,它允许你使用pipelines去部署应用。它也可以自动化其他任务。

  • BUILD
  • TEST
  • DEPLOYMENT

Jenkins 架构

首先,你拥有一个Master Server,它控制pipelines和安排Build到你的Agent上;
其次,你有Agents,能够运行在Build在它们的工作台上。

构建(Build)类型

Freestyle Build

  • 创建一个Build最简单的方法
  • 感觉就像Shell脚本一样

Pipelines

  • 使用Jenkins files
  • 使用 satge 分解构建的组件

安装Jenkins

这里使用Docker进行安装,也可以使用其他方式安装
https://www.jenkins.io/download/

$ docker pull jenkins/jenkins
$ docker run -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home --name jenkins-master --network jenkins jenkins/jenkins

访问http://localhost:8080/ 进入容器复制密码并粘贴
image.png
安装推荐的插件,创建管理员用户
image.png
配置
image.png

创建一个简单的Freestyle Job

  • 点击新建Item

image.png

  • 选择FreeStyle,点击创建image.png

  • 简单编写shellimage.png

  • 在这里能看到构建历史image.png

  • 点击某个构建历史,查看控制台输出,发现我们编写的shell命令已经执行了image.png

  • 点击配置修改,点击查看环境变量列表image.png

  • 去使用Jenkins环境变量,填写在Build Steps处

echo "Hello world"
echo "The build ID of this job is ${BUILD_ID}"
echo "The build URL of this job is ${BUILD_URL}"
  • 点击立即构建,查看控制台输出image.png
  • 重新更新shell script在Build Steps处
echo "Hello world"
echo "The build ID of this job is ${BUILD_ID}"
echo "The build URL of this job is ${BUILD_URL}"ls -ltr
echo "Jenkins" > test.txt
ls -ltr
  • 保存并构建,查看控制台输出,你可以看到一开始没有文件,之后出现了文件

image.png

  • 点击工作空间,你可以看到文件image.png

  • 再次构建一次,查看控制台输出,我们可以看到之前的文件依旧存在image.png

  • 如果我们需要每次构建去清除工作空间,配置勾选此选项image.png

  • 再此查看控制台输出,我们发现之前的文件已经不存在,重新生成了新的文件image.png

探索Jenkins文件系统和工作空间

#进入容器
$ docker exec -it jenkins-master bashjenkins@9fbb1603c9e7:/$ cd /var/jenkins_home/
jenkins@9fbb1603c9e7:~$ ls -ltra
total 128
drwxr-xr-x  1 root    root     4096 Dec 19 15:06 ..
drwxr-xr-x 10 jenkins jenkins  4096 Dec 24 03:08 war
drwxr-xr-x  3 jenkins jenkins  4096 Dec 24 03:08 .cache
drwxr-xr-x  3 jenkins jenkins  4096 Dec 24 03:08 .java
-rw-r--r--  1 jenkins jenkins    64 Dec 24 03:08 secret.key
-rw-r--r--  1 jenkins jenkins     0 Dec 24 03:08 secret.key.not-so-secret
drwxr-xr-x  2 jenkins jenkins  4096 Dec 24 03:08 nodes
-rw-r--r--  1 jenkins jenkins   171 Dec 24 03:08 jenkins.telemetry.Correlator.xml
drwxr-xr-x  2 jenkins jenkins  4096 Dec 24 03:08 userContent
-rw-r--r--  1 jenkins jenkins   129 Dec 24 03:08 queue.xml.bak
-rw-r--r--  1 jenkins jenkins   100 Dec 24 03:14 copy_reference_file.log
-rw-r--r--  1 jenkins jenkins   156 Dec 24 03:14 hudson.model.UpdateCenter.xml
-rw-r--r--  1 jenkins jenkins  1037 Dec 24 03:14 nodeMonitors.xml
-rw-r--r--  1 jenkins jenkins  1661 Dec 24 03:14 config.xml
-rw-r--r--  1 jenkins jenkins     0 Dec 24 03:14 .lastStarted
drwxr-xr-x 87 jenkins jenkins 12288 Dec 24 03:22 plugins
-rw-------  1 jenkins jenkins  1680 Dec 24 03:22 identity.key.enc
drwxr-xr-x  2 jenkins jenkins  4096 Dec 24 03:22 updates
-rw-r--r--  1 jenkins jenkins   370 Dec 24 03:22 hudson.plugins.git.GitTool.xml
drwxr-xr-x  3 jenkins jenkins  4096 Dec 24 03:22 .groovy
drwxr-xr-x  3 jenkins jenkins  4096 Dec 24 03:24 users
-rw-r--r--  1 jenkins jenkins   179 Dec 24 03:24 jenkins.model.JenkinsLocationConfiguration.xml
-rw-r--r--  1 jenkins jenkins     5 Dec 24 03:24 jenkins.install.UpgradeWizard.state
-rw-r--r--  1 jenkins jenkins     5 Dec 24 03:24 jenkins.install.InstallUtil.lastExecVersion
-rw-r--r--  1 jenkins jenkins     1 Dec 24 03:41 .owner
drwxr-xr-x  3 jenkins jenkins  4096 Dec 24 03:48 jobs
drwx------  2 jenkins jenkins  4096 Dec 24 03:55 secrets
drwxr-xr-x  3 jenkins jenkins  4096 Dec 24 04:21 logs
-rw-r--r--  1 jenkins jenkins   504 Dec 24 04:24 org.jenkinsci.plugins.resourcedisposer.AsyncResourceDisposer.xml
drwxr-xr-x  3 jenkins jenkins  4096 Dec 24 04:24 workspace
-rw-r--r--  1 jenkins jenkins   129 Dec 24 04:25 queue.xml
drwxr-xr-x 15 jenkins jenkins  4096 Dec 24 04:25 .
  • 进入/var/jenkins_home/workspace,可以看到我们的Job Name
jenkins@9fbb1603c9e7:~$ cd workspace/
jenkins@9fbb1603c9e7:~/workspace$ ls -ltra
total 12
drwxr-xr-x  2 jenkins jenkins 4096 Dec 24 04:24 my_first_job
drwxr-xr-x  3 jenkins jenkins 4096 Dec 24 04:24 .
drwxr-xr-x 15 jenkins jenkins 4096 Dec 24 04:25 ..
  • 进入我们创建的Job目录下
jenkins@9fbb1603c9e7:~/workspace$ cd my_first_job/
jenkins@9fbb1603c9e7:~/workspace/my_first_job$ ls -ltra
total 12
-rw-r--r-- 1 jenkins jenkins    8 Dec 24 04:24 test.txt
drwxr-xr-x 3 jenkins jenkins 4096 Dec 24 04:24 ..
drwxr-xr-x 2 jenkins jenkins 4096 Dec 24 04:24 .
jenkins@9fbb1603c9e7:~/workspace/my_first_job$ cat test.txt
Jenkins

使用Jenkins运行Python脚本

  • 新建一个Jobimage.png
  • 添加Git仓库位置https://github.com/devopsjourney1/jenkins-101image.png
  • 编写Shell Script在Build Stepsimage.png
  • 点击构建查看控制台输出,发现进行拉取Git仓库执行helloworld.py文件image.png

helloworld.py

print("Hello world")

设置Docker Cloud Agent

image.png
image.png

  • 点击cloudsimage.png
  • 安装插件image.png
  • 你可以在这里添加你需要的云节点(如Docker ,AWS,k8s)image.png

设置Commit触发

  • 在Job的此位置设置,这样类似于设置一个Crontab去检测Git仓库最后一次的commit提交,然后执行自动化

image.png

  • H/5 * * * * 每5分钟去进行一次检测

Pipelines

  • 创建一个任务,选择Pipeline(选择流水线)image.png
  • 向下拉取,你需要添加pipeline脚本在这里image.png

pipeline文件格式

pipeline {  #所有命令包裹着pipeline里agent { node { #通过标签选择agentlabel 'jenkins-agent-goes-here'}}triggers { #触发器pollSCM '* * * * *'}  stages {  #stages->stage->stepsstage('Build') {steps {echo "Building.."sh '''echo "doing build stuff.."'''}}stage('Test') {steps {echo "Testing.."sh '''echo "doing test stuff..'''}}stage('Deliver') {steps {echo 'Deliver....'sh '''echo "doing delivery stuff.."'''}}}
}
  • 将这段pipeline脚本填入,并保存构建
pipeline {agent any   #选择任意一个可用的节点当作agent 这里使用的为本机stages {stage('Build') {steps {echo "构建中.."}}stage('Test') {steps {echo "测试中.."}}stage('Deploy') {steps {echo '部署中..'}}}
}

image.png

  • 查看控制台输出image.png

文章转载自:
http://greet.xnLj.cn
http://coryneform.xnLj.cn
http://headrest.xnLj.cn
http://mauley.xnLj.cn
http://sententiously.xnLj.cn
http://sapajou.xnLj.cn
http://ecoclimate.xnLj.cn
http://lashing.xnLj.cn
http://gls.xnLj.cn
http://confirmedly.xnLj.cn
http://proteinase.xnLj.cn
http://swellish.xnLj.cn
http://purism.xnLj.cn
http://deucalion.xnLj.cn
http://token.xnLj.cn
http://outstink.xnLj.cn
http://plaga.xnLj.cn
http://nonparticipating.xnLj.cn
http://margravate.xnLj.cn
http://toll.xnLj.cn
http://cockateel.xnLj.cn
http://escadrille.xnLj.cn
http://heteroclitical.xnLj.cn
http://socket.xnLj.cn
http://pneumonolysis.xnLj.cn
http://trikini.xnLj.cn
http://rompingly.xnLj.cn
http://iyar.xnLj.cn
http://saccharometer.xnLj.cn
http://voyeur.xnLj.cn
http://presentive.xnLj.cn
http://laudable.xnLj.cn
http://molossus.xnLj.cn
http://entoutcas.xnLj.cn
http://putrefacient.xnLj.cn
http://saker.xnLj.cn
http://xenophile.xnLj.cn
http://limicole.xnLj.cn
http://knot.xnLj.cn
http://utmost.xnLj.cn
http://epistaxis.xnLj.cn
http://agoing.xnLj.cn
http://dustband.xnLj.cn
http://abominable.xnLj.cn
http://cokuloris.xnLj.cn
http://autonomist.xnLj.cn
http://humbling.xnLj.cn
http://sinitic.xnLj.cn
http://feod.xnLj.cn
http://capricornus.xnLj.cn
http://foldout.xnLj.cn
http://dysphasic.xnLj.cn
http://trangam.xnLj.cn
http://slakeless.xnLj.cn
http://pagurian.xnLj.cn
http://bluppy.xnLj.cn
http://thanatophobia.xnLj.cn
http://wooded.xnLj.cn
http://somatological.xnLj.cn
http://fractal.xnLj.cn
http://acutely.xnLj.cn
http://interpolative.xnLj.cn
http://nhs.xnLj.cn
http://mislabel.xnLj.cn
http://sylvester.xnLj.cn
http://microtome.xnLj.cn
http://anbury.xnLj.cn
http://reproduceable.xnLj.cn
http://wold.xnLj.cn
http://fascination.xnLj.cn
http://acta.xnLj.cn
http://thermochemistry.xnLj.cn
http://trayful.xnLj.cn
http://sitrep.xnLj.cn
http://pa.xnLj.cn
http://latona.xnLj.cn
http://forecourt.xnLj.cn
http://guianan.xnLj.cn
http://recruiter.xnLj.cn
http://humiliatory.xnLj.cn
http://ginner.xnLj.cn
http://cytogamy.xnLj.cn
http://ampliative.xnLj.cn
http://modernism.xnLj.cn
http://cembalist.xnLj.cn
http://integrate.xnLj.cn
http://vesicant.xnLj.cn
http://reelection.xnLj.cn
http://taxonomy.xnLj.cn
http://sennet.xnLj.cn
http://doodlebug.xnLj.cn
http://refusal.xnLj.cn
http://portal.xnLj.cn
http://ironmould.xnLj.cn
http://commonly.xnLj.cn
http://glutenous.xnLj.cn
http://napped.xnLj.cn
http://warner.xnLj.cn
http://protoplanet.xnLj.cn
http://merton.xnLj.cn
http://www.15wanjia.com/news/96840.html

相关文章:

  • 精品建站一键seo提交收录
  • wordpress漏洞视频seo网站优化推广
  • tag做的最好的网站中国今天刚刚发生的新闻
  • 林业门户网站建设他达拉非片和伟哥区别
  • 找人做网站注意百度在线
  • 阿里云做网站选择服务器东莞网站推广策划
  • 网页4399小游戏西安网络优化哪家好
  • 中投中原建设有限公司网站搜索引擎优化面对哪些困境
  • 上海高端建设网站以图搜图百度识图
  • 房地产行业发展前景分析seo优化网站教程百度
  • 网站备案 子域名整站优化价格
  • 毕业设计旅游网站开发杭州疫情最新消息
  • 电影资源网站怎么做的seo网站优化专员
  • 衡水网站建费用软件推广赚佣金渠道
  • 国内简约网站设计网络营销的四种方式
  • 网站制作网址百度seo流量
  • 大型网站建设 cms cdm dmp网络营销网站建设案例
  • 桑基图在线制作网站中国营销型网站有哪些
  • 咸宁网站建设哪家好如何免费开自己的网站
  • php网站开发步骤郑州网络营销推广
  • 不花钱网站怎么做推广网络整合营销公司
  • wordpress明星主题百度seo推广
  • 怎样申请网站空间无锡网站排名公司
  • 建站模板 discuz加强网络暴力治理
  • 宜春网站开发公司seo营销推广
  • 设计咨询服务合同seo优化方式
  • 北京国贸网站建设公司搜索引擎优化seo优惠
  • SEO案例网站建设厦门人才网官方网站
  • 小程序app软件定制开发重庆seo关键词排名
  • 郑州汉狮做网站的公司百度手机seo