Skip to content

Commit

Permalink
Add gulp compress task (#3916)
Browse files Browse the repository at this point in the history
  • Loading branch information
jekkos committed May 1, 2024
1 parent 2b016f5 commit f0a24ed
Show file tree
Hide file tree
Showing 4 changed files with 576 additions and 205 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Expand Up @@ -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:
Expand All @@ -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"
- sudo 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"
Expand Down
9 changes: 9 additions & 0 deletions gulpfile.js
Expand Up @@ -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
Expand All @@ -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'));
Expand Down

0 comments on commit f0a24ed

Please sign in to comment.