Skip to content

Commit

Permalink
Allow random upload path in grunt task (closes #461)
Browse files Browse the repository at this point in the history
Path to insert should follow form of: `test/b7IkgoKFWXLNbFk.js`
  • Loading branch information
jbeemster committed Mar 3, 2016
1 parent 4c2e720 commit 7333b94
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Gruntfile.js
Expand Up @@ -197,7 +197,7 @@ module.exports = function(grunt) {
secretAccessKey: '<%= aws.secret %>',
bucket: '<%= aws.bucket %>',
access: 'public-read',
region: 'eu-west-1',
region: '<%= aws.region %>',
gzip: true,
cache: false
},
Expand All @@ -210,7 +210,7 @@ module.exports = function(grunt) {
files: [
{
src: ["dist/sp.js"],
dest: "<%= pkg.version %>/sp.js"
dest: "<%= aws.uploadPath %>"
}
]
},
Expand All @@ -223,7 +223,7 @@ module.exports = function(grunt) {
files: [
{
src: ["dist/sp.js"],
dest: "<%= pkg.pinnedVersion %>/sp.js"
dest: "<%= aws.uploadPath %>"
}
]
}
Expand All @@ -238,14 +238,14 @@ module.exports = function(grunt) {
not_pinned: {
options: {
invalidations: [
'/<%= pkg.version %>/sp.js'
'/<%= aws.uploadPath %>'
]
}
},
pinned: {
options: {
invalidations: [
'/<%= pkg.pinnedVersion %>/sp.js'
'/<%= aws.uploadPath %>'
]
}
}
Expand Down
4 changes: 3 additions & 1 deletion aws.sample.json
Expand Up @@ -2,5 +2,7 @@
"key": "ADD HERE",
"secret": "ADD HERE",
"bucket": "ADD HERE",
"distribution": "ADD HERE"
"region": "ADD HERE",
"distribution": "ADD HERE",
"uploadPath": "ADD HERE"
}
6 changes: 5 additions & 1 deletion vagrant/push/publish-tracker.bash
Expand Up @@ -84,10 +84,14 @@ then
read -e -s secret
echo "Please enter your AWS bucket"
read -e -s bucket
echo "Please enter your AWS region"
read -e -s region
echo "Please enter your AWS distribution"
read -e -s distribution
echo "Please enter your AWS bucket key-path (eg. 'test/b7IkgoKFWXLNbFk.js')"
read -e -s uploadPath

echo "{\"key\":\"$key\",\"secret\":\"$secret\",\"bucket\":\"$bucket\",\"distribution\":\"$distribution\"}" > aws.json
echo "{\"key\":\"$key\",\"secret\":\"$secret\",\"bucket\":\"$bucket\",\"distribution\":\"$distribution\",\"region\":\"$region\",\"uploadPath\":\"$uploadPath\"}" > aws.json

vagrant ssh -c "cd /vagrant && sudo npm install && grunt publish"

Expand Down

0 comments on commit 7333b94

Please sign in to comment.