In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the relevant knowledge of "what are the Jenkins configurations". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
First of all, these configurations are only for reference value, but we still need to do so according to our own situation.
For the backend, the configuration file mainly needs to be performed after the build (# followed by comments)
#! / bin/sh tomcat_path=/usr/local/tomcats/tomcat-test # define the location of the tomcat project_web=$tomcat_path/test.war # define the project packaging location if [- f $project_web] Then echo-- stop tomcat # kill tomcat pid pidlist= `ps-ef | grep tomcat-test | grep-v grep | awk'{print $2}'`# check to see if there is a process running if ["$pidlist" = ""] # No process is running, prompt then echo "no tomcat pid alive!" Else # has a process running. Kill echo "tomcat Id list: $pidlist" kill-9$ pidlist echo "KILL $pidlist:" echo "tomcat stop success" fi echo-- redeploy if after deploying $project_web # to kill the process [- f $tomcat_path/webapps/test.war] Then # check to see if there are previous war packages in the / webapps directory, and if so Delete rm-f $tomcat_path/webapps/test.war rm-rf $tomcat_path/webapps/test echo-deleting $project_web fi cp $project_web $tomcat_path/webapps/test.war # copy the newly generated war package to the / webapps directory # start tomcat echo $tomcat_path # sleep 5 export JAVA_HOME=/usr/java/latest # $tomcat_path/ Bin/startup.sh ${tomcat_path} / bin/startup.sh else echo $BUILD_ID-$project_web fi not found
For the front end, you mainly need to pay attention to the unique packaging methods of the front end:
Npm install-- unsafe-perm ng build-- prod-- env=test-- output-path=typing-dev-- base-href.
For k8s, you need to create events at build time:
#! / bin/sh-l examimage_path=reg.afen.com/library/test:1.0.0 # defines the location of the image on the harbor cp test-web/target/test-web.war test-web/src/profiles/k8s_prod/test-web.war # copy war to the target directory cd test-web/src/profiles/k8s_prod # enter the target directory docker build-t $examimage_path. # start creating a new image, note that there is a "." after that, otherwise the command will not take effect: docker push $examimage_path # push the built image to harbor to echo 'push the image to harbor' # delete the local image docker rmi-f $examimage_path # after the push is successful, delete the local image # K8s deploy echo' start deployment 'kubectl delete-f $WORKSPACE/test-web/src/profiles/k8s_prod/. # delete all local echo $WORKSPACE kubectl create-f $WORKSPACE/test-web/src/profiles/k8s_prod/. # this is the end of the latest deployment of "what are the Jenkins configurations"? thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.