[TASK] add drone and npm

This commit is contained in:
Christian Seyfferth 2020-05-12 16:53:34 +02:00
parent 2c1b9e8c31
commit 590a5212f4
5 changed files with 6329 additions and 1 deletions

72
.drone.yml Normal file
View File

@ -0,0 +1,72 @@
kind: pipeline
type: docker
name: default
steps:
- name: Restore Cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount:
- ./node_modules
- ./dist
- name: Build DockerImage
image: docker
volumes:
- name: docker_sock
path: /var/run/docker.sock
commands:
- docker build --no-cache -t gulp-node:1 -f Scripte/Dockerfile .
- name: Build Website
image: gulp-node:1
commands:
- npm install
- gulp
- zip public.zip -r dist/*
- name: Rebuild Cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- ./node_modules
- ./dist
- name: Upload To Gitea-Release
image: plugins/gitea-release
settings:
base_url: https://git.chrosey.de
api_key:
from_secret: gitea_token
files:
- public.zip
when:
event: tag
- name: Upload to Nextcloud
image: gam2046/drone-webdav
settings:
file: public.zip
destination: https://nextcloud.chrosey.de/remote.php/dav/files/chrosey/elkes_homepage/
username:
from_secret: webdav_username
password:
from_secret: webdav_password
when:
event: tag
volumes:
- name: docker_sock
host:
path: /var/run/docker.sock
- name: cache
host:
path: /volume2/docker2/dronecache

3
.gitignore vendored
View File

@ -2,4 +2,5 @@
# https://help.github.com/articles/ignoring-files
# Example .gitignore files: https://github.com/github/gitignore
/bower_components/
/node_modules/
/node_modules/
/dist

187
gulpfile.js Normal file
View File

@ -0,0 +1,187 @@
const {
dest,
parallel,
series,
src,
watch,
} = require('gulp');
const newer = require('gulp-newer');
const imagemin = require('gulp-imagemin');
const htmlclean = require('gulp-htmlclean');
const imageResize = require('gulp-image-resize');
const inject = require('gulp-inject');
const uglify = require('gulp-uglify-es').default;
const favicons = require('gulp-favicons');
const sass = require('gulp-sass');
const browserSync = require('browser-sync');
var server = browserSync.create();
const paths = {
scripts: {
src: 'src/js/*.js',
dest: 'dist/js/'
},
css: {
src: 'src/css/*.css',
dest: 'dist/css'
},
gallery: {
src: 'src/img/gallery/*.jpg',
dest: 'dist/img/gallery/'
},
backgrounds: {
src: 'src/img/backgrounds/*.jpg',
dest: 'dist/img/backgrounds/'
},
header: {
src: 'src/img/header/*.jpg',
dest: 'dist/img/header/'
},
thumbnails: {
src: 'src/img/gallery/*.jpg',
dest: 'dist/img/gallery/thumbs/'
},
html: {
src: 'src/*.html',
dest: 'dist/'
},
pdf: {
src: 'src/pdf/*.pdf',
dest: 'dist/pdf/'
},
gfx: {
src: 'src/gfx/*.pdf',
dest: 'dist/gfx/'
},
font: {
src: 'src/font/*.pdf',
dest: 'dist/font/'
}
};
function gallery() {
return src(paths.gallery.src)
.pipe(newer(paths.images.dest))
.pipe(imageResize({
width: 1200,
height: 900,
crop: false,
upscale: false
}))
.pipe(imagemin({
progressive: true,
optimizationLevel: 5,
svgoPlugins: [{
removeViewBox: false
}, {
removeUselessStrokeAndFill: false
}]
}))
.pipe(dest(paths.images.dest));
}
function backgrounds() {
return src(paths.backgrounds.src)
.pipe(newer(paths.backgrounds.dest))
.pipe(imageResize({
width: 2400,
height: 1800,
crop: false,
upscale: false
}))
.pipe(imagemin({
progressive: true,
optimizationLevel: 5,
svgoPlugins: [{
removeViewBox: false
}, {
removeUselessStrokeAndFill: false
}]
}))
.pipe(dest(paths.images.dest));
}
function thumbnails() {
return src(paths.thumbnails.src)
.pipe(newer(paths.thumbnails.dest))
.pipe(imageResize({
width: 100,
height: 100,
crop: false,
upscale: false
}))
.pipe(imagemin({
progressive: true,
optimizationLevel: 5,
svgoPlugins: [{
removeViewBox: false
}, {
removeUselessStrokeAndFill: false
}]
}))
.pipe(dest(paths.thumbnails.dest));
}
function header() {
return src(paths.header.src)
.pipe(newer(paths.header.dest))
.pipe(imageResize({
width: 1000,
height: 1000,
crop: false,
upscale: false
}))
.pipe(imagemin({
progressive: true,
optimizationLevel: 5,
svgoPlugins: [{
removeViewBox: false
}, {
removeUselessStrokeAndFill: false
}]
}))
.pipe(dest(paths.thumbnails.dest));
}
function js() {
return src(paths.scripts.src)
.pipe(uglify())
.pipe(dest(paths.scripts.dest))
}
function css() {
return src(paths.css.src)
.pipe(dest(paths.css.dest));
}
function html() {
return src(paths.html.src)
.pipe(newer(paths.html.dest))
.pipe(htmlclean())
.pipe(dest(paths.html.dest));
}
function pdf() {
return src(paths.pdf.src)
.pipe(dest(paths.pdf.dest));
}
function gfx() {
return src(paths.gfx.src)
.pipe(dest(paths.gfx.dest));
}
function font() {
return src(paths.font.src)
.pipe(dest(paths.font.dest));
}
function allImages() {
return parallel(gallery, thumbnails, backgrounds, header, gfx);
}
exports.images = allImages;
exports.default = series(parallel(html, pdf, font), js, css, allImages);

6041
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

27
package.json Normal file
View File

@ -0,0 +1,27 @@
{
"name": "restaurant1894",
"version": "1.0.0",
"description": "Webseite für \"www.restaurant1894.de\"",
"main": "index.js",
"dependencies": {},
"devDependencies": {
"gulp": "^4.0.2",
"gulp-image-resize": "^0.13.1",
"gulp-imagemin": "^7.1.0",
"gulp-newer": "^1.4.0",
"gulp-rename": "^2.0.0",
"gulp-uglify-es": "^2.0.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@git.chrosey.de:chrosey/restaurant1894.git"
},
"keywords": [
"Webseite"
],
"author": "chrosey",
"license": "ISC"
}