1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/weihanli-ActivityReservation

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
azure-pipelines.yml 1.9 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Weihan Li Отправлено 07.01.2022 20:08 43d7549
trigger:
branches:
include:
- '*' # must quote since "*" is a YAML reserved character; we want a string
paths:
include:
- '*'
exclude:
- '**/*.md'
- /OpenReservation.Clients/
- /OpenReservation.API.Test/
- /OpenReservation.SourceGeneratorTest/
- /docs/
- /k8s/
pool:
vmImage: 'ubuntu-latest'
variables:
tagName: '$(Build.BuildNumber)'
repoName: 'reservation-server'
stableImageName: 'openreservation/$(repoName):stable'
latestImageName: 'openreservation/$(repoName):latest'
branchImageName: 'openreservation/$(repoName):$(Build.SourceBranchName)'
imageName: 'openreservation/$(repoName):$(tagName)'
steps:
- task: UseDotNet@2
displayName: 'Use .NET sdk'
inputs:
packageType: sdk
version: 6.0.x
- script: dotnet --info
displayName: 'dotnet info'
- script: dotnet build -c Release
displayName: 'dotnet build'
- script: dotnet test
displayName: 'dotnet test'
- script: docker build -f Dockerfile -t $(imageName) -t $(branchImageName) -t $(latestImageName) -t $(stableImageName) .
displayName: 'Docker build Script'
- script: |
docker login -u $(dockerId) -p $(pswd)
docker push $(imageName)
docker push $(branchImageName)
displayName: 'Push docker image'
- script: |
docker push $(latestImageName)
displayName: 'Push latest image'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
- script: docker push $(stableImageName)
displayName: 'Push stable image'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: SSH@0
displayName: 'Run shell inline on remote machine'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
inputs:
sshEndpoint: 'weihanli-vm'
runOptions: inline
inline: |
kubectl set image deployment/reservation-server reservation-server=$(imageName)

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/weihanli-ActivityReservation.git
git@api.gitlife.ru:oschina-mirror/weihanli-ActivityReservation.git
oschina-mirror
weihanli-ActivityReservation
weihanli-ActivityReservation
dev