config.xml 4.97 KB
Newer Older
1 2 3
<?xml version='1.1' encoding='UTF-8'?>
<project>
  <actions/>
4
  <description>用來建置feature branch或是其他Branch使用&#xd;
5
只打包 APK, 不做Code Push</description>
6 7
  <keepDependencies>false</keepDependencies>
  <properties>
8 9 10 11 12 13 14 15
    <jenkins.model.BuildDiscarderProperty>
      <strategy class="hudson.tasks.LogRotator">
        <daysToKeep>-1</daysToKeep>
        <numToKeep>5</numToKeep>
        <artifactDaysToKeep>-1</artifactDaysToKeep>
        <artifactNumToKeep>-1</artifactNumToKeep>
      </strategy>
    </jenkins.model.BuildDiscarderProperty>
16
    <com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.5.11">
17 18
      <gitLabConnection>ylhealth</gitLabConnection>
    </com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
19 20 21 22 23
    <hudson.model.ParametersDefinitionProperty>
      <parameterDefinitions>
        <hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition plugin="global-variable-string-parameter@1.2">
          <name>HRB_Mobile_Other_Branch</name>
          <description>feature branch使用的版本,如:
24
feature/HA-818
25
其他Branch請自行設定
26
develop
27 28
commitId
4c1966d510b71fdf3ec67807321a385c5378cf86</description>
29
          <defaultValue>feature/HA-1053</defaultValue>
30 31
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
32 33 34
        <hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition plugin="global-variable-string-parameter@1.2">
          <name>DownloadName</name>
          <description>下載清單上要顯示的名稱</description>
35
          <defaultValue>healthbookSDK</defaultValue>
36 37
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
38 39 40 41 42 43
        <hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition plugin="global-variable-string-parameter@1.2">
          <name>API_SERVER</name>
          <description>連線位置</description>
          <defaultValue>10.32.86.124</defaultValue>
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
44 45
      </parameterDefinitions>
    </hudson.model.ParametersDefinitionProperty>
46
  </properties>
47
  <scm class="hudson.plugins.git.GitSCM" plugin="git@3.9.2">
48 49 50 51 52 53 54 55 56
    <configVersion>2</configVersion>
    <userRemoteConfigs>
      <hudson.plugins.git.UserRemoteConfig>
        <url>https://cm.ylhealth.org/gitlab/ym/HRB_Mobile.git</url>
        <credentialsId>3485e854-8389-40e8-8c86-b94e94e91904</credentialsId>
      </hudson.plugins.git.UserRemoteConfig>
    </userRemoteConfigs>
    <branches>
      <hudson.plugins.git.BranchSpec>
57
        <name>*/${HRB_Mobile_Other_Branch}</name>
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
      </hudson.plugins.git.BranchSpec>
    </branches>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <submoduleCfg class="list"/>
    <extensions/>
  </scm>
  <assignedNode>MAC_BUILD_Machine</assignedNode>
  <canRoam>false</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers/>
  <concurrentBuild>false</concurrentBuild>
  <builders>
    <hudson.tasks.Shell>
      <command>PATH=&quot;$PATH:/usr/local/bin:/Users/jenkins/.fastlane/bin/&quot;
74
VERSION=SIT_${DownloadName}_$(date +%Y%m%d)
75 76
MODIFIED_DATE=$(git log -1 --format=&quot;%ci&quot; --)

77
yarn install
78

79
sed -i &apos;&apos; &quot;/url/s/http.*\//http:\/\/${API_SERVER}\//g&quot; src/configs/index.js
80 81
sed -i &apos;&apos; &quot;/version/s/\&apos;.*\&apos;;/\&apos;${VERSION}\&apos;;/&quot; src/configs/index.js
sed -i &apos;&apos; &quot;/modifiedTime/s/\&apos;.*\&apos;;/\&apos;${MODIFIED_DATE}\&apos;;/&quot; src/configs/index.js
82
sed -i &apos;&apos; &quot;/allergyUrl/s/\__DEV__.*\&apos;;/\&apos;http:\/\/${API_SERVER}\/\&apos;;/&quot; src/configs/index.js
83 84 85 86
sed -i &apos;&apos; &apos;s/appVersion.*/appVersion&quot;: &quot;1.27&quot;/&apos; appConfig.json

export ANDROID_HOME=/Users/jenkins/Library/Android/sdk

87
##npm run bundle-worker-android
88

89
npm run build-thread-android
90
bundle exec fastlane android beta</command>
91 92
    </hudson.tasks.Shell>
    <hudson.tasks.Shell>
93
      <command>VERSION=SIT_${DownloadName}_$(date +%Y%m%d)
94 95 96 97 98 99 100
MODIFIED_DATE=$(git log -1 --format=&quot;%ci&quot; --)
NAME=HRB_Mobile

mv android/app/build/outputs/apk/releaseStaging/app-releaseStaging.apk ~/Sites/${NAME}_${VERSION}.apk
scp ~/Sites/${NAME}_${VERSION}.apk appuploader@10.57.117.135:~/app/hrb/</command>
    </hudson.tasks.Shell>
  </builders>
101
  <publishers/>
102
  <buildWrappers>
103
    <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.37">
104 105 106 107 108 109 110
      <deleteDirs>false</deleteDirs>
      <cleanupParameter></cleanupParameter>
      <externalDelete></externalDelete>
      <disableDeferredWipeout>false</disableDeferredWipeout>
    </hudson.plugins.ws__cleanup.PreBuildCleanup>
  </buildWrappers>
</project>