我的目标是通过 Azure Pipeline 将我的 python 脚本从 GitHub 部署到我的虚拟机。我已经建立了连接,但是我不知道如何将 GitHub 存储库克隆到虚拟机。我已按照此处的说明进行操作
有一个例子azure-pipeline.yml
,它有以下内容:
jobs:
- deployment: VMDeploy
displayName: Test_script
environment:
name: deploymentenvironment
resourceType: VirtualMachine
strategy:
rolling:
maxParallel: 2 #for percentages, mention as x%
preDeploy:
steps:
- download: current
artifact: drop
- script: echo initialize, cleanup, backup, install certs
deploy:
steps:
- task: Bash@3
inputs:
targetType: 'inline'
script: |
# Modify deployment script based on the app type
echo "Starting deployment script run"
sudo java -jar '$(Pipeline.Workspace)/drop/**/target/*.jar'
routeTraffic:
steps:
- script: echo routing traffic
postRouteTraffic:
steps:
- script: echo health check post-route traffic
on:
failure:
steps:
- script: echo Restore from backup! This is on failure
success:
steps:
- script: echo Notify! This is on success
为了使部署工作,我应该在部署部分放置什么?我想将我的脚本从 GitHub 克隆到特定文件夹并立即启动它。我假设这部分是我需要修改的全部:
# Modify deployment script based on the app type
echo "Starting deployment script run"
sudo java -jar '$(Pipeline.Workspace)/drop/**/target/*.jar'