config.xml 3.53 KB
Newer Older
1 2 3 4 5 6
<?xml version='1.1' encoding='UTF-8'?>
<project>
  <actions/>
  <description>CRM 專案 git flow 處理</description>
  <keepDependencies>false</keepDependencies>
  <properties>
7
    <com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.5.10">
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
      <gitLabConnection>ylhealth</gitLabConnection>
    </com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
    <hudson.model.ParametersDefinitionProperty>
      <parameterDefinitions>
        <hudson.model.ChoiceParameterDefinition>
          <name>FLOW</name>
          <description>release 還是 hotfix</description>
          <choices class="java.util.Arrays$ArrayList">
            <a class="string-array">
              <string>release</string>
              <string>hotfix</string>
            </a>
          </choices>
        </hudson.model.ChoiceParameterDefinition>
        <hudson.model.TextParameterDefinition>
          <name>Version</name>
          <description>發行的版本</description>
          <defaultValue>1.32GA</defaultValue>
          <trim>false</trim>
        </hudson.model.TextParameterDefinition>
      </parameterDefinitions>
    </hudson.model.ParametersDefinitionProperty>
    <jenkins.model.BuildDiscarderProperty>
      <strategy class="hudson.tasks.LogRotator">
32 33
        <daysToKeep>1</daysToKeep>
        <numToKeep>2</numToKeep>
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
        <artifactDaysToKeep>-1</artifactDaysToKeep>
        <artifactNumToKeep>-1</artifactNumToKeep>
      </strategy>
    </jenkins.model.BuildDiscarderProperty>
  </properties>
  <scm class="hudson.plugins.git.GitSCM" plugin="git@3.9.1">
    <configVersion>2</configVersion>
    <userRemoteConfigs>
      <hudson.plugins.git.UserRemoteConfig>
        <url>https://cm.ylhealth.org/gitlab/ym/CRM/</url>
        <credentialsId>3485e854-8389-40e8-8c86-b94e94e91904</credentialsId>
      </hudson.plugins.git.UserRemoteConfig>
    </userRemoteConfigs>
    <branches>
      <hudson.plugins.git.BranchSpec>
        <name>*/master</name>
      </hudson.plugins.git.BranchSpec>
    </branches>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <submoduleCfg class="list"/>
    <extensions/>
  </scm>
  <assignedNode>MAC_BUILD_Machine</assignedNode>
  <canRoam>false</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers/>
  <concurrentBuild>false</concurrentBuild>
  <builders>
    <hudson.tasks.Shell>
      <command># 建立 release branch
git fetch
EXIST=$(git ls-remote --heads |grep $FLOW/$Version)
if [[ -z &quot;$EXIST&quot; ]]; then
    if [ &quot;$FLOW&quot; == &quot;release&quot; ]; then
        git checkout develop
    else
        git checkout master
    fi
    git pull
    git checkout -b $FLOW/$Version
    git push -u origin $FLOW/$Version
fi</command>
    </hudson.tasks.Shell>
    <hudson.tasks.Shell>
      <command>git fetch
git checkout master
git pull
git checkout develop
git pull
git checkout $FLOW/$Version
git pull
git log master..$FLOW/$Version --pretty=format:&apos;%s&apos;| grep -E -o &apos;[A-Z]+-[0-9]+&apos;| sort|uniq</command>
    </hudson.tasks.Shell>
  </builders>
  <publishers/>
  <buildWrappers>
92
    <hudson.plugins.ws__cleanup.PreBuildCleanup plugin="ws-cleanup@0.36">
93 94 95
      <deleteDirs>false</deleteDirs>
      <cleanupParameter></cleanupParameter>
      <externalDelete></externalDelete>
96
      <disableDeferredWipeout>false</disableDeferredWipeout>
97 98 99
    </hudson.plugins.ws__cleanup.PreBuildCleanup>
  </buildWrappers>
</project>