下周哪家网站制作公司将负责企业网站的制作?
摘要:企业网站下周,网站制作公司承担,学信网登录,wordpress olve在Jenkins 中先创建一个任务名称 然后进行下一步,放一个项目 填写一些参数 参数1:参数2&a
企业网站下周,网站制作公司承担,学信网登录,wordpress olve在Jenkins 中先创建一个任务名称 然后进行下一步#xff0c;放一个项目
填写一些参数 参数1#xff1a; 参数2#xff1a; 参数3#xff1a;参数4#xff1a; 点击保存就行了
配置脚本
// git
def git_url http://gitlab.xxxx.git
def git_auth_id GITEE_RIVER…在Jenkins 中先创建一个任务名称 然后进行下一步放一个项目
填写一些参数 参数1 参数2 参数3参数4 点击保存就行了
配置脚本
// git
def git_url http://gitlab.xxxx.git
def git_auth_id GITEE_RIVERBIED// harbor
def harbor_host 10.0.165.17:5000
def harbor_project test
def harbor_crt_id HARBOR_CRT_ID// k8s shf
def k8s_crt_id KUBE_CONFIG_FILE_ID
def k8s_namespace test-web// common
def api_name test-web
def docker_file_path
def docker_image ${harbor_host}/${harbor_project}/${api_name}:${SERVICE_VERSION}-${ENVIRONMENT.toLowerCase()}
def service_node_port
def current_timespan System.currentTimeMillis().toString()pipeline {agent anytools {nodejs nodejs14.15.1}stages {stage(参数初始化代码拉取) {steps {script {api_name test-webdocker_file_path Dockerfiledocker_image ${harbor_host}/${harbor_project}/${api_name}-${ENVIRONMENT.toLowerCase()}:${SERVICE_VERSION}_${current_timespan}service_node_port 30992}dir(${ENVIRONMENT.toLowerCase()}) {// 如果是公开仓库可以直接使用 git url: ${git_url} 拉取代码git branch: BRANCH, credentialsId: ${git_auth_id}, url: ${git_url}}}}stage(依赖安装) {steps {dir(${ENVIRONMENT.toLowerCase()}) {sh (script: npm install --registryhttps://registry.npm.taobao.org)}}}stage(代码编译) {steps {dir(${ENVIRONMENT.toLowerCase()}) {sh (script: npm run build)}}}stage(镜像构建) {steps {dir(${ENVIRONMENT.toLowerCase()}) {sh (script: oldImage\$(docker images ${harbor_host}/${harbor_project}/${api_name}:${SERVICE_VERSION} | grep ${api_name} | awk \{ print \$1:\$2 }\)if [ -z \$oldImage ]; thenecho 正常构建镜像elseecho 删除存在镜像docker rmi \$oldImagefi)sh pwd// 生成镜像sh docker build -t ${docker_image} -f ${docker_file_path} .// 查看镜像sh docker images ${harbor_host}/${harbor_project}/${api_name}}}}stage(镜像上传) {steps {withCredentials([usernamePassword(credentialsId: ${harbor_crt_id}, passwordVariable: harbor_password, usernameVariable: harb
