Skip to content

Commit

Permalink
update script and README to include V1 and V2
Browse files Browse the repository at this point in the history
  • Loading branch information
tjsilver committed Jun 30, 2021
1 parent b96eb4e commit d2b926c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ You can find the client for the Fronts tool in [fronts-client](/fronts-client).
### Setup (need to be done once)

1. Install [NVM](https://github.com/creationix/nvm).
1. Get credentials from [Janus](https://janus.gutools.co.uk/multi-credentials?&permissionIds=cmsFronts-dev,capi-api-gateway,frontend-dev) (`cmsFronts`, `capi` & `frontend`).
1. Grant [code](https://permissions.code.dev-gutools.co.uk/) permissions (used for local builds as well). You need:
2. Get credentials from [Janus](https://janus.gutools.co.uk/multi-credentials?&permissionIds=cmsFronts-dev,capi-api-gateway,frontend-dev) (`cmsFronts`, `capi` & `frontend`).
3. Grant [code](https://permissions.code.dev-gutools.co.uk/) permissions (used for local builds as well). You need:
1. fronts_access
1. launch_commercial_fronts
1. edit_editorial_fronts
1. edit_editions
1. launch_editorial_fronts
1. configure_fronts
1. From the project root, run `./scripts/setup.sh`.
4. From the project root, run `./scripts/setup.sh`.

### Dev Start

Expand All @@ -29,10 +29,14 @@ You can find the client for the Fronts tool in [fronts-client](/fronts-client).
### Unit tests

- Running server side tests: `sbt test`
- Running client side tests: `grunt test`
- `grunt test --no-single-run` runs the tests in the browser, starts `karma` in debug mode. You can connect your browser at [http://localhost:9876?debug.html](http://localhost:9876?debug.html)

#### Client side tests for V1
- Running client side tests: `npm run test` in project root
- `npm run test:browser` runs the tests in the browser, starts `karma` in debug mode. You can connect your browser at [http://localhost:9876?debug.html](http://localhost:9876?debug.html)
- You can run a single test going to [http://localhost:9876/debug.html?test=collections](http://localhost:9876/debug.html?test=collections), spec files are inside `facia-tool/test/public/spec`.

#### Client side tests for V2
Run `yarn test` in `fronts-client` folder. See [fronts-client](/fronts-client) for more details.
### IT tests with Database

`sbt test database-int:test`
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"private": true,
"description": "Guardian front pages editor",
"scripts": {
"jspm": "jspm"
"jspm": "jspm",
"test": "grunt test",
"test:browser": "grunt test --no-single-run"
},
"dependencies": {
"babel": "6.0.0",
Expand Down
18 changes: 14 additions & 4 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,24 @@ set_node_version() {
fi
}

install_deps_and_build() {
install_v2_deps_and_build() {
cd fronts-client
yarn install
printf "\nCompiling Javascript... \n\r\n\r"
yarn build
cd ..
}

setup_ngnix() {
printf "\n\rSetting up Breaking News tool (Fronts Tool V1) dependencies... \n\r\n\r"

install_v1_deps() {
printf "\n\rInstalling NPM modules \n\r\n\r"
npm install
printf "\n\rInstalling JSPM modules \n\r\n\r"
npm run jspm install
}

setup_nginx() {
brew install guardian/devtools/dev-nginx
dev-nginx setup-app nginx/nginx-mapping.yml
}
Expand All @@ -56,8 +65,9 @@ main() {
bash $DIR/fetch-config.sh
install_yarn
set_node_version
install_deps_and_build
setup_ngnix
install_v2_deps_and_build
install_v1_deps
setup_nginx
printf "\n\rDone.\n\r\n\r"
}

Expand Down

0 comments on commit d2b926c

Please sign in to comment.