Skip to content

Commit a45c14a

Browse files
committed
chore(tests): add appveyor environment variables to travis yml
This adds the needed environment variables to travis.yml so that it can trigger an appveyor build run.
1 parent 7910e4f commit a45c14a

File tree

5 files changed

+28
-2
lines changed

5 files changed

+28
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ coverage/
44
artifacts/
55
/dist
66
npm-debug.log
7+
test/tools/trigger-appveyor-tests.sh

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/meta
22
/src
33
/test
4+
test/tools/trigger-appveyor-tests.sh

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@ after_success:
2929
- npm run semantic-release
3030
env:
3131
global:
32-
secure: OO4CoV+EKtMQjNWz4vsOAuV4AZHeBJnlr0VMHLI7YK5ay31p8k+40FVoO7tnWnmB7OSfxOQpu7Bpb3d1saru5Y8oBDsFrkhFvdyPiy8FslPk6YC9GjKVYLzS+YJtJsH88eDbRgTOtFHACchY1G3zSGyhQNIYqdKt35OP//41vYDs3P6JDgd/OFXF+rTFRvwmt+Btu2GZXPuFNI1naPaTTrWMsZ8msw3i51sXgpP1KIEssye6DYulOm5YwsYhmyyitjAORtbfWXYCrfjA7Fm5ZqtbR97r/+8r3iyZk4cZCakKPN6SAO1erpAATrvjDKFvgBhH67eAa1Qf1Uki4Cp2rwaDDdP9BEgldwlw/Lrsy29unybK94LWGZF0EGZfdvoFg678ujCumYvAJM3jOxRPJqj0vedcyfOs6KDQ9qfX3TwRhsqDy6AqlMzdQ6kyqlo75JaY1U/2iRPZe2dfOzUy2I6eLvUe/YzwPrbttlv/iqFHgQA0F2bbCwKSX8JmRIz5fmLFBlt8G0wdq+8dgKUZfFzb0nbtPGzEcCOOlVhCUxrTtLrH/w8og5O17NoiUuwaHCQSmSig/Xc8698+Ljla2nSNhN+Mm90PdYiadyHfy6+rOit7uaVN9MWCAkUEeicLRL2Rj5IOj5ItDNmDEWneLmNOQH1PB5154UBejCy868g=
32+
- AV_ACCOUNTNAME: jimthedev
33+
- AV_PROJECTSLUG: cz-cli
34+
- AV_BRANCH: master
35+
- secure: OO4CoV+EKtMQjNWz4vsOAuV4AZHeBJnlr0VMHLI7YK5ay31p8k+40FVoO7tnWnmB7OSfxOQpu7Bpb3d1saru5Y8oBDsFrkhFvdyPiy8FslPk6YC9GjKVYLzS+YJtJsH88eDbRgTOtFHACchY1G3zSGyhQNIYqdKt35OP//41vYDs3P6JDgd/OFXF+rTFRvwmt+Btu2GZXPuFNI1naPaTTrWMsZ8msw3i51sXgpP1KIEssye6DYulOm5YwsYhmyyitjAORtbfWXYCrfjA7Fm5ZqtbR97r/+8r3iyZk4cZCakKPN6SAO1erpAATrvjDKFvgBhH67eAa1Qf1Uki4Cp2rwaDDdP9BEgldwlw/Lrsy29unybK94LWGZF0EGZfdvoFg678ujCumYvAJM3jOxRPJqj0vedcyfOs6KDQ9qfX3TwRhsqDy6AqlMzdQ6kyqlo75JaY1U/2iRPZe2dfOzUy2I6eLvUe/YzwPrbttlv/iqFHgQA0F2bbCwKSX8JmRIz5fmLFBlt8G0wdq+8dgKUZfFzb0nbtPGzEcCOOlVhCUxrTtLrH/w8og5O17NoiUuwaHCQSmSig/Xc8698+Ljla2nSNhN+Mm90PdYiadyHfy6+rOit7uaVN9MWCAkUEeicLRL2Rj5IOj5ItDNmDEWneLmNOQH1PB5154UBejCy868g=

test/tools/trigger-appveyor-tests.EXAMPLE.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
# AV_BRANCH=master \
55
# AV_TOKEN=my_appveyor_api_token
66

7-
command="node trigger-appveyor-tests.js"
7+
DIR="$(cd "$(dirname "$0")" && pwd)"
8+
command="node $DIR/trigger-appveyor-tests.js"
89

910
safeRunCommand() {
1011
"$@"

test/tools/trigger-appveyor-tests.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
var axios = require('axios');
22

3+
var requiredEnvironmentVariables = [
4+
'AV_ACCOUNTNAME',
5+
'AV_PROJECTSLUG',
6+
'AV_TOKEN'
7+
];
8+
9+
for(var e=0;e<requiredEnvironmentVariables.length;e++)
10+
{
11+
console.log('checking', requiredEnvironmentVariables[e]);
12+
ensureEnvironmentVariableIsSet(requiredEnvironmentVariables[e]);
13+
}
14+
315
axios({
416
method: 'post',
517
url: 'https://ci.appveyor.com/api/builds',
@@ -30,4 +42,12 @@ axios({
3042
function die() {
3143
console.error('\nERROR: I could not start the Windows test suite on AppVeyor.\n\nPlease ensure that you\'ve set the following environment variables: AV_ACCOUNTNAME, AV_BRANCH, AV_PROJECTSLUG and the following secure (encrypted) TravisCI environment variables: AV_BEARER. \n\nHint: Are you sure you\'ve regenerated the encrypted / secure environment variabes in the .travis.yml? The ones included by default in that file are the repo maintainers and will not work on your fork of this project.\n');
3244
process.exit(1);
45+
}
46+
47+
function ensureEnvironmentVariableIsSet(envName) {
48+
if(!process.env[envName])
49+
{
50+
console.error('ERROR: The environment variable '+ envName + ' was not set and is required to run windows tests.');
51+
process.exit(1);
52+
}
3353
}

0 commit comments

Comments
 (0)