From 116fbf0fa219bcd6f0b07aa0c7f0e8637aad975e Mon Sep 17 00:00:00 2001 From: mbilker Date: Mon, 21 Dec 2015 11:11:29 -0500 Subject: [PATCH 1/5] fix(appveyor): check if running in PR, disable commands requiring secure variables if so --- appveyor.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index fbd903d1d..7506fd207 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -27,15 +27,19 @@ install: - ps: nuget install secure-file -ExcludeVersion # We need to extract the encrypted private ssh key to clone the submodule. -- ps: secure-file\tools\secure-file -decrypt build\resources\ssh\nylas-n1-ci-ssh-secure-file.enc -secret $env:DECRYPTION_PASSWORD -- ps: mv -Force build\resources\ssh\nylas-n1-ci-ssh-secure-file c:\users\appveyor\.ssh\id_rsa -- ps: git submodule init -# http://stackoverflow.com/questions/21002919/running-a-remote-powershell-script-with-a-git-command-in-it-results-in-nativecom -- ps: Start-Process -FilePath git.exe -ArgumentList 'submodule update' -Wait -NoNewWindow +- ps: | + if ($env:APPVEYOR_PULL_REQUEST_NUMBER) { + secure-file\tools\secure-file -decrypt build\resources\ssh\nylas-n1-ci-ssh-secure-file.enc -secret $env:DECRYPTION_PASSWORD + mv -Force build\resources\ssh\nylas-n1-ci-ssh-secure-file c:\users\appveyor\.ssh\id_rsa + git submodule init -- ps: secure-file\tools\secure-file -decrypt build\resources\nylas\encrypted_certificates\appveyor\win-nylas-n1.p12.enc -secret $env:DECRYPTION_PASSWORD -- ps: secure-file\tools\secure-file -decrypt build\resources\nylas\encrypted_certificates\appveyor\set_win_env.ps1.enc -secret $env:DECRYPTION_PASSWORD -- ps: . build\resources\nylas\encrypted_certificates\appveyor\set_win_env.ps1 + # http://stackoverflow.com/questions/21002919/running-a-remote-powershell-script-with-a-git-command-in-it-results-in-nativecom + Start-Process -FilePath git.exe -ArgumentList 'submodule update' -Wait -NoNewWindow + + secure-file\tools\secure-file -decrypt build\resources\nylas\encrypted_certificates\appveyor\win-nylas-n1.p12.enc -secret $env:DECRYPTION_PASSWORD + secure-file\tools\secure-file -decrypt build\resources\nylas\encrypted_certificates\appveyor\set_win_env.ps1.enc -secret $env:DECRYPTION_PASSWORD + . build\resources\nylas\encrypted_certificates\appveyor\set_win_env.ps1 + } build_script: - ps: .\script\cibuild.ps1 From ce7f50604c5ade45ec790c63bd8b5c9ff9e009c2 Mon Sep 17 00:00:00 2001 From: mbilker Date: Mon, 21 Dec 2015 11:14:28 -0500 Subject: [PATCH 2/5] fix(appveyor): increase verbosity for testing --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7506fd207..1339c45de 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,8 +20,8 @@ deploy: off # We need to only clone the main module because our submodule requires the # encrypted ssh key to access submodules clone_depth: 1 -build: - verbosity: minimal +#build: +# verbosity: minimal install: - ps: Install-Product node $env:NODE_VERSION $env:PLATFORM - ps: nuget install secure-file -ExcludeVersion From 3c88a5764f8f0a07d8b57d6c836a0ea98c04532e Mon Sep 17 00:00:00 2001 From: mbilker Date: Mon, 21 Dec 2015 11:24:28 -0500 Subject: [PATCH 3/5] fix(appveyor): now working, YAML parses correctly --- appveyor.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 1339c45de..6522b4a97 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -28,18 +28,18 @@ install: # We need to extract the encrypted private ssh key to clone the submodule. - ps: | - if ($env:APPVEYOR_PULL_REQUEST_NUMBER) { - secure-file\tools\secure-file -decrypt build\resources\ssh\nylas-n1-ci-ssh-secure-file.enc -secret $env:DECRYPTION_PASSWORD - mv -Force build\resources\ssh\nylas-n1-ci-ssh-secure-file c:\users\appveyor\.ssh\id_rsa - git submodule init + if ($env:APPVEYOR_PULL_REQUEST_NUMBER) { + secure-file\tools\secure-file -decrypt build\resources\ssh\nylas-n1-ci-ssh-secure-file.enc -secret $env:DECRYPTION_PASSWORD + mv -Force build\resources\ssh\nylas-n1-ci-ssh-secure-file c:\users\appveyor\.ssh\id_rsa + git submodule init - # http://stackoverflow.com/questions/21002919/running-a-remote-powershell-script-with-a-git-command-in-it-results-in-nativecom - Start-Process -FilePath git.exe -ArgumentList 'submodule update' -Wait -NoNewWindow + # http://stackoverflow.com/questions/21002919/running-a-remote-powershell-script-with-a-git-command-in-it-results-in-nativecom + Start-Process -FilePath git.exe -ArgumentList 'submodule update' -Wait -NoNewWindow - secure-file\tools\secure-file -decrypt build\resources\nylas\encrypted_certificates\appveyor\win-nylas-n1.p12.enc -secret $env:DECRYPTION_PASSWORD - secure-file\tools\secure-file -decrypt build\resources\nylas\encrypted_certificates\appveyor\set_win_env.ps1.enc -secret $env:DECRYPTION_PASSWORD - . build\resources\nylas\encrypted_certificates\appveyor\set_win_env.ps1 - } + secure-file\tools\secure-file -decrypt build\resources\nylas\encrypted_certificates\appveyor\win-nylas-n1.p12.enc -secret $env:DECRYPTION_PASSWORD + secure-file\tools\secure-file -decrypt build\resources\nylas\encrypted_certificates\appveyor\set_win_env.ps1.enc -secret $env:DECRYPTION_PASSWORD + . build\resources\nylas\encrypted_certificates\appveyor\set_win_env.ps1 + } build_script: - ps: .\script\cibuild.ps1 From fbdf4b840a1e9f6317433a0fdda789cf4f41d181 Mon Sep 17 00:00:00 2001 From: mbilker Date: Mon, 21 Dec 2015 11:27:26 -0500 Subject: [PATCH 4/5] fix(appveyor): return build verbosity to normal --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 6522b4a97..7adf8ccd1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,8 +20,8 @@ deploy: off # We need to only clone the main module because our submodule requires the # encrypted ssh key to access submodules clone_depth: 1 -#build: -# verbosity: minimal +build: + verbosity: minimal install: - ps: Install-Product node $env:NODE_VERSION $env:PLATFORM - ps: nuget install secure-file -ExcludeVersion From 6fa019e4c189d135366aea893c8b17fc91cc1294 Mon Sep 17 00:00:00 2001 From: mbilker Date: Mon, 21 Dec 2015 20:28:19 -0500 Subject: [PATCH 5/5] fix(appveyor): check if the decryption password env variable is set --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 7adf8ccd1..294d3c367 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -28,7 +28,7 @@ install: # We need to extract the encrypted private ssh key to clone the submodule. - ps: | - if ($env:APPVEYOR_PULL_REQUEST_NUMBER) { + if ($env:DECRYPTION_PASSWORD) { secure-file\tools\secure-file -decrypt build\resources\ssh\nylas-n1-ci-ssh-secure-file.enc -secret $env:DECRYPTION_PASSWORD mv -Force build\resources\ssh\nylas-n1-ci-ssh-secure-file c:\users\appveyor\.ssh\id_rsa git submodule init