Skip to content

Commit

Permalink
[gulp] Set correct ownership on deploy in the /var/www files
Browse files Browse the repository at this point in the history
  • Loading branch information
bitkeeper committed Aug 17, 2023
1 parent f277c49 commit b75e9d7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
* gulp deploy [--test] - Deploys everything needed (inc php etc) {app.deploy}.
* [--force] With the option --test deploy to build/dist (app.dist).
* [--all] Also deploy moodeutl and the /var/local/www dir
* [--remote] Deploy to target Pi by using ssh/scp
*
* Deploy only copy/update, never removes files.
* When used to real don't forget to sudo first
Expand Down Expand Up @@ -398,6 +399,7 @@ gulp.task('patchheader', function (done) {
.pipe($.if('header.php', $.cacheBust({
type: 'timestamp'
})) )
.pipe($.if(!(mode.test()||mode.remote()), $.chown('root','root')))
.pipe($.size({showFiles: true, total: false}))
.pipe(gulp.dest(DEPLOY_LOCATION))
.on('end', done);
Expand All @@ -413,6 +415,7 @@ gulp.task('patchfooter', function (done) {
.pipe($.rename(function (path) {
path.basename += '.min';
}))
.pipe($.if(!(mode.test()||mode.remote()), $.chown('root','root')))
.pipe($.size({showFiles: true, total: false}))
.pipe(gulp.dest(DEPLOY_LOCATION))
.on('end', done);
Expand All @@ -423,6 +426,7 @@ gulp.task('patchindex', function (done) {
.pipe($.if(!mode.force(), $.newer( { dest: pkg.app.dist})))
.pipe($.replace(/indextpl[.]html/g, "indextpl.min.html"))
.pipe($.replace(/footer[.]php/g, "footer.min.php"))
.pipe($.if(!(mode.test()||mode.remote()), $.chown('root','root')))
.pipe($.size({showFiles: true, total: false}))
.pipe(gulp.dest(DEPLOY_LOCATION))
.on('end', done);
Expand All @@ -432,6 +436,7 @@ gulp.task('patchconfigs', function (done) {
return gulp.src(pkg.app.src+'/*-config.php')
.pipe($.if(!mode.force(), $.newer( { dest: pkg.app.dist})))
.pipe($.replace(/footer[.]php/g, "footer.min.php"))
.pipe($.if(!(mode.test()||mode.remote()), $.chown('root','root')))
.pipe($.size({showFiles: true, total: false}))
.pipe(gulp.dest(DEPLOY_LOCATION))
.on('end', done);
Expand All @@ -446,6 +451,7 @@ gulp.task('minifyhtml', function (done) {
.pipe($.rename(function (path) {
path.basename += '.min';
}))
.pipe($.if(!(mode.test()||mode.remote()), $.chown('root','root')))
.pipe($.size({showFiles: true, total: false}))
.pipe(gulp.dest(DEPLOY_LOCATION+'/templates'))
.on('end', done);
Expand Down Expand Up @@ -521,6 +527,7 @@ gulp.task('deployback', gulp.series(['patchheader','patchfooter', 'patchindex',
gulp.task('deployfront', function (done) {
return gulp.src( [pkg.app.dest+'/**/*', '!'+pkg.app.dest+'/index.html'] )
.pipe($.if(!mode.force(), $.newer( { dest: DEPLOY_LOCATION})))
.pipe($.if(!(mode.test()||mode.remote()), $.chown('root','root')))
.pipe(gulp.dest(DEPLOY_LOCATION))
.on('end', done);
});
Expand Down

0 comments on commit b75e9d7

Please sign in to comment.