Skip to content

Commit

Permalink
🛠 Improve existing gulp tasks (#7444)
Browse files Browse the repository at this point in the history
refs #7427

- Deleting the `built` or `dist` directory doesn't result in an error, when running `gulp dev`
- Adds default task as `gulp dev`
- Adds abbreviations for the repositories in `gulp setup` task (`--ghost` -> `-g`, `--admin` -> `-a` and `--casper` -> `-c`) to type less 😊
- Installs dependencies on `gulp dev`, if called with `--deps` or `-d`
- Sets `verbose` option nodemon to default (=`false`) to have less unneccessary logging.
- Will do a delete of all dependencies and install them again ('FFS'), if `gulp deps` is called with a force flag.
- Will update submodules not matter what, if `gulp submodules` is called with a force flag. Calling `gulp submodules` without the force flag will only update/initiate the submodules, if the folders don't exist.
- Better logging messages and sequential task handling.
- Removes `gulp-shell` as dependency, as this is on gulp's blacklist
- Refactors code, that used `gulp-shell` to use `child_process.exec` or `spawn` instead.
- Exits properly if node crashes
-----------------------

Tasks available after this PR:

- `gulp server`: Starts a nodemon server with livereload of the ghost core only. No client build here.

- `gulp dev`: [ --deps | -d ] Starts development mode for Ghost, incl. client build and livereload for both. Will also update the submodules if the directories are missing. If called with with `--deps` flag, it will install client and core dependencies.

- `gulp submodules`: [ --force | -f ] Will update the submodules, if directories are missing. Will update no matter what, if called with force flag.

- `gulp deps`: [ --force | -f ] Will update client and core dependencies. Does a fresh install of both (delete, cache clear and install) if called with force flag.

- `gulp setup`: </br>[ --ghost | -g 'branch' or 'pr/1234' ]
		[ --admin | -a 'branch' or 'pr/1234' ]
		[ --casper | -c 'branch' or 'pr/1234' ]
		[ --force | -f ]
		Takes various - optional - parameters. If called without parameters, this task will update submodules first (if directory doesn't exist) and then install client and core dependendies.
		If called with branch 'master', submodules will be updated.
		Calling with the force flag will do a clean install of the dependencies.
		There's no autocomplete for branchnames at the moment 😔
		To check out a PR (e. g. `--ghost pr/7444`), it is necessary, that you add an additional fetch line in the `.git/config` file for each repository: `fetch = +refs/pull/*/head:refs/remotes/upstream/pr/*`. See https://dev.ghost.org/easy-git-pr-test/ for further information.
  • Loading branch information
aileen authored and kirrg001 committed Sep 29, 2016
1 parent 02c7d03 commit 7f3876e
Show file tree
Hide file tree
Showing 2 changed files with 274 additions and 118 deletions.
Loading

0 comments on commit 7f3876e

Please sign in to comment.