Skip to content

Commit

Permalink
Use "build" script for packages pre-install
Browse files Browse the repository at this point in the history
refs ADMIN-761

When we added canvas-planner to the packages
directory, we set up a prebuild script to
build everything we needed for Canvas that
would run during yarn install.  This causes
canvas-planner to have to do a lot that it
doesn't need to do when we just want the npm
packages to be installed (for the sync-
translations build or for other purposes)
so we're setting a specific build step
instead

Test Plan
- Specs pass

Change-Id: I72a0dc52cd9be1255985d69921d9910ba12e9ffe
Reviewed-on: https://gerrit.instructure.com/147565
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <[email protected]>
Product-Review: Mysti Sadler <[email protected]>
QA-Review: Mysti Sadler <[email protected]>
  • Loading branch information
Ardena committed Apr 20, 2018
1 parent 72b791a commit 77171b9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"test:karma:watch": "karma start",
"test:karma:watch:headless": "karma start --browsers ChromeHeadlessNoSandbox",
"test:packages": "script/local-yarn test",
"preinstall": "script/local-yarn install",
"preinstall": "script/local-yarn install && script/local-yarn build",
"build": "yarn run build:css && yarn run build:js",
"build:watch": "concurrently \"yarn build:css:watch\" \"yarn build:js:watch\"",
"build:css": "brandable_css",
Expand Down
5 changes: 4 additions & 1 deletion packages/canvas-planner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ USER root

RUN mkdir -p $APP_HOME

COPY . $APP_HOME
COPY package.json $APP_HOME/
COPY yarn.lock $APP_HOME/

WORKDIR $APP_HOME

RUN yarn

COPY . $APP_HOME

# This makes the container stay running, until explicitly stopped
# rather than being a build only image.
CMD ["tail", "-f", "/dev/null"]
1 change: 0 additions & 1 deletion packages/canvas-planner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"lint": "eslint src/",
"lint:fix": "eslint src/ --fix",
"build": "./scripts/build",
"prepublish": "yarn build",
"build:dev": "NODE_ENV=development BABEL_ENV=production babel src --out-dir lib --ignore spec.js,test.js,demo.js --quiet",
"build:lib": "BABEL_ENV=production babel src --out-dir lib --ignore spec.js,test.js,demo.js --quiet",
"build:es": "BABEL_ENV=production ES_MODULES=1 babel src --out-dir es --ignore spec.js,test.js,demo.js --quiet",
Expand Down
2 changes: 1 addition & 1 deletion script/local-yarn
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ for path in $(ls -1 {gems/{,plugins/},packages/}*/package.json 2> /dev/null); do
NODE_ENV=production
fi

if [[ $path != *"packages"* && ($1 == "test" || $1 == "lint") ]]; then
if [[ $path != *"packages"* && ($1 == "test" || $1 == "lint" || $1 == "build") ]]; then
# yarn test and lint are packages directory specific commands
popd > /dev/null
continue
Expand Down

0 comments on commit 77171b9

Please sign in to comment.