config.xml 8.63 KB
Newer Older
1
<?xml version='1.1' encoding='UTF-8'?>
2
<maven2-moduleset plugin="maven-plugin@3.4">
3
  <actions/>
4
  <description>會去抓 https://cm.ylhealth.org/jenkins/view/UAT/job/Deploy_ReportUploader_UAT_136/ 最後一個版本回來部署 </description>
5 6
  <keepDependencies>false</keepDependencies>
  <properties>
7
    <com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.5.13">
8 9 10 11 12 13 14
      <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>
15
develop
16
master
17 18
release/1.59GA
hotfix/1.59.1GA</description>
19
          <defaultValue>release/1.71GA</defaultValue>
20 21 22 23
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
      </parameterDefinitions>
    </hudson.model.ParametersDefinitionProperty>
24 25 26 27 28 29 30 31
    <jenkins.model.BuildDiscarderProperty>
      <strategy class="hudson.tasks.LogRotator">
        <daysToKeep>-1</daysToKeep>
        <numToKeep>5</numToKeep>
        <artifactDaysToKeep>-1</artifactDaysToKeep>
        <artifactNumToKeep>-1</artifactNumToKeep>
      </strategy>
    </jenkins.model.BuildDiscarderProperty>
32
  </properties>
33
  <scm class="hudson.plugins.git.GitSCM" plugin="git@4.1.1">
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
    <configVersion>2</configVersion>
    <userRemoteConfigs>
      <hudson.plugins.git.UserRemoteConfig>
        <url>https://cm.ylhealth.org/gitlab/ym/CRM_BOOKING.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>
  <assignedNode>UAT_136</assignedNode>
  <canRoam>false</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
55 56 57 58 59
  <triggers>
    <hudson.triggers.TimerTrigger>
      <spec>0 7,13,17 * * 1-6</spec>
    </hudson.triggers.TimerTrigger>
  </triggers>
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
  <concurrentBuild>false</concurrentBuild>
  <rootModule>
    <groupId>org.ylhealth.ym.hrb.backend</groupId>
    <artifactId>CHMB</artifactId>
  </rootModule>
  <goals>clean package -Dmaven.test.skip=true -DskipTests=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"/>
82 83
  <reporters>
    <hudson.maven.reporters.MavenMailer>
84
      <recipients>$RD_Group</recipients>
85 86 87 88 89
      <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
      <sendToIndividuals>false</sendToIndividuals>
      <perModuleEmail>true</perModuleEmail>
    </hudson.maven.reporters.MavenMailer>
  </reporters>
90
  <publishers>
91
    <hudson.plugins.parameterizedtrigger.BuildTrigger plugin="parameterized-trigger@2.36">
92 93 94 95 96 97 98 99 100 101 102 103 104
      <configs>
        <hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
          <configs>
            <hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
              <properties>NotifyMessage=Deploy CHMB on UAT(136) done.</properties>
              <textParamValueOnNewLine>false</textParamValueOnNewLine>
            </hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
          </configs>
          <projects>Notify_Group</projects>
          <condition>SUCCESS</condition>
          <triggerWithNoParameters>false</triggerWithNoParameters>
          <triggerFromChildProjects>false</triggerFromChildProjects>
        </hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
105 106 107 108 109 110 111
        <hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
          <configs class="empty-list"/>
          <projects>CHMB_Run_Automation</projects>
          <condition>SUCCESS</condition>
          <triggerWithNoParameters>true</triggerWithNoParameters>
          <triggerFromChildProjects>false</triggerFromChildProjects>
        </hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
112 113
      </configs>
    </hudson.plugins.parameterizedtrigger.BuildTrigger>
114
    <jenkins.plugins.slack.SlackNotifier plugin="slack@2.36">
115
      <baseUrl></baseUrl>
116
      <teamDomain></teamDomain>
117
      <authToken></authToken>
118
      <tokenCredentialId></tokenCredentialId>
119 120
      <botUser>false</botUser>
      <room></room>
121 122 123
      <sendAsText>false</sendAsText>
      <iconEmoji></iconEmoji>
      <username></username>
