Skip to content

Commit 7de0f86

Browse files
committed
add cfn template, remove encrypted vars
1 parent e06c977 commit 7de0f86

File tree

4 files changed

+60
-6
lines changed

4 files changed

+60
-6
lines changed

.travis.yml

-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ matrix:
9494
env:
9595
global:
9696
- JOBS: "8"
97-
- secure: PifMOSnn+mWR1RUptXse+fLvWiTrzg0R/mazO7RWhXHWBKv0uAJ/qV3dI0GIRBLtjG10Iy+tT5RNh1TIbBzB9Y67wMcGvylUPG1+3EOKoBMEPnOD9AgCEQw4SOXfGPx0cq2N6ueSKieCgu1yKN9Wq7XCbE+zTk/DiRNIdLirVoo=
98-
- secure: cc4esJY1vPXL31IeumAJoKWDDO2BTGFiltwfO1jbTbiV7QT911QUjTUasxXIVpOaHNCpxSTyevPwwTWfzt2EtF92Lli+qhQ2bbzMiDSBZstSrHdAe62Ai2M1oYYUwk/0cABB/2nO9uRyYwITCxpTSNzZBrYhn3C29WqBhPeVDmM=
9997

10098
before_install:
10199
- export PUBLISHABLE=${PUBLISHABLE:-true}

appveyor.yml

-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
environment:
2-
node_pre_gyp_accessKeyId:
3-
secure: 7DrSVc5eIGtmMcki5H+iRft+Tk3MJTwDBQEUuJHWaQ4=
4-
node_pre_gyp_secretAccessKey:
5-
secure: 1amwJJw9fu0j6dXnc5KsAQbSYf7Cjw/dapT6OZWABa6nc52grkKeLQ+DGaOfQz8i
62
matrix:
73
- nodejs_version: 4
84
platform: x64

cloudformation/ci.template.js

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
var cf = require('@mapbox/cloudfriend');
2+
var package_json = require('../package.json')
3+
4+
module.exports = {
5+
AWSTemplateFormatVersion: '2010-09-09',
6+
Description: 'user for publishing to s3://mapbox-node-binary/' + package_json.name,
7+
Resources: {
8+
User: {
9+
Type: 'AWS::IAM::User',
10+
Properties: {
11+
Policies: [
12+
{
13+
PolicyName: 'list',
14+
PolicyDocument: {
15+
Statement: [
16+
{
17+
Action: ['s3:ListBucket'],
18+
Effect: 'Allow',
19+
Resource: 'arn:aws:s3:::mapbox-node-binary',
20+
Condition : {
21+
StringLike : {
22+
"s3:prefix": [ package_json.name + "/*"]
23+
}
24+
}
25+
}
26+
]
27+
}
28+
},
29+
{
30+
PolicyName: 'publish',
31+
PolicyDocument: {
32+
Statement: [
33+
{
34+
Action: ['s3:DeleteObject', 's3:GetObject', 's3:GetObjectAcl', 's3:PutObject', 's3:PutObjectAcl'],
35+
Effect: 'Allow',
36+
Resource: 'arn:aws:s3:::mapbox-node-binary/' + package_json.name + '/*'
37+
}
38+
]
39+
}
40+
}
41+
]
42+
}
43+
},
44+
AccessKey: {
45+
Type: 'AWS::IAM::AccessKey',
46+
Properties: {
47+
UserName: cf.ref('User')
48+
}
49+
}
50+
},
51+
Outputs: {
52+
AccessKeyId: {
53+
Value: cf.ref('AccessKey')
54+
},
55+
SecretAccessKey: {
56+
Value: cf.getAtt('AccessKey', 'SecretAccessKey')
57+
}
58+
}
59+
};

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"node-pre-gyp"
4545
],
4646
"devDependencies": {
47+
"@mapbox/cloudfriend": "^1.9.0",
4748
"aws-sdk": "2.x",
4849
"eslint": "3.5.0",
4950
"mocha": "3.x"

0 commit comments

Comments
 (0)