-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathazure-pipelines.yml
141 lines (125 loc) · 3.99 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: '$(BuildID).$(DayOfYear)$(Year:yy)'
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- README.md
- ChiaInfoRetriever/
pool:
vmImage: 'ubuntu-latest'
variables:
solution: 'Backend.sln'
buildConfiguration: 'Release'
versionNumber: '0.1.$(Build.BuildNumber)'
devEnvironment: 'pawket-api-dev'
stages:
- stage: build
displayName: Build
jobs:
- job: Build
steps:
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: 'restore'
projects: '$(solution)'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: 'build'
projects: '$(solution)'
arguments: '--configuration $(buildConfiguration) /p:Version=$(versionNumber)'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: '**/*Test*.csproj'
arguments: '-o "$(Build.BinariesDirectory)"'
workingDirectory: '$(Build.BinariesDirectory)'
displayName: test
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
arguments: '-o "$(Build.ArtifactStagingDirectory)" /p:Version=$(versionNumber) -c $(buildConfiguration)'
workingDirectory: '$(Build.SourcesDirectory)/WalletServer'
displayName: publish
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
arguments: '-o "$(Build.BinariesDirectory)/nodetemp" /p:Version=$(versionNumber) -c $(buildConfiguration)'
workingDirectory: '$(Build.SourcesDirectory)/NodeDBSyncer'
zipAfterPublish: false
publishWebProjects: false
displayName: publish
- task: CmdLine@2
inputs:
workingDirectory: '$(Build.BinariesDirectory)/nodetemp'
script: |
mv runtimes legacy
mkdir runtimes
#mv legacy/unix runtimes/
#mv legacy/win runtimes/
#mv legacy/win-x64 runtimes/
mv legacy/linux-x64 runtimes/
rm -rf legacy
displayName: 'select runtime'
- task: CopyFiles@2
inputs:
SourceFolder: '$(build.SourcesDirectory)'
Contents: |
deploy.sh
control.sh
TargetFolder: '$(build.ArtifactStagingDirectory)'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)/nodetemp'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/NodeDBSyncer.zip'
replaceExistingArchive: true
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'Pawket-Server'
publishLocation: 'Container'
#- stage: dev
# displayName: dev
# condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))
# dependsOn:
# - build
# jobs:
# - deployment: devdeploy
# displayName: devDeploy
# timeoutInMinutes: 10
# cancelTimeoutInMinutes: 1
# environment: $(devEnvironment)
# strategy:
# runOnce:
# deploy:
# steps:
# - task: DownloadBuildArtifacts@0
# inputs:
# buildType: 'current'
# downloadType: 'single'
# artifactName: '$(artifactName)'
# downloadPath: '$(System.ArtifactsDirectory)'
# - task: CopyFilesOverSSH@0
# inputs:
# sshEndpoint: 'gateway'
# sourceFolder: '$(System.ArtifactsDirectory)'
# contents: '**'
# targetFolder: 'opsplatform'
# readyTimeout: '20000'
# failOnEmptySource: true
# - task: SSH@0
# inputs:
# sshEndpoint: 'gateway'
# runOptions: 'inline'
# inline: |
# cd ~/opsplatform/DecOpsPlatform
# unzip -o Web.zip && source ~/.bashrc
# daemon --name=decops --restart
# if [ $? -ne 0 ]; then nohup daemon --name="decops" -v --respawn -f --output=daemon.log dotnet Web.dll >/dev/null 2>&1 & fi
# readyTimeout: '20000'