Add gulp compress task (#3916)

This commit is contained in:
jekkos
2024-05-01 00:14:09 +02:00
committed by jekkos
parent c9c6a88c5d
commit 8f52e283bb
4 changed files with 576 additions and 205 deletions

View File

@@ -17,7 +17,7 @@ script:
- sed -i "s/commit_sha1 = 'dev'/commit_sha1 = '$rev'/g" app/Config/OSPOS.php
- echo "$version-$branch-$rev"
- npm version "$version-$branch-$rev" --force || true
- npm ci && npm install -g gulp && npm run build
- npm ci && npm install -g gulp && npm run build
- docker build . --target ospos -t ospos
- docker build app/Database/ -t "jekkos/opensourcepos:sql-$TAG"
env:
@@ -28,7 +28,8 @@ env:
after_success:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" && docker tag "ospos:latest"
"jekkos/opensourcepos:$TAG" && docker push "jekkos/opensourcepos:$TAG" && docker push "jekkos/opensourcepos:sql-$TAG"
- sudo mv dist/opensourcepos.tgz "dist/opensourcepos.$version.$rev.tgz"
- gulp compress
- sudo mv dist/opensourcepos.tar.gz "dist/opensourcepos.$version.$rev.tgz"
- sudo mv dist/opensourcepos.zip "dist/opensourcepos.$version.$rev.zip"
before_deploy:
- npm set //npm.pkg.github.com/:_authToken "$NPM_TOKEN"

View File

@@ -11,6 +11,9 @@ import inject from 'gulp-inject'
import logStream from 'gulp-debug'
import series from 'stream-series'
import header from 'gulp-header'
import tar from 'gulp-tar'
import gzip from 'gulp-gzip'
import zip from 'gulp-zip'
import { Stream } from 'readable-stream'
const {finished, pipeline} = Stream.promises
@@ -27,6 +30,12 @@ gulp.task('clean', function () {
);
});
gulp.task('compress', function() {
const sources = ['public/**', 'vendor/**', '*.md', 'LICENSE', 'docker*', 'docker/**', 'Dockerfile', '**/.htaccess', 'writable/*'] ;
gulp.src(sources).pipe(tar('opensourcepos.tar')).pipe(gzip()).pipe(gulp.dest('dist'));
return gulp.src(sources).pipe(zip('opensourcepos.zip')).pipe(gulp.dest('dist'));
});
// Copy the bootswatch styles into their own folder so OSPOS can select one from the collection
gulp.task('copy-bootswatch', function() {
pipeline(gulp.src('./node_modules/bootswatch/cerulean/*.min.css'),gulp.dest('public/resources/bootswatch/cerulean'));

764
package-lock.json generated
View File

File diff suppressed because it is too large Load Diff

View File

@@ -44,6 +44,9 @@
"coffeescript": "^2.7.0",
"es6-promise": "^4.2.8",
"file-saver": "^2.0.5",
"gulp-gzip": "^1.4.2",
"gulp-tar": "^4.0.0",
"gulp-zip": "^6.0.0",
"html2canvas": "^1.4.1",
"jasny-bootstrap": "^3.1.3",
"jquery": "^3.7.1",