config.xml 5.39 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 46 47 48 49
        <hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition plugin="global-variable-string-parameter@1.2">
          <name>HTT_PROTOCOL</name>
          <description>http / https</description>
          <defaultValue>http</defaultValue>
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
50 51
      </parameterDefinitions>
    </hudson.model.ParametersDefinitionProperty>
52
  </properties>
53
  <scm class="hudson.plugins.git.GitSCM" plugin="git@3.9.3">
54 55 56 57 58 59 60 61 62
    <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>
63
        <name>*/${HRB_Mobile_Other_Branch}</name>
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
      </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;
80
VERSION=SIT_${DownloadName}_$(date +%Y%m%d)
81 82
MODIFIED_DATE=$(git log -1 --format=&quot;%ci&quot; --)

83
yarn install
84

85
sed -i &apos;&apos; &quot;/url/s/http.*\//${HTT_PROTOCOL}:\/\/${API_SERVER}\//g&quot; src/configs/index.js
86 87
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
88
sed -i &apos;&apos; &quot;/allergyUrl/s/\__DEV__.*\&apos;;/\&apos;${HTT_PROTOCOL}:\/\/${API_SERVER}\/\&apos;;/&quot; src/configs/index.js
89
sed -i &apos;&apos; &apos;s/appVersion.*/appVersion&quot;: &quot;1.27&quot;/&apos; appConfig.json
90 91 92

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

93
##npm run bundle-worker-android
94

95
npm run build-thread-android
96
bundle exec fastlane android beta</command>
97 98
    </hudson.tasks.Shell>
    <hudson.tasks.Shell>
99
      <command>VERSION=SIT_${DownloadName}_$(date +%Y%m%d)
100 101 102 103 104 105 106
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>
107
  <publishers/>
108
  <buildWrappers>
109
    <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.37">
110 111 112 113 114 115 116
      <deleteDirs>false</deleteDirs>
      <cleanupParameter></cleanupParameter>
      <externalDelete></externalDelete>
      <disableDeferredWipeout>false</disableDeferredWipeout>
    </hudson.plugins.ws__cleanup.PreBuildCleanup>
  </buildWrappers>
</project>