config.xml 6.69 KB
Newer Older
1 2 3
<?xml version='1.1' encoding='UTF-8'?>
<project>
  <actions/>
4
  <description>用來建置feature branch或是其他Branch使用&#xd;
5
只打包 ipa, 不做Code Push&#xd;
6 7 8 9 10
xcode-select --install&#xd;
brew install yarn node&#xd;
brew install watchman ruby flow yarn&#xd;
sudo npm install -g react-native-cli&#xd;
sudo gem install bundler&#xd;
11 12
&#xd;
echo &quot;source &apos;https://rubygems.org&apos;&quot; &gt; Gemfile&#xd;
13 14 15 16 17
echo &quot;gem &apos;xcode-install&apos;, &apos;2.2.0&apos;&quot; &gt;&gt; Gemfile&#xd;
echo &quot;gem &apos;cocoapods&apos;, &apos;1.5.0&apos;&quot; &gt;&gt; Gemfile&#xd;
echo &quot;gem &apos;fastlane&apos;, &apos;2.113.0&apos;&quot; &gt;&gt; Gemfile&#xd;
&#xd;
</description>
18 19
  <keepDependencies>false</keepDependencies>
  <properties>
20 21 22 23 24 25 26 27
    <jenkins.model.BuildDiscarderProperty>
      <strategy class="hudson.tasks.LogRotator">
        <daysToKeep>-1</daysToKeep>
        <numToKeep>5</numToKeep>
        <artifactDaysToKeep>-1</artifactDaysToKeep>
        <artifactNumToKeep>-1</artifactNumToKeep>
      </strategy>
    </jenkins.model.BuildDiscarderProperty>
28
    <com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.5.11">
29 30
      <gitLabConnection>ylhealth</gitLabConnection>
    </com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
31 32 33 34 35
    <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使用的版本,如:
36
feature/HA-818
37
其他Branch請自行設定
38
develop
39 40
commitId
4c1966d510b71fdf3ec67807321a385c5378cf86</description>
41
          <defaultValue>feature/HA-1040_</defaultValue>
42 43
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
44 45 46
        <hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition plugin="global-variable-string-parameter@1.2">
          <name>DownloadName</name>
          <description>下載清單上要顯示的名稱</description>
47
          <defaultValue>test57</defaultValue>
48 49
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
50 51 52 53 54 55
        <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>
56 57 58 59 60 61
        <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>
62 63
      </parameterDefinitions>
    </hudson.model.ParametersDefinitionProperty>
64
  </properties>
65
  <scm class="hudson.plugins.git.GitSCM" plugin="git@3.9.3">
66 67 68 69 70 71 72 73 74
    <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>
75
        <name>*/${HRB_Mobile_Other_Branch}</name>
76 77 78 79 80 81
      </hudson.plugins.git.BranchSpec>
    </branches>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <submoduleCfg class="list"/>
    <extensions/>
  </scm>
82
  <assignedNode>MAC_BUILD_Machine</assignedNode>
83 84 85 86 87 88 89 90
  <canRoam>false</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers/>
  <concurrentBuild>false</concurrentBuild>
  <builders>
    <hudson.tasks.Shell>
91
      <command>PATH=&quot;$PATH:/usr/local/bin:/Users/jenkins/.fastlane/bin/&quot;
92
VERSION=SIT_${DownloadName}_$(date +%Y%m%d)
93 94
MODIFIED_DATE=$(git log -1 --format=&quot;%ci&quot; --)

95 96
# npm install --update-binary
yarn install
97

98
sed -i &apos;&apos; &quot;/url/s/http.*\//${HTT_PROTOCOL}:\/\/${API_SERVER}\//g&quot; src/configs/index.js
99 100
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
101
sed -i &apos;&apos; &quot;/allergyUrl/s/\__DEV__.*\&apos;;/\&apos;${HTT_PROTOCOL}:\/\/${API_SERVER}\/\&apos;;/&quot; src/configs/index.js
102
sed -i &apos;&apos; &apos;s/appVersion.*/appVersion&quot;: &quot;1.27&quot;/&apos; appConfig.json
103

104 105 106
# RN0.57.8 modify(HA-1058), after RN0.58 will remove this command
sed -i &quot;&quot; &apos;s/NSUInteger loopCount = 0;/CGFloat loopCount = 0;/&apos; node_modules/react-native/Libraries/Image/RCTGIFImageDecoder.m

107

108
# security set-key-partition-list -S apple: -k Yonglinit123 -D &quot;iPhone Distribution: YONGLIN YONGLIN BIOTECH CORP.&quot; -t private
109
##npm run bundle-worker-ios
110

111
npm run build-thread-ios
112

113 114 115
##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
116 117
#bundle update
#bundle install
118
bundle exec fastlane ios beta
119
</command>
120 121
    </hudson.tasks.Shell>
    <hudson.tasks.Shell>
122
      <command>VERSION=SIT_${DownloadName}_$(date +%Y%m%d)
123 124 125
MODIFIED_DATE=$(git log -1 --format=&quot;%ci&quot; --)
NAME=HRB_Mobile

126
mv ~/jenkins/workspace/HRB_Mobile_Other_ipa/$NAME.ipa ~/Sites/${NAME}_${VERSION}.ipa
127 128 129
scp ~/Sites/${NAME}_${VERSION}.ipa appuploader@10.57.117.135:~/app/hrb/</command>
    </hudson.tasks.Shell>
  </builders>
130
  <publishers/>
131
  <buildWrappers>
132
    <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.37">
133 134 135 136 137
      <deleteDirs>false</deleteDirs>
      <cleanupParameter></cleanupParameter>
      <externalDelete></externalDelete>
      <disableDeferredWipeout>false</disableDeferredWipeout>
    </hudson.plugins.ws__cleanup.PreBuildCleanup>
138 139
    <hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.9"/>
    <hudson.plugins.ansicolor.AnsiColorBuildWrapper plugin="ansicolor@0.6.2">
140 141 142 143
      <colorMapName>xterm</colorMapName>
    </hudson.plugins.ansicolor.AnsiColorBuildWrapper>
  </buildWrappers>
</project>