Commit 12c815c2 by chenweitao

Merge branch 'working' into 'master'

Working

See merge request !123
parents 4862cb6c e3f47934
FROM harbor.docker.zhiweireach.com/service/oracle-jdk-jmx_prometheus_javaagent:8-0.3.1 FROM harbor.docker.zhiweidata.top/service/oracle-jdk-jmx_prometheus_javaagent:8-0.3.1
WORKDIR /usr/local/ WORKDIR /usr/local/
ENV TZ="Asia/Shanghai" ENV TZ="Asia/Shanghai"
copy target/searchhotcrawler-0.0.6-SNAPSHOT.jar searchhot-crawler.jar copy target/searchhotcrawler-0.0.6-SNAPSHOT.jar searchhot-crawler.jar
......
...@@ -38,8 +38,8 @@ pipeline { ...@@ -38,8 +38,8 @@ pipeline {
when { branch 'master' } when { branch 'master' }
steps { steps {
withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'dockerHubPassword', usernameVariable: 'dockerHubUser')]) { withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'dockerHubPassword', usernameVariable: 'dockerHubUser')]) {
sh "docker login -u ${dockerHubUser} -p ${dockerHubPassword} harbor.docker.zhiweireach.com" sh "docker login -u ${dockerHubUser} -p ${dockerHubPassword} harbor.docker.zhiweidata.top"
sh "docker build -t harbor.docker.zhiweireach.com/daemon/${env.JOB_NAME}:${env.BUILD_NUMBER} . " sh "docker build -t harbor.docker.zhiweidata.top/daemon/${env.JOB_NAME}:${env.BUILD_NUMBER} . "
} }
} }
...@@ -53,8 +53,8 @@ pipeline { ...@@ -53,8 +53,8 @@ pipeline {
when { branch 'master' } when { branch 'master' }
steps { steps {
withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'dockerHubPassword', usernameVariable: 'dockerHubUser')]) { withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'dockerHubPassword', usernameVariable: 'dockerHubUser')]) {
sh "docker login -u ${dockerHubUser} -p ${dockerHubPassword} harbor.docker.zhiweireach.com" sh "docker login -u ${dockerHubUser} -p ${dockerHubPassword} harbor.docker.zhiweidata.top"
sh "docker push harbor.docker.zhiweireach.com/daemon/${env.JOB_NAME}:${env.BUILD_NUMBER}" sh "docker push harbor.docker.zhiweidata.top/daemon/${env.JOB_NAME}:${env.BUILD_NUMBER}"
} }
} }
...@@ -67,7 +67,7 @@ pipeline { ...@@ -67,7 +67,7 @@ pipeline {
stage('deploy') { stage('deploy') {
when { branch 'master' } when { branch 'master' }
steps { steps {
sh "kubectl -n daemon set image deployment/searchhotcrawler searchhotcrawler=harbor.docker.zhiweireach.com/daemon/${env.JOB_NAME}:${env.BUILD_NUMBER} --record" sh "kubectl -n daemon set image deployment/searchhotcrawler searchhotcrawler=harbor.docker.zhiweidata.top/daemon/${env.JOB_NAME}:${env.BUILD_NUMBER} --record"
} }
post { post {
success { success {
......
...@@ -268,7 +268,7 @@ public class WeiboHotSearchCrawler { ...@@ -268,7 +268,7 @@ public class WeiboHotSearchCrawler {
document.put("topicLead", topicLead); document.put("topicLead", topicLead);
} }
} }
if (json.containsKey("cardlist_head_cards")) { if (json.containsKey("cardlist_head_cards")&&!json.getJSONArray("cardlist_head_cards").isEmpty()) {
JSONObject readJson = json.getJSONArray("cardlist_head_cards").getJSONObject(0); JSONObject readJson = json.getJSONArray("cardlist_head_cards").getJSONObject(0);
if (readJson.containsKey("head_data")) { if (readJson.containsKey("head_data")) {
String midText = readJson.getJSONObject("head_data").getString("midtext"); String midText = readJson.getJSONObject("head_data").getString("midtext");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment