Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{CI} Migrate azure cli pipelines #24201

Merged
merged 8 commits into from
Oct 17, 2022

Conversation

@ghost ghost added Auto-Assign Auto assign by bot CI CI labels Oct 14, 2022
@ghost ghost requested review from yonzhan, jiasli, kairu-ms and jsntcy October 14, 2022 05:00
@ghost ghost assigned wangzelin007 Oct 14, 2022
@ghost ghost added this to the Oct 2022 (2022-11-01) milestone Oct 14, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Oct 14, 2022

Migrate cli pipelines

@wangzelin007
Copy link
Member Author

/azp where

@azure-pipelines
Copy link

Azure DevOps orgs getting events for this repository:

@azure-pipelines
Copy link

CI/CD Pipelines for this repository:

@Azure Azure deleted a comment from azure-pipelines bot Oct 14, 2022
@Azure Azure deleted a comment from azure-pipelines bot Oct 14, 2022
@wangzelin007
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@@ -187,7 +187,7 @@ msbuild /t:rebuild /p:Configuration=Release %REPO_ROOT%\build_scripts\windows\az

if %errorlevel% neq 0 goto ERROR

start %OUTPUT_DIR%
echo %OUTPUT_DIR%
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using start command in 1ES agent pool gets stuck, replace with echo command.
image
image

python /mnt/vss/_work/1/s/scripts/live_test/monitor.py "$(DB_PWD)" "$(GITHUB_TOKEN)"
Copy link
Member Author

@wangzelin007 wangzelin007 Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After using the 1ES agent pool, the pipeline working directory has changed, need to change /home/vsts/work to /mnt/vss/_work
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use predefined variables instead of hardcoding it to /mnt/vss/_work/1/s?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The building DEB pipeline uses BUILD_SOURCESDIRECTORY as /home/vsts/work/1/s:

-v "$BUILD_SOURCESDIRECTORY":/mnt/repo \

@wangzelin007 wangzelin007 marked this pull request as ready for review October 17, 2022 00:49
@@ -17,7 +17,7 @@


def main():
env = Environment(loader=FileSystemLoader('/home/vsts/work/1/s/scripts/live_test/'))
env = Environment(loader=FileSystemLoader('/mnt/vss/_work/1/s/scripts/live_test/'))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a variable Pipeline.Workspace has the value /home/vsts/work/1, but we still need to hardcode /home/vsts, /home/vsts/work and /home/vsts/work/1/s and etc.
Considering it's a one-time job, can we keep using the hardcoding?

testRunTitle: 'Azure CLI live test results of $(Target)'
# mergeTestResults: true
# testResultsFormat: 'JUnit'
- task: PublishBuildArtifacts@1
condition: succeededOrFailed()
inputs:
PathtoPublish: '/home/vsts/work/1/$(Target).report.json'
PathtoPublish: '/mnt/vss/_work/1/$(Target).report.json'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/home/vsts/work/1 is available as Pipeline.Workspace.

@@ -59,20 +62,20 @@ jobs:
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '/home/vsts/.azdev/env_config/home/vsts/work/1/env/test_results.xml'
testResultsFiles: '/mnt/vss/.azdev/env_config/mnt/vss/_work/1/env/test_results.xml'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

azdev saves its config to ~/.azdev:

https://github.com/Azure/azure-cli-dev-tools/blob/2de5818f37a741a1ae7765ca43126ac2b00d622f/azdev/utilities/config.py#L25

so /mnt/vss should be available as ~ or $HOME.

Copy link
Member Author

@wangzelin007 wangzelin007 Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/home/vsts: Not found
/home/vsts/work: Not found
/home/vsts/work/1: Pipeline.Workspace or Agent.BuildDirectory
/home/vsts/work/1/a: Build.ArtifactStagingDirectory
/home/vsts/work/1/b: Build.BinariesDirectory
/home/vsts/work/1/s: System.DefaultWorkingDirectory or Build.SourcesDirectory
/home/vsts/work/1/TestResults: Common.TestResultsDirectory
/home/cloudtest: ~
/usr/local/vss-agent/2.214.1: Agent.HomeDirectory

@wangzelin007 wangzelin007 merged commit c24f5fc into Azure:dev Oct 17, 2022
avgale pushed a commit to avgale/azure-cli that referenced this pull request Aug 24, 2023
* update agent pool

* Update azure-pipelines.yml

* update

* Update build.cmd

* Update azure-pipelines.yml

* update

* Update azure-pipelines.yml

* update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot CI CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants