Просмотр исходного кода

Maintenance: Moved relevant files for the gulp svg icon build process to assets image folder.

(cherry picked from commit 64f5ec1bd2e3b63651dcb5d84ba38400838c3505)
Dominik Klein 3 лет назад
Родитель
Сommit
eccc9a79a9

+ 6 - 0
.gitignore

@@ -63,6 +63,12 @@
 
 # images
 /public/assets/images/*
+/public/assets/images/yarn.lock
+/public/assets/images/node_modules
+!/public/assets/images/*.sh
+!/public/assets/images/Dockerfile
+!/public/assets/images/package.json
+!/public/assets/images/gulpfile.js
 !/public/assets/images/icons/
 !/public/assets/images/avatar-bg.png
 !/public/assets/images/chat-demo-avatar.png

+ 16 - 0
public/assets/images/Dockerfile

@@ -0,0 +1,16 @@
+FROM node:8-alpine
+
+ENV GULP_DIR "/tmp/gulp"
+
+RUN apk update && apk add bash
+SHELL ["/bin/bash", "-o", "pipefail", "-c"]
+CMD bash # If you want to override CMD
+RUN npm install -g gulp
+
+COPY docker-entrypoint.sh /
+
+# enable volume to generate build files into the hosts FS
+VOLUME ["$GULP_DIR"]
+
+# start
+ENTRYPOINT ["/docker-entrypoint.sh"]

+ 8 - 0
public/assets/images/build.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+set -o errexit
+set -o pipefail
+
+docker build --no-cache -t zammad/svg-icons-build:latest .
+
+docker run --rm -v "$(pwd)/:/tmp/gulp" zammad/svg-icons-build:latest

+ 7 - 0
public/assets/images/docker-entrypoint.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+cd "${GULP_DIR}" || exit
+
+yarn
+
+gulp svgstore

+ 3 - 3
gulpfile.js → public/assets/images/gulpfile.js

@@ -6,7 +6,7 @@ var svgmin = require('gulp-svgmin');
 var cheerio = require('gulp-cheerio');
 var through2 = require('through2');
 
-var iconsource = 'public/assets/images/icons/*.svg'
+var iconsource = 'icons/*.svg'
 
 gulp.task('svgstore', function () {
   return gulp
@@ -47,11 +47,11 @@ gulp.task('svgstore', function () {
       this.push(file);
       cb();
     }))
-    .pipe(gulp.dest('public/assets/images'));
+    .pipe(gulp.dest('./'));
 });
 
 gulp.task('watch', function () {
   gulp.watch(iconsource, ['svgstore']);
 });
 
-gulp.task('default', ['svgstore', 'watch']);
+gulp.task('default', ['svgstore', 'watch']);

+ 0 - 0
package.json → public/assets/images/package.json