前提条件
- Azureにログインしていること
- gitlabrunnerがインストールされていること
- sshツールは下記のものを使用すること
github.com
tages:
- build
- test
- test_failed
- test_succeed
build_job_test_win:
stage: build
script:
- az vm start --name myVmMachine --resource-group myResourceGroup
- sleep xx
$IPAAA =az vm show -d --resource-group $myResourceGroup --name $myVmMachine --query publicIps -o tsv
echo $IPAAA
ssh -o "StrictHostKeyChecking=no" userName@接続先IP
- az vm stop --name myVmMachine --resource-group myResourceGroup
- az vm deallocate --name myVmMachine --resource-group myResourceGroup
test:
stage: test
script:
- cp autoTestExample.exe .
- ./autoTestExample.exe -o report.xml,xunitxml
artifacts:
when: always
reports:
junit: report.xml
test_succeed:
stage: test_succeed
script:
- echo "OK"
when: on_success
test_failed:
stage: test_failed
script:
- echo "NG"
- cp redmine_issue.ps1 .
- PowerShell -ExecutionPolicy RemoteSigned ./redmine_issue.ps1 XXX
when: on_failure