Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moves site to S3 and adds deployment command #2

Merged
merged 1 commit into from May 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file modified .gitignore
Binary file not shown.
27 changes: 27 additions & 0 deletions Gulpfile.js
@@ -0,0 +1,27 @@
var fs = require('fs');
var gulp = require('gulp');
var awspublish = require('gulp-awspublish');
var parallelize = require("concurrent-transform");

gulp.task('aws-deploy', function() {
var creds = JSON.parse(fs.readFileSync('./aws.json'));

var publisher = awspublish.create({
"params": {
"Bucket": creds.bucket
},
"accessKeyId": creds.key,
"secretAccessKey": creds.secret,
"region": creds.region
});

var headers = {
'Cache-Control': 'max-age=86400, public'
};

return gulp
.src(['**/*', '!**/node_modules/', '!**/node_modules/**', '!aws.json', '!Gulpfile.js', '!Gruntfile.js', '!*.md', '!package.json'])
.pipe(parallelize(publisher.publish(headers), 50))
.pipe(publisher.cache())
.pipe(awspublish.reporter());
});
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -19,6 +19,7 @@ Prerequisites

* NPM
* Grunt
* Gulp (for deployment only)

Installation
--
Expand All @@ -35,3 +36,12 @@ Compiling the site
```bash
grunt watch
```

Deployment
--

You will need the deployment keys for `machine-user-deploy-noob` to do this, then run:

```bash
gulp deploy
```
17 changes: 12 additions & 5 deletions package.json
@@ -1,14 +1,21 @@
{
"name": "noob",
"version": "0.0.1",
"dependencies": {
"version": "0.0.2",
"repository": {
"type": "git",
"url": "git+https://github.com/gavd/neveroutofbeta"
},
"license": "MIT",
"devDependencies": {
"grunt-cli": "latest",
"grunt-contrib-concat": "latest",
"grunt-contrib-uglify": "latest",
"grunt-contrib-sass": "latest",
"grunt-contrib-watch": "latest"
},
"devDependencies": {
"grunt-pleeease": "~1.1.0"
"concurrent-transform": "^1.0.0",
"fs": "0.0.2",
"grunt-pleeease": "~1.1.0",
"gulp": "^3.9.1",
"gulp-awspublish": "^3.2.0"
}
}