config.xml 5.19 KB
Newer Older
1 2 3 4 5 6
<?xml version='1.1' encoding='UTF-8'?>
<project>
  <actions/>
  <description>打包 APK,不做 code push</description>
  <keepDependencies>false</keepDependencies>
  <properties>
7
    <com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.5.13">
8 9 10 11 12 13 14 15 16 17 18 19
      <gitLabConnection>ylhealth</gitLabConnection>
    </com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
    <hudson.model.ParametersDefinitionProperty>
      <parameterDefinitions>
        <hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition plugin="global-variable-string-parameter@1.2">
          <name>HRB_Mobile_Prod_Branch</name>
          <description>UAT 使用的版本,如:
release/1.15GA
hotfix/1.14.1GA</description>
          <defaultValue>master</defaultValue>
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
20 21 22 23 24 25
        <hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition plugin="global-variable-string-parameter@1.2">
          <name>CODE_PUSH</name>
          <description>哪一個 Job 執行 code-push</description>
          <defaultValue>hrb</defaultValue>
          <trim>false</trim>
        </hudson.plugins.global__variable__string__parameter.GlobalVariableStringParameterDefinition>
26 27 28 29
      </parameterDefinitions>
    </hudson.model.ParametersDefinitionProperty>
    <jenkins.model.BuildDiscarderProperty>
      <strategy class="hudson.tasks.LogRotator">
30
        <daysToKeep>-1</daysToKeep>
31
        <numToKeep>10</numToKeep>
32 33 34 35 36
        <artifactDaysToKeep>-1</artifactDaysToKeep>
        <artifactNumToKeep>-1</artifactNumToKeep>
      </strategy>
    </jenkins.model.BuildDiscarderProperty>
  </properties>
37
  <scm class="hudson.plugins.git.GitSCM" plugin="git@4.0.0">
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
    <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>
        <name>*/${HRB_Mobile_Prod_Branch}</name>
      </hudson.plugins.git.BranchSpec>
    </branches>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <submoduleCfg class="list"/>
    <extensions/>
  </scm>
54
  <assignedNode>MAC_BUILD_Machine</assignedNode>
55 56 57 58 59 60 61 62
  <canRoam>false</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers/>
  <concurrentBuild>false</concurrentBuild>
  <builders>
    <hudson.tasks.Shell>
63 64 65 66 67
      <command>sh jenkins_android_prod.sh ${CODE_PUSH}

#PATH=&quot;$PATH:/usr/local/bin:/Users/jenkins/.fastlane/bin/&quot;
#export VERSION=$(grep appVersion appConfig.json|cut -d&apos;&quot;&apos; -f4)_$(git rev-parse --short HEAD)
#MODIFIED_DATE=$(git log -1 --format=&quot;%ci&quot; --)
68

69 70
#npm install
## RNFB_ANDROID_PERMISSIONS=true react-native link
71

72 73 74 75
#sed -i &quot;&quot; &apos;/url/s/http.*\//https:\/\/hrb.foxconn.com\//g&apos; src/configs/index.js
#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/piwikSiteId_ios =.*/piwikSiteId_ios = 10;/ ;s/piwikSiteId_android =.*/piwikSiteId_android = 11;/&apos; src/configs/index.js
76

77
#export ANDROID_HOME=/Users/jenkins/Library/Android/sdk
78

79
# node node_modules/react-native/local-cli/cli.js bundle --dev false --assets-dest ./android --entry-file index.thread.js --platform android --bundle-output ./android/app/src/main/assets/threads/index.thread.bundle --sourcemap-output ./android/app/src/main/assets/threads/index.thread.map
80
#npm run build-thread-android
81

82 83 84 85 86
#bundle exec fastlane android release

#VERSION=Prod_$(date +%Y%m%d)_$(git rev-parse --short HEAD)
#MODIFIED_DATE=$(git log -1 --format=&quot;%ci&quot; --)
#NAME=HRB_Mobile
87

88 89
#mv android/app/build/outputs/apk/release/app-release.apk ~/Sites/${NAME}_${VERSION}.apk
#scp ~/Sites/${NAME}_${VERSION}.apk appuploader@10.57.117.135:~/app/hrb/</command>
90 91 92
    </hudson.tasks.Shell>
  </builders>
  <publishers>
93
    <hudson.tasks.Mailer plugin="mailer@1.29">
94 95 96 97 98 99
      <recipients>$RD_Group $QA_Group</recipients>
      <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
      <sendToIndividuals>false</sendToIndividuals>
    </hudson.tasks.Mailer>
  </publishers>
  <buildWrappers>
100
    <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.37">
101 102 103 104 105
      <deleteDirs>false</deleteDirs>
      <cleanupParameter></cleanupParameter>
      <externalDelete></externalDelete>
      <disableDeferredWipeout>false</disableDeferredWipeout>
    </hudson.plugins.ws__cleanup.PreBuildCleanup>
106
    <hudson.plugins.ansicolor.AnsiColorBuildWrapper plugin="ansicolor@0.6.2">
107 108
      <colorMapName>xterm</colorMapName>
    </hudson.plugins.ansicolor.AnsiColorBuildWrapper>
109
    <hudson.plugins.timestamper.TimestamperBuildWrapper plugin="timestamper@1.10"/>
110 111
  </buildWrappers>
</project>