config.xml 5.17 KB
Newer Older
1 2 3 4 5 6
<?xml version='1.1' encoding='UTF-8'?>
<project>
  <actions/>
  <description>只打包 ipa, 不做Code Push</description>
  <keepDependencies>false</keepDependencies>
  <properties>
7
    <com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.5.12">
8 9
      <gitLabConnection>ylhealth</gitLabConnection>
    </com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
10 11 12
    <hudson.model.ParametersDefinitionProperty>
      <parameterDefinitions>
        <hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition plugin="global-variable-string-parameter@1.2">
13
          <name>GIT_BRANCH</name>
14 15
          <description>develop
feature/I18N
16 17
release/1.47
hotfix/1.47.1</description>
18 19 20
          <defaultValue>develop</defaultValue>
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
21
        <hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition plugin="global-variable-string-parameter@1.2">
22
          <name>API_SERVER</name>
23
          <description>連線位置</description>
24
          <defaultValue>10.32.86.124</defaultValue>
25 26
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
27 28
      </parameterDefinitions>
    </hudson.model.ParametersDefinitionProperty>
29 30 31 32 33 34 35 36
    <jenkins.model.BuildDiscarderProperty>
      <strategy class="hudson.tasks.LogRotator">
        <daysToKeep>-1</daysToKeep>
        <numToKeep>5</numToKeep>
        <artifactDaysToKeep>-1</artifactDaysToKeep>
        <artifactNumToKeep>-1</artifactNumToKeep>
      </strategy>
    </jenkins.model.BuildDiscarderProperty>
37
  </properties>
38
  <scm class="hudson.plugins.git.GitSCM" plugin="git@3.10.0">
39 40 41 42 43 44 45 46 47
    <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>
48
        <name>*/${GIT_BRANCH}</name>
49 50 51 52 53 54
      </hudson.plugins.git.BranchSpec>
    </branches>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <submoduleCfg class="list"/>
    <extensions/>
  </scm>
55
  <assignedNode>IPA_BUILD_Machine</assignedNode>
56 57 58 59 60 61 62 63
  <canRoam>false</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers/>
  <concurrentBuild>false</concurrentBuild>
  <builders>
    <hudson.tasks.Shell>
64 65 66
      <command>export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

67
PATH=&quot;$PATH:$HOME/.rvm/bin:/usr/local/bin:/Users/jenkins/.fastlane/bin/&quot;
68 69 70
VERSION=SIT_$(date +%Y%m%d)_$(git rev-parse --short HEAD)
MODIFIED_DATE=$(git log -1 --format=&quot;%ci&quot; --)

71 72 73 74 75 76 77 78

# 加速打包,正式時還是要包
GYM_INCLUDE_SYMBOLS=false
GYM_INCLUDE_BITCODE=false

gem install bundler
bundler install

79
npm run clear
80
sed -i &apos;&apos; &quot;/url/s/http.*\//http:\/\/${API_SERVER}\//g&quot; src/configs/index.js
81 82
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
83
sed -i &apos;&apos; &quot;/allergyUrl/s/\__DEV__.*\&apos;;/\&apos;http:\/\/${API_SERVER}\/\&apos;;/&quot; src/configs/index.js
84 85
sed -i &apos;&apos; &apos;s/appVersion.*/appVersion&quot;: &quot;1.27&quot;/&apos; appConfig.json

86

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

89
npm run build-thread-ios
90
# rvm use 2.6.0
91
bundle exec fastlane ios beta --verbose</command>
92 93
    </hudson.tasks.Shell>
    <hudson.tasks.Shell>
94
      <command>VERSION=SIT_${GIT_BRANCH##*/}_$(date +%Y%m%d)_$(git rev-parse --short HEAD)
95 96 97 98
MODIFIED_DATE=$(git log -1 --format=&quot;%ci&quot; --)
NAME=HRB_Mobile

mv ~/jenkins/workspace/HRB_Mobile_SIT_ipa/$NAME.ipa ~/Sites/${NAME}_${VERSION}.ipa
99
scp -i ~/jenkins/jenkins ~/Sites/${NAME}_${VERSION}.ipa appuploader@10.57.117.135:~/app/hrb/</command>
100 101 102
    </hudson.tasks.Shell>
  </builders>
  <publishers>
103
    <hudson.tasks.Mailer plugin="mailer@1.23">
104 105 106 107 108 109
      <recipients>$RD_Group $QA_Group</recipients>
      <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
      <sendToIndividuals>true</sendToIndividuals>
    </hudson.tasks.Mailer>
  </publishers>
  <buildWrappers>
110
    <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.37">
111 112 113 114 115
      <deleteDirs>false</deleteDirs>
      <cleanupParameter></cleanupParameter>
      <externalDelete></externalDelete>
      <disableDeferredWipeout>false</disableDeferredWipeout>
    </hudson.plugins.ws__cleanup.PreBuildCleanup>
116
    <hudson.plugins.ansicolor.AnsiColorBuildWrapper plugin="ansicolor@0.6.2">
117 118
      <colorMapName>xterm</colorMapName>
    </hudson.plugins.ansicolor.AnsiColorBuildWrapper>
119
    <hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.9"/>
120 121
  </buildWrappers>
</project>