config.xml 7.24 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
  <description>打包完會將 war 檔放到 3.17.141.90 :/home/ymadmin 下&#xd;
再 ssh 到 3.17.141.90&#xd;
執行&#xd;
sudo /opt/HRB/update.sh&#xd;
進行更新 </description>
9 10
  <keepDependencies>false</keepDependencies>
  <properties>
11
    <com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.5.12">
12 13 14 15 16 17 18 19 20 21
      <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>
22
          <defaultValue>DHP/master</defaultValue>
23 24
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
25 26 27
        <hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition plugin="global-variable-string-parameter@1.2">
          <name>AWS_HRB_AP</name>
          <description></description>
28
          <defaultValue>3.17.141.90</defaultValue>
29 30
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
31 32 33 34 35 36 37 38 39 40 41
      </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>
42
  <scm class="hudson.plugins.git.GitSCM" plugin="git@3.10.0">
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
    <configVersion>2</configVersion>
    <userRemoteConfigs>
      <hudson.plugins.git.UserRemoteConfig>
        <url>https://cm.ylhealth.org/gitlab/ym/HRB.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>
59
  <assignedNode>AWS_BUILD_Machine</assignedNode>
60 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
  <canRoam>false</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers/>
  <concurrentBuild>false</concurrentBuild>
  <rootModule>
    <groupId>org.ylhealth.ym.hrb.backend</groupId>
    <artifactId>HRB</artifactId>
  </rootModule>
  <goals>clean package -Poptimize -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>true</siteArchivingDisabled>
  <fingerprintingDisabled>true</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"/>
87
  <reporters/>
88
  <publishers>
89 90
    <jenkins.plugins.slack.SlackNotifier plugin="slack@2.27">
      <baseUrl></baseUrl>
91
      <teamDomain></teamDomain>
92
      <authToken></authToken>
93 94 95
      <tokenCredentialId></tokenCredentialId>
      <botUser>false</botUser>
      <room></room>
96 97 98
      <sendAsText>false</sendAsText>
      <iconEmoji></iconEmoji>
      <username></username>
99 100 101 102 103 104 105
      <startNotification>false</startNotification>
      <notifySuccess>false</notifySuccess>
      <notifyAborted>true</notifyAborted>
      <notifyNotBuilt>true</notifyNotBuilt>
      <notifyUnstable>true</notifyUnstable>
      <notifyRegression>false</notifyRegression>
      <notifyFailure>true</notifyFailure>
106
      <notifyEveryFailure>false</notifyEveryFailure>
107 108 109 110 111
      <notifyBackToNormal>true</notifyBackToNormal>
      <notifyRepeatedFailure>false</notifyRepeatedFailure>
      <includeTestSummary>false</includeTestSummary>
      <includeFailedTests>false</includeFailedTests>
      <commitInfoChoice>NONE</commitInfoChoice>
112
      <includeCustomMessage>false</includeCustomMessage>
113 114 115 116 117 118
      <customMessage></customMessage>
      <customMessageSuccess></customMessageSuccess>
      <customMessageAborted></customMessageAborted>
      <customMessageNotBuilt></customMessageNotBuilt>
      <customMessageUnstable></customMessageUnstable>
      <customMessageFailure></customMessageFailure>
119 120 121 122 123 124 125 126 127
    </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>
128
    <hudson.plugins.ansicolor.AnsiColorBuildWrapper plugin="ansicolor@0.6.2">
129 130
      <colorMapName>xterm</colorMapName>
    </hudson.plugins.ansicolor.AnsiColorBuildWrapper>
131
    <hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.9"/>
132 133
  </buildWrappers>
  <prebuilders>
134 135
    <hudson.tasks.Shell>
      <command>VAR=$(git rev-parse --short HEAD)_$(date +&quot;%Y%m%d_%H%M&quot;)
136
version=$(git describe --tags)
137 138
sed -i &quot;&quot; &quot;s/&lt;base.*/&lt;base href=\&quot;\/\&quot; version=\&quot;${version}_${VAR}\&quot;\/&gt;/&quot; src/main/resources/static/index.html
sed -i &quot;&quot; &quot;s/&lt;base.*/&lt;base href=\&quot;\/\&quot; version=\&quot;${version}_${VAR}\&quot;\/&gt;/&quot; src/main/resources/static/login.html
139 140 141 142 143

# Piwik
sed -i &quot;&quot; &apos;/setSiteId/s/[0-9]/16/g&apos; src/main/resources/static/index.html
sed -i &quot;&quot; &apos;/setSiteId/s/[0-9]/16/g&apos; src/main/resources/static/login.html
sed -i &quot;&quot; &apos;/setSiteId/s/[0-9]/16/g&apos; src/main/resources/templates/assistBook/main.html</command>
144
    </hudson.tasks.Shell>
145 146
  </prebuilders>
  <postbuilders>
147
    <hudson.tasks.Shell>
148 149
      <command>PROD_FILE=HRB-pack.zip
KEY_FILE=../../jenkins
150
TARGET_HOST=jenkins@${AWS_HRB_AP}
151 152 153 154 155
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>
156
    </hudson.tasks.Shell>
157 158 159 160 161 162 163 164
  </postbuilders>
  <runPostStepsIfResult>
    <name>SUCCESS</name>
    <ordinal>0</ordinal>
    <color>BLUE</color>
    <completeBuild>true</completeBuild>
  </runPostStepsIfResult>
</maven2-moduleset>