config.xml 5.13 KB
Newer Older
1 2 3
<?xml version='1.1' encoding='UTF-8'?>
<project>
  <actions/>
4
  <description>用來建置feature branch或是其他Branch使用&#xd;
5 6 7 8 9
只打包 ipa, 不做Code Push&#xd;
&#xd;
echo &quot;source &apos;https://rubygems.org&apos;&quot; &gt; Gemfile&#xd;
echo &quot;gem &apos;cocoapods&apos;, &apos;1.4.0&apos;&quot; &gt;&gt; Gemfile&#xd;
echo &quot;gem &apos;fastlane&apos;, &apos;2.107.0&apos;&quot; &gt;&gt; Gemfile</description>
10 11
  <keepDependencies>false</keepDependencies>
  <properties>
12
    <com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.5.11">
13 14
      <gitLabConnection>ylhealth</gitLabConnection>
    </com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
15 16 17 18 19
    <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使用的版本,如:
20 21 22
feature/HA-818
其他Branch請自行設定</description>
          <defaultValue>RN0.50</defaultValue>
23 24
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
25 26 27 28 29 30
        <hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition plugin="global-variable-string-parameter@1.2">
          <name>DownloadName</name>
          <description>下載清單上要顯示的名稱</description>
          <defaultValue>Other</defaultValue>
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
31 32
      </parameterDefinitions>
    </hudson.model.ParametersDefinitionProperty>
33 34
    <jenkins.model.BuildDiscarderProperty>
      <strategy class="hudson.tasks.LogRotator">
35
        <daysToKeep>-1</daysToKeep>
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
        <numToKeep>5</numToKeep>
        <artifactDaysToKeep>-1</artifactDaysToKeep>
        <artifactNumToKeep>-1</artifactNumToKeep>
      </strategy>
    </jenkins.model.BuildDiscarderProperty>
  </properties>
  <scm class="hudson.plugins.git.GitSCM" plugin="git@3.9.1">
    <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>
52
        <name>*/${HRB_Mobile_Other_Branch}</name>
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
      </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>
68
      <command>PATH=&quot;$PATH:/usr/local/bin:/Users/jenkins/.fastlane/bin/&quot;
69
VERSION=SIT_${DownloadName}_$(date +%Y%m%d)
70 71 72 73
MODIFIED_DATE=$(git log -1 --format=&quot;%ci&quot; --)

npm install --update-binary

74
sed -i &quot;&quot; &apos;/url/s/http.*\//http:\/\/10.32.86.132\//g&apos; src/configs/index.js
75 76 77 78 79 80
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
sed -i &apos;&apos; &apos;s/appVersion.*/appVersion&quot;: &quot;1.27&quot;/&apos; appConfig.json

security set-key-partition-list -S apple: -k Yonglinit123 -D &quot;iPhone Distribution: YONGLIN YONGLIN BIOTECH CORP.&quot; -t private

81
npm run build-thread-ios
82

83 84 85 86
echo &quot;source &apos;https://rubygems.org&apos;&quot; &gt; Gemfile
echo &quot;gem &apos;cocoapods&apos;, &apos;1.4.0&apos;&quot; &gt;&gt; Gemfile
echo &quot;gem &apos;fastlane&apos;, &apos;2.107.0&apos;&quot; &gt;&gt; Gemfile

87 88
bundle exec fastlane ios beta
</command>
89 90
    </hudson.tasks.Shell>
    <hudson.tasks.Shell>
91
      <command>VERSION=SIT_${DownloadName}_$(date +%Y%m%d)
92 93 94
MODIFIED_DATE=$(git log -1 --format=&quot;%ci&quot; --)
NAME=HRB_Mobile

95
mv ~/jenkins/workspace/HRB_Mobile_Other_ipa/$NAME.ipa ~/Sites/${NAME}_${VERSION}.ipa
96 97 98
scp ~/Sites/${NAME}_${VERSION}.ipa appuploader@10.57.117.135:~/app/hrb/</command>
    </hudson.tasks.Shell>
  </builders>
99
  <publishers/>
100
  <buildWrappers>
101
    <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.36">
102 103 104 105 106
      <deleteDirs>false</deleteDirs>
      <cleanupParameter></cleanupParameter>
      <externalDelete></externalDelete>
      <disableDeferredWipeout>false</disableDeferredWipeout>
    </hudson.plugins.ws__cleanup.PreBuildCleanup>
107
    <hudson.plugins.ansicolor.AnsiColorBuildWrapper plugin="ansicolor@0.6.0">
108 109 110 111 112
      <colorMapName>xterm</colorMapName>
    </hudson.plugins.ansicolor.AnsiColorBuildWrapper>
    <hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.8.10"/>
  </buildWrappers>
</project>