124 125 126 127 128 129 130
      <startNotification>false</startNotification>
      <notifySuccess>false</notifySuccess>
      <notifyAborted>true</notifyAborted>
      <notifyNotBuilt>true</notifyNotBuilt>
      <notifyUnstable>true</notifyUnstable>
      <notifyRegression>false</notifyRegression>
      <notifyFailure>true</notifyFailure>
131
      <notifyEveryFailure>false</notifyEveryFailure>
132 133 134 135 136
      <notifyBackToNormal>true</notifyBackToNormal>
      <notifyRepeatedFailure>false</notifyRepeatedFailure>
      <includeTestSummary>false</includeTestSummary>
      <includeFailedTests>false</includeFailedTests>
      <commitInfoChoice>NONE</commitInfoChoice>
137
      <includeCustomMessage>false</includeCustomMessage>
138
      <customMessage></customMessage>
139 140 141 142 143
      <customMessageSuccess></customMessageSuccess>
      <customMessageAborted></customMessageAborted>
      <customMessageNotBuilt></customMessageNotBuilt>
      <customMessageUnstable></customMessageUnstable>
      <customMessageFailure></customMessageFailure>
144 145 146
    </jenkins.plugins.slack.SlackNotifier>
  </publishers>
  <buildWrappers>
147
    <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.38">
148 149 150
      <deleteDirs>false</deleteDirs>
      <cleanupParameter></cleanupParameter>
      <externalDelete></externalDelete>
151
      <disableDeferredWipeout>false</disableDeferredWipeout>
152
    </hudson.plugins.ws__cleanup.PreBuildCleanup>
153
    <hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.10"/>
154 155
  </buildWrappers>
  <prebuilders>
156 157
    <hudson.tasks.Shell>
      <command>VAR=$(git rev-parse --short HEAD)_$(date +&quot;%Y%m%d_%H%M&quot;)
158
version=${GIT_BRANCH##*/}
159 160
sed -i &quot;s/&lt;title.*/&lt;title&gt;CHM Booking Manage v${version}_${VAR}&lt;\/title\/&gt;/&quot; src/main/resources/static/index.html
sed -i &quot;s/&lt;title.*/&lt;title&gt;CHM Booking Manage v${version}_${VAR}&lt;\/title\/&gt;/&quot; src/main/resources/static/assets/index.html</command>
161
    </hudson.tasks.Shell>
162
    <hudson.plugins.copyartifact.CopyArtifact plugin="copyartifact@1.43">
163
      <project>Deploy_ReportUploader_UAT_136</project>
164
      <filter>target/</filter>
165 166
      <target>src/main/resources/static/ReportUploader/lib/</target>
      <excludes></excludes>
167 168 169
      <selector class="hudson.plugins.copyartifact.StatusBuildSelector">
        <stable>true</stable>
      </selector>
170
      <flatten>true</flatten>
171 172
      <doNotFingerprintArtifacts>false</doNotFingerprintArtifacts>
    </hudson.plugins.copyartifact.CopyArtifact>
173 174
  </prebuilders>
  <postbuilders>
175 176
    <hudson.tasks.Shell>
      <command>sudo systemctl stop CHMB
177
sudo systemctl stop CHMB_Batch
178

179 180
chmb=/opt/chm/chmb
tempdir=$(mktemp -d)
181
7za x target/CHMB-pack.zip -o&quot;${tempdir}&quot;
182 183 184
rm -rf ${chmb}/lib/*
rm -rf ${chmb}/sample/*
rm -rf ${chmb}/template/*
185 186 187
mv -f ${tempdir}/CHMB/lib/* &quot;${chmb}/lib&quot;
mv -f ${tempdir}/CHMB/sample/* &quot;${chmb}/sample&quot;
mv -f ${tempdir}/CHMB/template/* &quot;${chmb}/template&quot;
188
rm -rf &quot;${tempdir}&quot;
189

190 191
sudo systemctl start CHMB
sudo systemctl start CHMB_Batch</command>
192
    </hudson.tasks.Shell>
193 194 195 196 197 198 199 200
  </postbuilders>
  <runPostStepsIfResult>
    <name>SUCCESS</name>
    <ordinal>0</ordinal>
    <color>BLUE</color>
    <completeBuild>true</completeBuild>
  </runPostStepsIfResult>
</maven2-moduleset>