config.xml 5.06 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?xml version='1.1' encoding='UTF-8'?>
<project>
  <actions/>
  <description></description>
  <keepDependencies>false</keepDependencies>
  <properties>
    <jenkins.model.BuildDiscarderProperty>
      <strategy class="hudson.tasks.LogRotator">
        <daysToKeep>1</daysToKeep>
        <numToKeep>2</numToKeep>
        <artifactDaysToKeep>-1</artifactDaysToKeep>
        <artifactNumToKeep>-1</artifactNumToKeep>
      </strategy>
    </jenkins.model.BuildDiscarderProperty>
15 16 17
    <com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.5.11">
      <gitLabConnection>ylhealth</gitLabConnection>
    </com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
    <hudson.model.ParametersDefinitionProperty>
      <parameterDefinitions>
        <hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition plugin="global-variable-string-parameter@1.2">
          <name>branch</name>
          <description>feature branch使用的版本,如:
feature/CRM-6338
其他Branch請自行設定
develop
4c1966d510b71fdf3ec67807321a385c5378cf86(commitId)</description>
          <defaultValue>feature/CRM-6338</defaultValue>
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
        <hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition plugin="global-variable-string-parameter@1.2">
          <name>DownloadName</name>
          <description>下載清單上要顯示的名稱</description>
          <defaultValue>test</defaultValue>
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
        <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>
      </parameterDefinitions>
    </hudson.model.ParametersDefinitionProperty>
44
  </properties>
45
  <scm class="hudson.plugins.git.GitSCM" plugin="git@3.9.2">
46 47 48 49 50 51 52 53 54
    <configVersion>2</configVersion>
    <userRemoteConfigs>
      <hudson.plugins.git.UserRemoteConfig>
        <url>https://cm.ylhealth.org/gitlab/ym/CRM_Mobile.git</url>
        <credentialsId>3485e854-8389-40e8-8c86-b94e94e91904</credentialsId>
      </hudson.plugins.git.UserRemoteConfig>
    </userRemoteConfigs>
    <branches>
      <hudson.plugins.git.BranchSpec>
55
        <name>${branch}</name>
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
      </hudson.plugins.git.BranchSpec>
    </branches>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <submoduleCfg class="list"/>
    <extensions/>
  </scm>
  <assignedNode>Mac_Node</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/scott/.fastlane/bin/&quot;
security set-key-partition-list -S apple: -k Yonglinit123 -D &quot;iPhone Distribution: YONGLIN YONGLIN BIOTECH CORP.&quot; -t private
npm install
RNFB_ANDROID_PERMISSIONS=true react-native link

76
VERSION=SIT_${DownloadName}_$(date +%Y%m%d%H)_$(git rev-parse --short HEAD)
77 78
MODIFIED_DATE=$(git log -1 --format=&quot;%ci&quot; --)

79
sed -i &apos;&apos; &quot;/url/s/\&apos;.*\&apos;;/\&apos;http:\/\/${API_SERVER}\/CRM\/\&apos;;/&quot; app/configs/constant/urls.js
80 81 82 83 84 85 86 87
sed -i &apos;&apos; &quot;/version/s/\&apos;.*\&apos;;/\&apos;${VERSION}\&apos;;/&quot; app/configs/constant/urls.js
sed -i &apos;&apos; &quot;/modifiedTime/s/\&apos;.*\&apos;;/\&apos;${MODIFIED_DATE}\&apos;;/&quot; app/configs/constant/urls.js

export ANDROID_HOME=~/Library/Android/sdk
fastlane android beta
</command>
    </hudson.tasks.Shell>
    <hudson.tasks.Shell>
88
      <command>VERSION=SIT_${DownloadName}_$(date +%Y%m%d)_$(git rev-parse --short HEAD)
89 90 91 92 93 94 95 96
MODIFIED_DATE=$(git log -1 --format=&quot;%ci&quot; --)
NAME=CRM_Mobile

mv android/app/build/outputs/apk/app-releaseStaging.apk ~/Sites/${NAME}_${VERSION}.apk
scp ~/Sites/${NAME}_${VERSION}.* appuploader@10.57.117.135:~/app/crm/</command>
    </hudson.tasks.Shell>
  </builders>
  <publishers>
97
    <hudson.tasks.Mailer plugin="mailer@1.23">
98 99 100 101 102 103
      <recipients>$RD_Group $QA_Group</recipients>
      <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
      <sendToIndividuals>false</sendToIndividuals>
    </hudson.tasks.Mailer>
  </publishers>
  <buildWrappers>
104
    <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.37">
105 106 107 108 109 110 111
      <deleteDirs>false</deleteDirs>
      <cleanupParameter></cleanupParameter>
      <externalDelete></externalDelete>
      <disableDeferredWipeout>false</disableDeferredWipeout>
    </hudson.plugins.ws__cleanup.PreBuildCleanup>
  </buildWrappers>
</project>