deploy task tweaks

This commit is contained in:
Matthias Kretschmann 2020-06-02 00:49:57 +02:00
parent dfdfa949ff
commit ef8e5117fc
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 3674 additions and 22 deletions

View File

@ -3,18 +3,10 @@
> Highlighting Botero's cat sculpture in El Raval, Barcelona<br>
> [https://kretschmann.cat](https://kretschmann.cat)
[![build status](https://www.git.berlin/kremalicious/kretschmann.cat/badges/master/build.svg)](https://www.git.berlin/kremalicious/kretschmann.cat/commits/master)
---
## Deployment
Just push to master and git.berlin CI will do the rest.
### Manual deployment
#### Prerequisite: Authentication
To deploy the site, you must authenticate yourself against the AWS API with your AWS credentials. Get your AWS access key and secret and add them to `~/.aws/credentials`:
```
@ -23,17 +15,14 @@ aws_access_key_id = <YOUR_ACCESS_KEY_ID>
aws_secret_access_key = <YOUR_SECRET_ACCESS_KEY>
```
#### Fire deployment task
Continue with installing dependencies:
```bash
npm install -g gulp
npm install
```
And finally deploy:
```bash
gulp deploy
npm run deploy
```

View File

@ -20,22 +20,19 @@ gulp.task('deploy', function() {
// create publisher, define config
var publisher = awspublish.create({
params: {
'Bucket': S3BUCKET
Bucket: S3BUCKET
},
'accessKeyId': process.env.AWS_ACCESS_KEY,
'secretAccessKey': process.env.AWS_SECRET_KEY,
'region': S3REGION
region: S3REGION
});
// define custom headers
var headers = {
'Cache-Control': 'max-age=315360000, no-transform, public'
'Cache-Control': 'public,max-age=0,must-revalidate'
};
return gulp.src(DIST + '**/*')
.pipe(publisher.publish(headers))
.pipe(publisher.sync()) // delete files in bucket that are not in local folder
.pipe(publisher.cache())
.pipe(awspublish.reporter({
states: ['create', 'update', 'delete']
}));

3665
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,11 +7,12 @@
},
"homepage": "https://kretschmann.cat",
"main": "gulpfile.js",
"devDependencies": {
"gulp-awspublish": ">=3.0.0"
"scripts": {
"deploy": "gulp deploy"
},
"engines": {
"node": ">=0.10.29"
"devDependencies": {
"gulp": "^4.0.2",
"gulp-awspublish": ">=4.1.1"
},
"private": true,
"repository": {