config.xml 7.42 KB
Newer Older
1
<?xml version='1.1' encoding='UTF-8'?>
2
<maven2-moduleset plugin="maven-plugin@3.3">
3
  <actions/>
4 5 6 7 8 9
  <description>打包後,會把檔案上傳到 18.224.17.151 的 /home/jenkins/ 下&#xd;
再 ssh 到 18.224.17.151&#xd;
執行&#xd;
sudo /opt/chm/updateCRM.sh&#xd;
進行更新 &#xd;
</description>
10 11
  <keepDependencies>false</keepDependencies>
  <properties>
12
    <com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.5.12">
13 14 15 16 17 18 19 20 21 22
      <gitLabConnection>ylhealth</gitLabConnection>
    </com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
    <hudson.model.ParametersDefinitionProperty>
      <parameterDefinitions>
        <hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition plugin="global-variable-string-parameter@1.2">
          <name>GIT_BRANCH</name>
          <description>
master
release/1.15GA
hotfix/1.15.1GA</description>
23
          <defaultValue>DHP/master</defaultValue>
24 25
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
26 27 28
        <hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition plugin="global-variable-string-parameter@1.2">
          <name>AWS_CHM_AP</name>
          <description></description>
29
          <defaultValue>18.224.17.151</defaultValue>
30 31
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
32 33 34 35 36 37 38 39 40 41 42
      </parameterDefinitions>
    </hudson.model.ParametersDefinitionProperty>
    <jenkins.model.BuildDiscarderProperty>
      <strategy class="hudson.tasks.LogRotator">
        <daysToKeep>-1</daysToKeep>
        <numToKeep>5</numToKeep>
        <artifactDaysToKeep>-1</artifactDaysToKeep>
        <artifactNumToKeep>-1</artifactNumToKeep>
      </strategy>
    </jenkins.model.BuildDiscarderProperty>
  </properties>
43
  <scm class="hudson.plugins.git.GitSCM" plugin="git@3.10.0">
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
    <configVersion>2</configVersion>
    <userRemoteConfigs>
      <hudson.plugins.git.UserRemoteConfig>
        <url>https://cm.ylhealth.org/gitlab/ym/CRM.git</url>
        <credentialsId>3485e854-8389-40e8-8c86-b94e94e91904</credentialsId>
      </hudson.plugins.git.UserRemoteConfig>
    </userRemoteConfigs>
    <branches>
      <hudson.plugins.git.BranchSpec>
        <name>*/${GIT_BRANCH}</name>
      </hudson.plugins.git.BranchSpec>
    </branches>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <submoduleCfg class="list"/>
    <extensions/>
  </scm>
60
  <assignedNode>AWS_BUILD_Machine</assignedNode>
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
  <canRoam>false</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers/>
  <concurrentBuild>false</concurrentBuild>
  <rootModule>
    <groupId>org.ylhealth.ym</groupId>
    <artifactId>CRM</artifactId>
  </rootModule>
  <goals>clean process-resources package -Dmaven.test.skip=true</goals>
  <defaultGoals>spring-boot:run</defaultGoals>
  <aggregatorStyleBuild>true</aggregatorStyleBuild>
  <incrementalBuild>false</incrementalBuild>
  <ignoreUpstremChanges>true</ignoreUpstremChanges>
  <ignoreUnsuccessfulUpstreams>false</ignoreUnsuccessfulUpstreams>
  <archivingDisabled>true</archivingDisabled>
  <siteArchivingDisabled>false</siteArchivingDisabled>
  <fingerprintingDisabled>false</fingerprintingDisabled>
  <resolveDependencies>false</resolveDependencies>
  <processPlugins>false</processPlugins>
  <mavenValidationLevel>-1</mavenValidationLevel>
  <runHeadless>false</runHeadless>
  <disableTriggerDownstreamProjects>false</disableTriggerDownstreamProjects>
  <blockTriggerWhenBuilding>true</blockTriggerWhenBuilding>
  <settings class="jenkins.mvn.DefaultSettingsProvider"/>
  <globalSettings class="jenkins.mvn.DefaultGlobalSettingsProvider"/>
  <reporters>
    <hudson.maven.reporters.MavenMailer>
      <recipients>$RD_Group $QA_Group</recipients>
      <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
      <sendToIndividuals>false</sendToIndividuals>
      <perModuleEmail>true</perModuleEmail>
    </hudson.maven.reporters.MavenMailer>
  </reporters>
  <publishers>
