|
| 1 | +# The steps to trigger the pipeline to publish the artifacts |
| 2 | + |
| 3 | +parameters: |
| 4 | +- name: artifactName |
| 5 | + type: string |
| 6 | + default: "" |
| 7 | +- name: publishPrefix |
| 8 | + type: string |
| 9 | + default: "$(Build.DefinitionName)/$(Build.SourceBranchName)" |
| 10 | + |
| 11 | +steps: |
| 12 | +- script: | |
| 13 | + . functions.sh |
| 14 | + sonic_version=$(sonic_get_version) |
| 15 | + latest_tag=$(git describe --tags --abbrev=0) |
| 16 | + docker_tags="$sonic_version $(Build.SourceBranchName)" |
| 17 | + if [ "$(Build.SourceBranchName)" == "master" ]; then |
| 18 | + docker_tags="$docker_tags latest" |
| 19 | + fi |
| 20 | + echo "##vso[task.setvariable variable=sonic_version]$sonic_version" |
| 21 | + echo "##vso[task.setvariable variable=latest_tag]$latest_tag" |
| 22 | + echo "##vso[task.setvariable variable=docker_tags]$docker_tags" |
| 23 | + condition: ne(variables['Build.Reason'], 'PullRequest') |
| 24 | + displayName: 'Set trigger build variables' |
| 25 | +- task: TriggerBuild@4 |
| 26 | + condition: ne(variables['Build.Reason'], 'PullRequest') |
| 27 | + inputs: |
| 28 | + definitionIsInCurrentTeamProject: false |
| 29 | + teamProject: internal |
| 30 | + tfsServer: $(System.CollectionUri) |
| 31 | + buildDefinition: 'publish-artifacts' |
| 32 | + queueBuildForUserThatTriggeredBuild: true |
| 33 | + ignoreSslCertificateErrors: false |
| 34 | + useSameSourceVersion: false |
| 35 | + useCustomSourceVersion: false |
| 36 | + useSameBranch: false |
| 37 | + waitForQueuedBuildsToFinish: false |
| 38 | + storeInEnvironmentVariable: true |
| 39 | + authenticationMethod: 'Personal Access Token' |
| 40 | + password: '$(system.accesstoken)' |
| 41 | + enableBuildInQueueCondition: false |
| 42 | + dependentOnSuccessfulBuildCondition: false |
| 43 | + dependentOnFailedBuildCondition: false |
| 44 | + checkbuildsoncurrentbranch: false |
| 45 | + failTaskIfConditionsAreNotFulfilled: false |
| 46 | + buildParameters: '' |
| 47 | + templateParameters: | |
| 48 | + pipelineContext: {"buildId":"$(Build.BuildId)", |
| 49 | + "pipelineId":"$(System.DefinitionId)", |
| 50 | + "project": "$(System.TeamProject)", |
| 51 | + "branchName":"$(Build.SourceBranchName)"}, |
| 52 | + artifactContext: {"artifactName":"${{ parameters.artifactName }}", |
| 53 | + "artifactPatterns":"**/*.bin\n |
| 54 | + **/*.swi\n |
| 55 | + **/*.raw\n |
| 56 | + **/*.img.gz\n |
| 57 | + **/*-rpc.gz\n |
| 58 | + **/python-saithrift*.deb"}, |
| 59 | + publishContext: {"publishPrefix":"${{ parameters.publishPrefix }}", |
| 60 | + "keepArtifactName":false, |
| 61 | + "dockerImagePatterns":"target/*-rpc.gz", |
| 62 | + "dockerTags":"$(docker_tags)", |
| 63 | + "version":"$(sonic_version)", |
| 64 | + "latestTag":"$(latest_tag)"} |
0 commit comments