From 21d213dfc706594a2465bdd099bbe6d0aee11533 Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Fri, 12 May 2017 11:15:08 +0300 Subject: [PATCH] refactor(aio): drop `run` (from `yarn run`), rename script and remove unnecessary cmds --- .../dockerbuild/scripts-js/package.json | 18 +++++++++--------- .../docs/overview--scripts-and-commands.md | 8 ++++---- .../scripts/{env.sh => _env.sh} | 0 .../scripts/{build.sh => create-image.sh} | 8 +------- aio/aio-builds-setup/scripts/test.sh | 2 +- .../scripts/travis-preverify-pr.sh | 2 +- 6 files changed, 16 insertions(+), 22 deletions(-) rename aio/aio-builds-setup/scripts/{env.sh => _env.sh} (100%) rename aio/aio-builds-setup/scripts/{build.sh => create-image.sh} (70%) diff --git a/aio/aio-builds-setup/dockerbuild/scripts-js/package.json b/aio/aio-builds-setup/dockerbuild/scripts-js/package.json index 589a7df1e0..c196c187c2 100644 --- a/aio/aio-builds-setup/dockerbuild/scripts-js/package.json +++ b/aio/aio-builds-setup/dockerbuild/scripts-js/package.json @@ -6,18 +6,18 @@ "author": "Angular", "license": "MIT", "scripts": { - "prebuild": "yarn run clean", + "prebuild": "yarn clean-dist", "build": "tsc", - "build-watch": "yarn run tsc -- --watch", - "clean": "node --eval \"require('shelljs').rm('-rf', 'dist')\"", - "dev": "concurrently --kill-others --raw --success first \"yarn run build-watch\" \"yarn run test-watch\"", + "build-watch": "yarn tsc -- --watch", + "clean-dist": "node --eval \"require('shelljs').rm('-rf', 'dist')\"", + "dev": "concurrently --kill-others --raw --success first \"yarn build-watch\" \"yarn test-watch\"", "lint": "tslint --project tsconfig.json", - "pre~~test-only": "yarn run lint", + "pre~~test-only": "yarn lint", "~~test-only": "node dist/test", - "pretest": "yarn run build", - "test": "yarn run ~~test-only", - "pretest-watch": "yarn run build", - "test-watch": "nodemon --exec \"yarn run ~~test-only\" --watch dist" + "pretest": "yarn build", + "test": "yarn ~~test-only", + "pretest-watch": "yarn build", + "test-watch": "nodemon --exec \"yarn ~~test-only\" --watch dist" }, "dependencies": { "express": "^4.14.1", diff --git a/aio/aio-builds-setup/docs/overview--scripts-and-commands.md b/aio/aio-builds-setup/docs/overview--scripts-and-commands.md index a083deabc8..c29eee85ce 100644 --- a/aio/aio-builds-setup/docs/overview--scripts-and-commands.md +++ b/aio/aio-builds-setup/docs/overview--scripts-and-commands.md @@ -8,7 +8,7 @@ This is an overview of the available scripts and commands. The scripts are located inside `/scripts/`. The following scripts are available: -- `build.sh`: +- `create-image.sh`: Can be used for creating a preconfigured docker image. See [here](vm-setup--create-docker-image.md) for more info. @@ -18,9 +18,9 @@ available: - `travis-preverify-pr.sh` Can be used for "preverifying" a PR before uploading the artifacts to the server. It checks that - the author of the PR a member of one of the specified GitHub teams and therefore allowed to upload - build artifacts. This is useful for CI integration. See [here](misc--integrate-with-ci.md) for - more info. + the author of the PR is a member of one of the specified GitHub teams and therefore allowed to + upload build artifacts. This is useful for CI integration. See [here](misc--integrate-with-ci.md) + for more info. ## Commands diff --git a/aio/aio-builds-setup/scripts/env.sh b/aio/aio-builds-setup/scripts/_env.sh similarity index 100% rename from aio/aio-builds-setup/scripts/env.sh rename to aio/aio-builds-setup/scripts/_env.sh diff --git a/aio/aio-builds-setup/scripts/build.sh b/aio/aio-builds-setup/scripts/create-image.sh similarity index 70% rename from aio/aio-builds-setup/scripts/build.sh rename to aio/aio-builds-setup/scripts/create-image.sh index 3d1fce9695..22e1b7765d 100755 --- a/aio/aio-builds-setup/scripts/build.sh +++ b/aio/aio-builds-setup/scripts/create-image.sh @@ -2,15 +2,9 @@ set -eux -o pipefail # Set up env -source "`dirname $0`/env.sh" +source "`dirname $0`/_env.sh" readonly defaultImageNameAndTag="aio-builds:latest" -# Build `scripts-js/` -cd "$SCRIPTS_JS_DIR" -yarn install -yarn run build -cd - - # Create docker image readonly nameAndOptionalTag=${1:-$defaultImageNameAndTag} sudo docker build --tag $nameAndOptionalTag ${@:2} $DOCKERBUILD_DIR diff --git a/aio/aio-builds-setup/scripts/test.sh b/aio/aio-builds-setup/scripts/test.sh index 1fbe75298f..84a1b83e7e 100755 --- a/aio/aio-builds-setup/scripts/test.sh +++ b/aio/aio-builds-setup/scripts/test.sh @@ -2,7 +2,7 @@ set -eux -o pipefail # Set up env -source "`dirname $0`/env.sh" +source "`dirname $0`/_env.sh" # Test `scripts-js/` cd "$SCRIPTS_JS_DIR" diff --git a/aio/aio-builds-setup/scripts/travis-preverify-pr.sh b/aio/aio-builds-setup/scripts/travis-preverify-pr.sh index 29c84ac4e4..f75796a200 100755 --- a/aio/aio-builds-setup/scripts/travis-preverify-pr.sh +++ b/aio/aio-builds-setup/scripts/travis-preverify-pr.sh @@ -2,7 +2,7 @@ set -eux -o pipefail # Set up env -source "`dirname $0`/env.sh" +source "`dirname $0`/_env.sh" # Build `scripts-js/` cd "$SCRIPTS_JS_DIR"