config.xml 6.2 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
      </parameterDefinitions>
    </hudson.model.ParametersDefinitionProperty>
58
  </properties>
59
  <scm class="hudson.plugins.git.GitSCM" plugin="git@3.9.3">
60 61 62 63 64 65 66 67 68
    <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>
69
        <name>*/${HRB_Mobile_Other_Branch}</name>
70 71 72 73 74 75
      </hudson.plugins.git.BranchSpec>
    </branches>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <submoduleCfg class="list"/>
    <extensions/>
  </scm>
76
  <assignedNode>MAC_BUILD_Machine</assignedNode>
77 78 79 80 81 82 83 84
  <canRoam>false</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers/>
  <concurrentBuild>false</concurrentBuild>
  <builders>
    <hudson.tasks.Shell>
85
      <command>PATH=&quot;$PATH:/usr/local/bin:/Users/jenkins/.fastlane/bin/&quot;
86
VERSION=SIT_${DownloadName}_$(date +%Y%m%d)
87 88
MODIFIED_DATE=$(git log -1 --format=&quot;%ci&quot; --)

89 90
# npm install --update-binary
yarn install
91

92
sed -i &quot;&quot; &apos;/url/s/http.*\//https:\/\/hrb.foxconn.com\//g&apos; src/configs/index.js
93 94
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
95
sed -i &apos;&apos; &apos;s/piwikSiteId_ios =.*/piwikSiteId_ios = 10;/ ;s/piwikSiteId_android =.*/piwikSiteId_android = 11;/&apos; src/configs/index.js
96

97 98 99
# 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

100

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

104
npm run build-thread-ios
105

106 107 108
##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
109 110
#bundle update
#bundle install
111
bundle exec fastlane ios uat
112
</command>
113 114
    </hudson.tasks.Shell>
    <hudson.tasks.Shell>
115
      <command>VERSION=SIT_${DownloadName}_$(date +%Y%m%d)
116 117 118
MODIFIED_DATE=$(git log -1 --format=&quot;%ci&quot; --)
NAME=HRB_Mobile

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