Skip to content

Commit

Permalink
Schedule jobs for creating release PR from mgmt. SDK release request (A…
Browse files Browse the repository at this point in the history
  • Loading branch information
Alancere authored Aug 2, 2022
1 parent ea4b4ae commit 24bcaf5
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
32 changes: 32 additions & 0 deletions eng/pipelines/mgmt-auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
trigger: none

pr: none

schedules:
- cron: "0 1 * * *"
displayName: Daily release
branches:
include:
- main
always: true

stages:
- stage:
jobs:
- job:
displayName: Go Auto Release
steps:
- task: Npm@1
inputs:
command: 'custom'
customCommand: 'install -g autorest@latest'

- task: GoTool@0
inputs:
version: '1.18.2'

- task: ShellScript@2
inputs:
scriptPath: 'eng/scripts/mgmt-auto-release.sh'
cwd: '$(System.DefaultWorkingDirectory)'
args: '$(azuresdk-github-pat)'
28 changes: 28 additions & 0 deletions eng/scripts/mgmt-auto-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
set -ex

export PATH=$PATH:$HOME/go/bin
git config --global user.email "ReleaseHelper"
git config --global user.name "ReleaseHelper"

cd ../
git clone https://github.com/Azure/azure-sdk-for-go.git
git clone https://github.com/Azure/azure-rest-api-specs.git

cd azure-sdk-for-go
git remote add fork https://Azure:"$1"@github.com/Azure/azure-sdk-for-go.git
cd ../

go install github.com/Azure/azure-sdk-for-go/eng/tools/generator@latest

generator issue -t $1 > sdk-release.json
cat sdk-release.json

file_size=`du -b ./sdk-release.json |awk '{print $1}'`
echo "sdk-release.json file size:" ${file_size}
if [ ${file_size} -le 70 ]; then
echo "There are no services that need to be released"
else
echo "run generator release-v2..."
generator release-v2 ./azure-sdk-for-go ./azure-rest-api-specs ./sdk-release.json -t $1
fi
2 changes: 1 addition & 1 deletion eng/tools/generator/cmd/issue/issueCmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (c *commandContext) execute() error {
if err := c.validateConfig(*cfg); err != nil {
return err
}
return reqErr
return nil
}

func (c *commandContext) listIssues() ([]*github.Issue, error) {
Expand Down

0 comments on commit 24bcaf5

Please sign in to comment.