97 98
    <jenkins.plugins.slack.SlackNotifier plugin="slack@2.27">
      <baseUrl></baseUrl>
99
      <teamDomain></teamDomain>
100
      <authToken></authToken>
101 102 103
      <tokenCredentialId></tokenCredentialId>
      <botUser>false</botUser>
      <room></room>
104 105 106
      <sendAsText>false</sendAsText>
      <iconEmoji></iconEmoji>
      <username></username>
107 108 109 110 111 112 113
      <startNotification>false</startNotification>
      <notifySuccess>false</notifySuccess>
      <notifyAborted>true</notifyAborted>
      <notifyNotBuilt>true</notifyNotBuilt>
      <notifyUnstable>true</notifyUnstable>
      <notifyRegression>false</notifyRegression>
      <notifyFailure>true</notifyFailure>
114
      <notifyEveryFailure>false</notifyEveryFailure>
115 116 117 118 119
      <notifyBackToNormal>true</notifyBackToNormal>
      <notifyRepeatedFailure>false</notifyRepeatedFailure>
      <includeTestSummary>false</includeTestSummary>
      <includeFailedTests>false</includeFailedTests>
      <commitInfoChoice>NONE</commitInfoChoice>
120
      <includeCustomMessage>false</includeCustomMessage>
121
      <customMessage></customMessage>
122 123 124 125 126
      <customMessageSuccess></customMessageSuccess>
      <customMessageAborted></customMessageAborted>
      <customMessageNotBuilt></customMessageNotBuilt>
      <customMessageUnstable></customMessageUnstable>
      <customMessageFailure></customMessageFailure>
127 128 129 130 131 132 133 134 135
    </jenkins.plugins.slack.SlackNotifier>
  </publishers>
  <buildWrappers>
    <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.37">
      <deleteDirs>false</deleteDirs>
      <cleanupParameter></cleanupParameter>
      <externalDelete></externalDelete>
      <disableDeferredWipeout>false</disableDeferredWipeout>
    </hudson.plugins.ws__cleanup.PreBuildCleanup>
136
    <hudson.plugins.ansicolor.AnsiColorBuildWrapper plugin="ansicolor@0.6.2">
137 138
      <colorMapName>xterm</colorMapName>
    </hudson.plugins.ansicolor.AnsiColorBuildWrapper>
139
    <hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.9"/>
140 141
  </buildWrappers>
  <prebuilders>
142 143
    <hudson.tasks.Shell>
      <command>VAR=$(git rev-parse --short HEAD)_$(date +&quot;%Y%m%d_%H%M&quot;)
144 145
# version=${GIT_BRANCH##*/}
version=$(git describe --tags)
146 147
sed -i &quot;&quot; &quot;s/&lt;title.*/&lt;title ng-bind=&apos;page_title&apos;&gt;CRM ${version}_${VAR}&lt;\/title\/&gt;/&quot; src/main/resources/static/index.html
sed -i &quot;&quot; &quot;s/&lt;base.*/&lt;base href=\&quot;\/CRM\/\&quot; version=\&quot;${version}_${VAR}\&quot;\/&gt;/&quot; src/main/resources/static/indexMinify.html
148 149 150

# Piwik
sed -i &quot;&quot; &apos;/setSiteId/s/[0-9]/15/g&apos; src/main/resources/static/indexMinify.html</command>
151
    </hudson.tasks.Shell>
152 153
  </prebuilders>
  <postbuilders>
154
    <hudson.tasks.Shell>
155 156 157 158 159 160 161 162
      <command>PROD_FILE=CRM-pack.zip
KEY_FILE=../../jenkins
TARGET_HOST=jenkins@${AWS_CHM_AP}
SSH_PROXY=&quot;ProxyCommand ssh -i ${KEY_FILE} proxy@10.57.117.130 nc %h %p&quot;

ssh -i ${KEY_FILE} -o &quot;${SSH_PROXY}&quot; ${TARGET_HOST} &quot;rm -f ${PROD_FILE}&quot;
scp -i ${KEY_FILE} -o &quot;${SSH_PROXY}&quot; target/${PROD_FILE} ${TARGET_HOST}:~/
</command>
163
    </hudson.tasks.Shell>
164 165 166 167 168 169 170 171
  </postbuilders>
  <runPostStepsIfResult>
    <name>UNSTABLE</name>
    <ordinal>1</ordinal>
    <color>YELLOW</color>
    <completeBuild>true</completeBuild>
  </runPostStepsIfResult>
</maven2-moduleset>