From 99bf461231e40f40dc1c7227629d6bb7549030f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Tu=E1=BA=A5n=20D=C5=A9ng?= Date: Sat, 20 Apr 2019 18:52:07 +0700 Subject: [PATCH 1/6] Integrate compiled hestia instead of self-compiling --- appveyor.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 6c7ae1af..ad32c04c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,18 +15,26 @@ platform: - x86 - x64 install: -- cmd: >- - npm install --global npm@latest +- ps: >- + $repo = "vnma0/hestia" - git clone "https://github.com/vnma0/hestia.git" -b master --single-branch "..\hestia" + $releases_url = "https://api.github.com/repos/$repo/releases/latest" - cd ..\hestia + Write-Host Determining latest release of Hestia + $get_res = (Invoke-WebRequest $releases_url | ConvertFrom-Json) + Write-Host Hestia: $get_res.tag_name - npm install + Write-Host Downloading latest release + $asset_name = $get_res.assets[0].name + $asset_url = $get_res.assets[0].browser_download_url + Invoke-WebRequest $asset_url -Out $asset_name - npm run build + Write-Host Extracting latest release + Remove-Item -path .\public -Recurse -Force + Expand-Archive $asset_name -DestinationPath .\public + Remove-Item $asset_name - xcopy .\build ..\wafter\public\ /s /e + Write-Host Successfully installed Hestia cd ..\wafter From f3c69f8f9a10b2b0c3304dd389417db7a895754a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Tu=E1=BA=A5n=20D=C5=A9ng?= Date: Sat, 20 Apr 2019 18:58:00 +0700 Subject: [PATCH 2/6] Organize procedure --- appveyor.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ad32c04c..b91684d6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,6 +15,9 @@ platform: - x86 - x64 install: +- cmd: >- + npm install +before_build: - ps: >- $repo = "vnma0/hestia" @@ -35,10 +38,6 @@ install: Remove-Item $asset_name Write-Host Successfully installed Hestia - - cd ..\wafter - - npm install build_script: - cmd: >- npm run pkg From b488a19e27ee0f9112784439f63d5ad340afc05a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Tu=E1=BA=A5n=20D=C5=A9ng?= Date: Sat, 20 Apr 2019 19:06:33 +0700 Subject: [PATCH 3/6] Move script outside so dev can quickly get latest version of hestia --- appveyor.yml | 20 +------------------- hestia.ps1 | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 19 deletions(-) create mode 100644 hestia.ps1 diff --git a/appveyor.yml b/appveyor.yml index b91684d6..19d3a8a6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,25 +19,7 @@ install: npm install before_build: - ps: >- - $repo = "vnma0/hestia" - - $releases_url = "https://api.github.com/repos/$repo/releases/latest" - - Write-Host Determining latest release of Hestia - $get_res = (Invoke-WebRequest $releases_url | ConvertFrom-Json) - Write-Host Hestia: $get_res.tag_name - - Write-Host Downloading latest release - $asset_name = $get_res.assets[0].name - $asset_url = $get_res.assets[0].browser_download_url - Invoke-WebRequest $asset_url -Out $asset_name - - Write-Host Extracting latest release - Remove-Item -path .\public -Recurse -Force - Expand-Archive $asset_name -DestinationPath .\public - Remove-Item $asset_name - - Write-Host Successfully installed Hestia + .\hestia.ps1 > $null build_script: - cmd: >- npm run pkg diff --git a/hestia.ps1 b/hestia.ps1 new file mode 100644 index 00000000..67554367 --- /dev/null +++ b/hestia.ps1 @@ -0,0 +1,19 @@ +$repo = "vnma0/hestia" + +$releases_url = "https://api.github.com/repos/$repo/releases/latest" + +Write-Host Determining latest release of Hestia... +$get_res = Invoke-WebRequest $releases_url | ConvertFrom-Json +Write-Host Hestia: $get_res.tag_name + +Write-Host Downloading latest release... +$asset_name = $get_res.assets[0].name +$asset_url = $get_res.assets[0].browser_download_url +Invoke-WebRequest $asset_url -Out $asset_name + +Write-Host Extracting latest release... +Remove-Item -path .\public -Recurse -Force +Expand-Archive $asset_name -DestinationPath .\public +Remove-Item $asset_name + +Write-Host Successfully installed Hestia \ No newline at end of file From ecb2925aab0ebc0c9e396588498e92d26a3d1aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Tu=E1=BA=A5n=20D=C5=A9ng?= Date: Sat, 20 Apr 2019 19:14:34 +0700 Subject: [PATCH 4/6] Update script to delete "public/" if exist --- hestia.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hestia.ps1 b/hestia.ps1 index 67554367..fa7bbf13 100644 --- a/hestia.ps1 +++ b/hestia.ps1 @@ -12,8 +12,10 @@ $asset_url = $get_res.assets[0].browser_download_url Invoke-WebRequest $asset_url -Out $asset_name Write-Host Extracting latest release... -Remove-Item -path .\public -Recurse -Force +if (-Not (Test-Path -Path .\public)) { + Remove-Item -path .\public -Recurse -Force +} Expand-Archive $asset_name -DestinationPath .\public -Remove-Item $asset_name +Remove-Item $asset_name Write-Host Successfully installed Hestia \ No newline at end of file From ae33b0eba93e4a0e9cbeba73dc5156cc0dd23d50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Tu=E1=BA=A5n=20D=C5=A9ng?= Date: Sat, 20 Apr 2019 19:29:34 +0700 Subject: [PATCH 5/6] Enhance script --- hestia.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hestia.ps1 b/hestia.ps1 index fa7bbf13..d17c6782 100644 --- a/hestia.ps1 +++ b/hestia.ps1 @@ -12,10 +12,10 @@ $asset_url = $get_res.assets[0].browser_download_url Invoke-WebRequest $asset_url -Out $asset_name Write-Host Extracting latest release... -if (-Not (Test-Path -Path .\public)) { +if (Test-Path -Path .\public) { Remove-Item -path .\public -Recurse -Force } Expand-Archive $asset_name -DestinationPath .\public -Remove-Item $asset_name - -Write-Host Successfully installed Hestia \ No newline at end of file +Move-Item -Path .\public\build\* -Destination .\public +Remove-Item .\public\build +Remove-Item $asset_name \ No newline at end of file From 73952dc95432428bbad80b4942a854afd4f7bf1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Tu=E1=BA=A5n=20D=C5=A9ng?= Date: Sat, 20 Apr 2019 21:37:30 +0700 Subject: [PATCH 6/6] Add empty line at the end --- hestia.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hestia.ps1 b/hestia.ps1 index d17c6782..a0827fb1 100644 --- a/hestia.ps1 +++ b/hestia.ps1 @@ -18,4 +18,4 @@ if (Test-Path -Path .\public) { Expand-Archive $asset_name -DestinationPath .\public Move-Item -Path .\public\build\* -Destination .\public Remove-Item .\public\build -Remove-Item $asset_name \ No newline at end of file +Remove-Item $asset_name