CI deployment
This commit is contained in:
parent
dd7ea48eec
commit
14c8589179
1
.awspublish-kretschmann.cat
Normal file
1
.awspublish-kretschmann.cat
Normal file
@ -0,0 +1 @@
|
||||
{"index.html":"\"1796b44249fce697b13d7d66f3785d8c\"","assets/gato-del-raval.jpg":"\"ac14e6eccb5af4b70fb58097485a1c7f\"","assets/style.css":"\"12069179d6731702163f4b1080e23896\""}
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
node_modules
|
12
.gitlab-ci.yml
Normal file
12
.gitlab-ci.yml
Normal file
@ -0,0 +1,12 @@
|
||||
image: node:latest
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- node_modules/
|
||||
|
||||
deploy:
|
||||
only:
|
||||
- master
|
||||
script:
|
||||
- npm install
|
||||
- gulp deploy
|
32
README.md
32
README.md
@ -2,6 +2,38 @@
|
||||
|
||||
> Highlighting Botero's cat sculpture in El Raval, Barcelona
|
||||
|
||||
<img src="site/assets/gato-del-raval.jpg" width="400" alt="gato del raval">
|
||||
|
||||
[![build status](https://www.git.berlin/kremalicious/kretschmann.cat/badges/master/build.svg)](https://www.git.berlin/kremalicious/kretschmann.cat/commits/master)
|
||||
|
||||
---
|
||||
|
||||
[https://kretschmann.cat](https://kretschmann.cat)
|
||||
|
||||
## 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`:
|
||||
|
||||
```
|
||||
[default]
|
||||
aws_access_key_id = <YOUR_ACCESS_KEY_ID>
|
||||
aws_secret_access_key = <YOUR_SECRET_ACCESS_KEY>
|
||||
```
|
||||
|
||||
Continue with installing dependencies:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
``
|
||||
|
||||
And finally deploy:
|
||||
|
||||
```bash
|
||||
gulp deploy
|
||||
``
|
||||
|
42
gulpfile.js
Normal file
42
gulpfile.js
Normal file
@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
|
||||
var gulp = require('gulp'),
|
||||
awspublish = require('gulp-awspublish')
|
||||
|
||||
// paths
|
||||
var DIST = './site/';
|
||||
|
||||
// deployment
|
||||
var S3BUCKET = 'kretschmann.cat',
|
||||
S3REGION = 'eu-central-1';
|
||||
|
||||
|
||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
// Deployment
|
||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
gulp.task('deploy', function() {
|
||||
|
||||
// create publisher, define config
|
||||
var publisher = awspublish.create({
|
||||
params: {
|
||||
'Bucket': S3BUCKET
|
||||
},
|
||||
'accessKeyId': process.env.AWS_ACCESS_KEY,
|
||||
'secretAccessKey': process.env.AWS_SECRET_KEY,
|
||||
'region': S3REGION
|
||||
});
|
||||
|
||||
// define custom headers
|
||||
var headers = {
|
||||
'Cache-Control': 'max-age=315360000, no-transform, public'
|
||||
};
|
||||
|
||||
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']
|
||||
}));
|
||||
});
|
22
package.json
Normal file
22
package.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "kretschmann-cat",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Matthias Kretschmann",
|
||||
"email": "m@kretschmann.io"
|
||||
},
|
||||
"homepage": "https://kretschmann.cat",
|
||||
"main": "gulpfile.js",
|
||||
"devDependencies": {
|
||||
"gulp": ">=3.9.0",
|
||||
"gulp-awspublish": ">=3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.29"
|
||||
},
|
||||
"private": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://www.git.berlin/kremalicious/kretschmann.cat.git"
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
Loading…
Reference in New Issue
Block a user