2020-01-15 14:32:01 -05:00
|
|
|
trigger:
|
|
|
|
batch: true
|
2020-01-15 11:18:02 -05:00
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- releases/*
|
|
|
|
- 2.4-pr
|
|
|
|
paths:
|
|
|
|
exclude:
|
|
|
|
- azure-pipelines.yml
|
|
|
|
- Master/*
|
2019-12-02 16:52:36 -05:00
|
|
|
|
2020-01-15 14:32:01 -05:00
|
|
|
pr: none
|
|
|
|
|
2019-12-02 16:52:36 -05:00
|
|
|
pool:
|
|
|
|
vmImage: 'windows-latest'
|
|
|
|
|
|
|
|
variables:
|
|
|
|
solution: 'IW4MAdmin.sln'
|
|
|
|
buildPlatform: 'Any CPU'
|
|
|
|
buildConfiguration: 'Prerelease'
|
|
|
|
outputFolder: '$(Build.ArtifactStagingDirectory)\Publish\$(buildConfiguration)'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: NuGetToolInstaller@1
|
|
|
|
|
|
|
|
- task: NuGetCommand@2
|
|
|
|
inputs:
|
|
|
|
restoreSolution: '$(solution)'
|
|
|
|
|
|
|
|
- task: PowerShell@2
|
|
|
|
inputs:
|
|
|
|
targetType: 'inline'
|
2019-12-05 17:31:40 -05:00
|
|
|
script: |
|
|
|
|
md -Force lib\open-iconic\font\css
|
|
|
|
wget https://raw.githubusercontent.com/iconic/open-iconic/master/font/css/open-iconic-bootstrap.scss -o lib\open-iconic\font\css\open-iconic-bootstrap.scss
|
2019-12-02 16:52:36 -05:00
|
|
|
failOnStderr: true
|
|
|
|
workingDirectory: '$(Build.Repository.LocalPath)\WebfrontCore\wwwroot'
|
|
|
|
|
2020-01-15 15:00:18 -05:00
|
|
|
- task: projectversionasvariable@1
|
|
|
|
inputs:
|
|
|
|
path: '$(Build.Repository.LocalPath)\Application\Application.csproj'
|
|
|
|
|
2019-12-05 18:09:35 -05:00
|
|
|
- task: VSBuild@1
|
2019-12-05 17:32:23 -05:00
|
|
|
inputs:
|
2019-12-05 18:09:35 -05:00
|
|
|
solution: '$(solution)'
|
2020-01-15 15:06:29 -05:00
|
|
|
msbuildArgs: '/p:DeployOnBuild=false /p:PackageAsSingleFile=false /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)" /p:Version=$(Version.Major).$(Version.Minor).$(Version.Build).$(Build.BuildId)'
|
2019-12-05 18:09:35 -05:00
|
|
|
platform: '$(buildPlatform)'
|
|
|
|
configuration: '$(buildConfiguration)'
|
2019-12-05 17:32:23 -05:00
|
|
|
|
2019-12-02 16:52:36 -05:00
|
|
|
- task: DotNetCoreCLI@2
|
|
|
|
inputs:
|
|
|
|
command: 'publish'
|
|
|
|
publishWebProjects: false
|
|
|
|
projects: |
|
|
|
|
**/WebfrontCore.csproj
|
|
|
|
**/Application.csproj
|
2020-01-15 15:06:29 -05:00
|
|
|
arguments: '-c $(buildConfiguration) -o $(outputFolder) /p:Version=$(Version.Major).$(Version.Minor).$(Version.Build).$(Build.BuildId)'
|
2019-12-02 16:52:36 -05:00
|
|
|
zipAfterPublish: false
|
|
|
|
modifyOutputPath: false
|
2019-12-07 21:00:03 -05:00
|
|
|
|
2019-12-02 16:52:36 -05:00
|
|
|
- task: PowerShell@2
|
|
|
|
inputs:
|
|
|
|
targetType: 'inline'
|
|
|
|
script: 'wget https://raidmax.org/downloads/dos2unix.exe'
|
|
|
|
failOnStderr: true
|
|
|
|
workingDirectory: '$(Build.Repository.LocalPath)\Application\BuildScripts'
|
|
|
|
|
2019-12-07 21:11:22 -05:00
|
|
|
- task: PowerShell@2
|
|
|
|
inputs:
|
|
|
|
filePath: 'PostPublish.ps1'
|
|
|
|
arguments: '$(outputFolder)'
|
|
|
|
failOnStderr: true
|
|
|
|
workingDirectory: '$(Build.Repository.LocalPath)'
|
|
|
|
|
2019-12-02 16:52:36 -05:00
|
|
|
- task: BatchScript@1
|
|
|
|
inputs:
|
|
|
|
filename: 'Application\BuildScripts\PostPublish.bat'
|
|
|
|
workingFolder: '$(Build.Repository.LocalPath)'
|
|
|
|
arguments: '$(outputFolder)'
|
|
|
|
failOnStandardError: true
|
|
|
|
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: |
|
|
|
|
echo changing to encoding for linux start script
|
|
|
|
dos2unix $(outputFolder)\StartIW4MAdmin.sh
|
2020-01-15 16:06:05 -05:00
|
|
|
echo creating website version filename
|
2020-01-15 16:25:34 -05:00
|
|
|
@echo $(Version.Major).$(Version.Minor).$(Version.Build).$(Build.BuildId) > $(Build.ArtifactStagingDirectory)\version_prerelease.txt
|
2019-12-02 16:52:36 -05:00
|
|
|
workingDirectory: '$(Build.Repository.LocalPath)\Application\BuildScripts'
|
|
|
|
|
|
|
|
- task: CopyFiles@2
|
|
|
|
inputs:
|
|
|
|
SourceFolder: '$(Build.Repository.LocalPath)\Plugins\ScriptPlugins'
|
|
|
|
Contents: '*.js'
|
|
|
|
TargetFolder: '$(outputFolder)\Plugins'
|
|
|
|
|
|
|
|
- task: CopyFiles@2
|
|
|
|
inputs:
|
|
|
|
SourceFolder: '$(Build.Repository.LocalPath)\BUILD\Plugins\'
|
|
|
|
Contents: '*.dll'
|
|
|
|
TargetFolder: '$(outputFolder)\Plugins'
|
|
|
|
|
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
|
|
|
script: 'xcopy /s /y /f wwwroot $(outputFolder)\wwwroot'
|
|
|
|
workingDirectory: '$(Build.Repository.LocalPath)\BUILD\Plugins'
|
|
|
|
failOnStderr: true
|
|
|
|
|
2020-01-11 21:50:46 -05:00
|
|
|
- task: CmdLine@2
|
|
|
|
inputs:
|
2020-01-11 22:01:51 -05:00
|
|
|
script: 'echo d | xcopy /s /y /f GameFiles $(outputFolder)\GameFiles'
|
2020-01-11 21:50:46 -05:00
|
|
|
workingDirectory: '$(Build.Repository.LocalPath)'
|
|
|
|
failOnStderr: true
|
|
|
|
|
2019-12-02 16:52:36 -05:00
|
|
|
- task: ArchiveFiles@2
|
|
|
|
inputs:
|
|
|
|
rootFolderOrFile: '$(outputFolder)'
|
|
|
|
includeRootFolder: false
|
|
|
|
archiveType: 'zip'
|
2020-01-15 15:06:29 -05:00
|
|
|
archiveFile: '$(Build.ArtifactStagingDirectory)/IW4MAdmin-$(Version.Major).$(Version.Minor)-$(buildConfiguration)$(Version.Build)b$(Build.BuildId).zip'
|
2019-12-02 16:52:36 -05:00
|
|
|
replaceExistingArchive: true
|
|
|
|
|
|
|
|
- task: FtpUpload@2
|
|
|
|
inputs:
|
|
|
|
credentialsOption: 'inputs'
|
|
|
|
serverUrl: '$(FTPUrl)'
|
|
|
|
username: '$(FTPUsername)'
|
|
|
|
password: '$(FTPPassword)'
|
|
|
|
rootDirectory: '$(Build.ArtifactStagingDirectory)'
|
2020-01-15 16:41:09 -05:00
|
|
|
filePatterns: '*.zip'
|
2019-12-02 16:52:36 -05:00
|
|
|
remoteDirectory: 'IW4MAdmin/Download'
|
|
|
|
clean: false
|
|
|
|
cleanContents: false
|
|
|
|
preservePaths: false
|
|
|
|
trustSSL: false
|
|
|
|
|
2020-01-15 16:41:09 -05:00
|
|
|
- task: FtpUpload@2
|
|
|
|
inputs:
|
|
|
|
credentialsOption: 'inputs'
|
|
|
|
serverUrl: '$(FTPUrl)'
|
|
|
|
username: '$(FTPUsername)'
|
|
|
|
password: '$(FTPPassword)'
|
|
|
|
rootDirectory: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
filePatterns: 'version_prerelease.txt'
|
|
|
|
remoteDirectory: 'IW4MAdmin'
|
|
|
|
clean: false
|
|
|
|
cleanContents: false
|
|
|
|
preservePaths: false
|
|
|
|
trustSSL: false
|
|
|
|
|
|
|
|
- task: GitHubRelease@1
|
|
|
|
inputs:
|
|
|
|
gitHubConnection: 'github.com_RaidMax'
|
|
|
|
repositoryName: 'RaidMax/IW4M-Admin'
|
|
|
|
action: 'create'
|
|
|
|
target: '$(Build.SourceVersion)'
|
|
|
|
tagSource: 'userSpecifiedTag'
|
|
|
|
tag: '$(Version.Major).$(Version.Minor)-$(buildConfiguration)$(Version.Build)b$(Build.BuildId)'
|
|
|
|
title: 'Version $(Version.Major).$(Version.Minor) $(buildConfiguration) Feature $(Version.Build) Build $(Build.BuildId)'
|
|
|
|
assets: '$(Build.ArtifactStagingDirectory)/*.zip'
|
|
|
|
isPreRelease: true
|
|
|
|
releaseNotesSource: 'inline'
|
|
|
|
releaseNotesInline: 'todo'
|
|
|
|
changeLogCompareToRelease: 'lastNonDraftRelease'
|
|
|
|
changeLogType: 'commitBased'
|
2019-12-27 14:45:53 -05:00
|
|
|
|
2020-01-12 17:46:39 -05:00
|
|
|
- task: PowerShell@2
|
|
|
|
inputs:
|
|
|
|
targetType: 'inline'
|
|
|
|
script: |
|
|
|
|
$payload = @{
|
2020-01-15 15:06:29 -05:00
|
|
|
'current-version-prerelease' = '$(Version.Major).$(Version.Minor).$(Version.Build).$(Build.BuildId)'
|
2020-01-12 17:46:39 -05:00
|
|
|
'jwt-secret' = '$(JWTSecret)'
|
|
|
|
} | ConvertTo-Json
|
|
|
|
|
|
|
|
|
|
|
|
$params = @{
|
|
|
|
Uri = 'http://api.raidmax.org:5000/version'
|
|
|
|
Method = 'POST'
|
|
|
|
Body = $payload
|
|
|
|
ContentType = 'application/json'
|
|
|
|
}
|
|
|
|
|
|
|
|
Invoke-RestMethod @params
|
2020-01-12 17:21:31 -05:00
|
|
|
|
2019-12-02 16:52:36 -05:00
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
inputs:
|
|
|
|
targetPath: '$(outputFolder)'
|
|
|
|
artifact: 'IW4MAdmin.$(buildConfiguration)'
|
|
|
|
publishLocation: 'pipeline'
|