fix(build-system): allow DevOps pipeline to leverage webpack (#2670)

* Update devopsbuild task to use webpack & remove AppVeyor environment var

* Added -Force to replace the existing dist folder

* Removed Test-Path
pull/2782/head
Steven Kang 2019-02-01 12:35:21 +13:00 committed by Anthony Lapenna
parent ce13167c98
commit bb8857bddc
3 changed files with 14 additions and 5 deletions

View File

@ -6,7 +6,7 @@ param (
$ErrorActionPreference = "Stop";
$binary = "portainer.exe"
$project_path = (Get-ITEM -Path env:APPVEYOR_BUILD_FOLDER).Value
$project_path = $((Get-Location).Path)
New-Item -Name dist -Path "$project_path" -ItemType Directory | Out-Null
Set-Location -Path "$project_path\api\cmd\portainer"

View File

@ -10,7 +10,7 @@ $project_path = (Get-ITEM -Path env:BUILD_SOURCESDIRECTORY).Value
Set-Item env:GOPATH "$project_path\api"
New-Item -Name dist -Path "$project_path" -ItemType Directory | Out-Null
New-Item -Name dist -Path "$project_path" -ItemType Directory -Force | Out-Null
New-Item -Name portainer -Path "$project_path\api\src\github.com\" -ItemType Directory | Out-Null
Copy-Item -Path "$project_path\api" -Destination "$project_path\api\src\github.com\portainer" -Recurse -Force -ErrorAction:SilentlyContinue

View File

@ -48,9 +48,18 @@ module.exports = function(grunt) {
]);
});
grunt.task.registerTask('devopsbuild', 'devopsbuild:<platform>:<arch>', function(p, a) {
grunt.task.run(['config:prod', 'clean:all', 'shell:buildBinaryOnDevOps:' + p + ':' + a, 'shell:downloadDockerBinary:' + p + ':' + a, 'before-copy', 'copy:assets', 'after-copy']);
});
grunt.task.registerTask('devopsbuild', 'devopsbuild:<platform>:<arch>',
function(p, a) {
grunt.task.run([
'config:prod',
'env:prod',
'clean:all',
'copy:templates',
'shell:buildBinaryOnDevOps:' + p + ':' + a,
'shell:downloadDockerBinary:' + p + ':' + a,
'webpack:prod'
]);
});
grunt.registerTask('lint', ['eslint']);