Commit Graph

16 Commits

Author SHA1 Message Date
Clay Diffrient 93a6d18046 Add precommit hook for auto fixing files
This only affects javascript files and only affects things
from the prettier whitelist

This will run slowly if you don't have node_modules installed
locally (e.g., in Docker), but it will gladly attempt to
run things in Docker for you.

This adds a new githook_installer image that will install
the githook whenever a docker-compose up happens in the
repo.  It will also install the hook whenever a `yarn`
occurs locally (as a postinstall hook).

This commit should also not fail things.  For example
having unused variables is an ESLint error, but it isn't
autofixable.  It will log the error, but will otherwise
continue.  However, it will make this pretty with prettier
as well as fix any other autofixable ESLint errors.

closes CORE-2118

Test Plan:
  - Run `yarn`
  - Add some semicolons to something from the whitelist
  - git add that file
  - git commit and it will strip semicolons
  - In a dockerized Canvas:
     - docker-compose up
     - Add semicolons to a file
     - git add that file
     - git commit, it will take forever (~60s)
     - It should have stripped out semicolons

Change-Id: Id9198aa008808e898f29acb9ed64dd14ff843222
Reviewed-on: https://gerrit.instructure.com/171510
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
QA-Review: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Brent Burgoyne <bburgoyne@instructure.com>
2018-11-27 21:07:31 +00:00
Derek Bender 40f4784934 update Dockerfile and docker-compose.override
include pacts and reports from when the Dockerfile was
editted directly

test plan:
 - ./build/dockerfile_writer.rb makes no changes to Dockerfile nor
   Dockerfile-production

Change-Id: I93a72d32909633eb6953fe87ed903eb0e3362b72
Reviewed-on: https://gerrit.instructure.com/167522
Tested-by: Jenkins
Reviewed-by: Bryan Petty <bpetty@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
2018-10-09 19:39:52 +00:00
Derek Bender 11b30e7fea upgrade yarn to 1.6.0
Change-Id: Icc59c9c43fea079196d9a0dc29b23ac0f1da74c7
Reviewed-on: https://gerrit.instructure.com/147047
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
2018-04-19 20:31:06 +00:00
Derek Bender 00f037e6c1 add docker volumes for canvas-planner
Change-Id: Id75dc1ab78bb2a0a420ec4d3acb1ea3012a9fb30
Reviewed-on: https://gerrit.instructure.com/147160
Tested-by: Jenkins
Reviewed-by: Bryan Petty <bpetty@instructure.com>
Product-Review: Derek Bender <djbender@instructure.com>
QA-Review: Derek Bender <djbender@instructure.com>
2018-04-17 15:36:30 +00:00
Omar Khan e41f0de4f0 Remove stylesheets docker volume
It seems to cause problems for people

Change-Id: I41b90dfe5f419d781a51af3b52bd97222e420ca6
Reviewed-on: https://gerrit.instructure.com/131646
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: Andrew Butterfield <abutterfield@instructure.com>
Product-Review: Omar Khan <okhan@instructure.com>
2017-11-02 19:11:46 +00:00
Omar Khan b70b6b2936 Add docker_dev_setup.sh script
This script sets up a full docker development environment from scratch,
on mac and debian-based linux.

Test plan:

- On mac, run script/docker_dev_setup.sh
- Answer the prompts
- Check that the script completes successfully
- Run docker-compose up
- Open http://canvas.docker
- Repeat on ubuntu xenial

Change-Id: Ic1eb0bad791fcbfe3953691623f2fbfb40b9298b
Reviewed-on: https://gerrit.instructure.com/130857
Tested-by: Jenkins
Reviewed-by: Bryan Petty <bpetty@instructure.com>
Product-Review: Bryan Petty <bpetty@instructure.com>
QA-Review: Bryan Petty <bpetty@instructure.com>
2017-11-01 23:02:50 +00:00
Omar Khan 0fdd64e53f Remove karma container from docker-compose.override.yml
Test plan:

- Add docker-compose/js-tests.override.yml to COMPOSE_FILE in .env
- docker-compose build js-tests
- docker-compose run --rm js-tests

Change-Id: I6d43cb2da47c1b6985a9fefd9cc23262e5f56233
Reviewed-on: https://gerrit.instructure.com/123284
Tested-by: Jenkins
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Omar Khan <okhan@instructure.com>
2017-08-18 20:03:30 +00:00
Omar Khan 399414b3ec Run javascript tests in headless chrome
Test plan: docker-compose run --rm karma yarn test

Change-Id: I316d80e7a1b712b0dda91a390c4dddeb09b3e6fb
Reviewed-on: https://gerrit.instructure.com/122776
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-08-16 16:11:52 +00:00
Clay Diffrient 2c6c7db602 Replace guard with webpack in docker-compose file
Change-Id: I02aa25e44754f460b5a47eb47d0e9c23beb4f4a9
Reviewed-on: https://gerrit.instructure.com/104831
Tested-by: Jenkins
Reviewed-by: Omar Khan <okhan@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Product-Review: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Clay Diffrient <cdiffrient@instructure.com>
2017-03-13 16:02:19 +00:00
Ryan Shaw 05f55c1c30 Deprecate `npm` client. Use `yarn` instead
Closes: CNVS-35152

This changes all our tooling that used `npm` to
Run scripts to use `yarn`. `npm` will still work
for now but if you have yarn installed, it will use
that.

Cheat Sheet:
old command      -> new command
npm install      -> yarn install (or just `yarn`)
npm run webpack  -> yarn run webpack
npm test         -> yarn test
See more at https://yarnpkg.com

Test plan:
* all Jenkins builds should pass
* without yarn installed:
* run script/nuke_node.sh
* it should work and warn you about how `npm` is deprecated
* now install yarn, e.g.: `brew install yarn`
* run script/nuke_node.sh again
* it should work and you should see silly yarn emoji
  in the output and it should be a lot faster

* the docker changes I made should work and docker should
  build correctly and use yarn.

Change-Id: I4aa31eeae3ecc504634a7c72a1ea0d3396f445e3
Reviewed-on: https://gerrit.instructure.com/102969
Tested-by: Jenkins
Reviewed-by: Brent Burgoyne <bburgoyne@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
2017-03-01 19:39:01 +00:00
Brad Horrocks 02dd008a2f Fix volume path
Change-Id: Iaf0241ee59bffbc69f1a5294e28d0cab9a42e1eb
Reviewed-on: https://gerrit.instructure.com/102796
Reviewed-by: Benjamin Porter <bporter@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2017-02-21 19:56:09 +00:00
Brad Horrocks 34af3f00fe Moar Volume!!
Adding yet another volume for generated stuff

Change-Id: I99fde84f559d4782082d649731afbc661edee710
Reviewed-on: https://gerrit.instructure.com/102633
Tested-by: Jenkins
Reviewed-by: Benjamin Porter <bporter@instructure.com>
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
QA-Review: Brad Horrocks <bhorrocks@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2017-02-21 18:53:42 +00:00
Brad Horrocks fc2ea9017f Add more volumes
added brandable_css, yardoc, and doc_api volumes

Change-Id: I36ad750a7b10f0ad39734b040ee06f1b91c9ff3c
Reviewed-on: https://gerrit.instructure.com/96125
Tested-by: Jenkins
Reviewed-by: Benjamin Porter <bporter@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
QA-Review: Brad Horrocks <bhorrocks@instructure.com>
2016-11-28 22:40:23 +00:00
Brad Horrocks 762fe74eeb Fix containers getting assigned a VIRTUAL_HOST
Change-Id: Ib9ace5c89dcffe8ac895269094f95b1f1147270b
Reviewed-on: https://gerrit.instructure.com/95376
Tested-by: Jenkins
Reviewed-by: Bryan Petty <bpetty@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
QA-Review: Brad Horrocks <bhorrocks@instructure.com>
2016-11-16 18:52:36 +00:00
Brad Horrocks 35a6eda075 go back to non wildcard TLD
Change-Id: I7909e0986a2f851bbb06c8c4788a798fcba06410
Reviewed-on: https://gerrit.instructure.com/95269
Tested-by: Jenkins
Reviewed-by: Dave Donahue <ddonahue@instructure.com>
Reviewed-by: Bryan Petty <bpetty@instructure.com>
Product-Review: Dave Donahue <ddonahue@instructure.com>
QA-Review: Dave Donahue <ddonahue@instructure.com>
2016-11-15 21:29:57 +00:00
Brad Horrocks 3c809153d1 docker-compose.yml v2
If you have a docker-compose.override file you'll want to
move it somewhere else.

mv docker-compose.override.yml docker-compose.`whoami`.yml

Once you've updated your override file to the version 2 syntax, you
should add it to the COMPOSE_FILE environment variable. Probably in a
.env file in the project root.

Test plan:

You'll need to remove your existing canvas containers and volumes to 
fully test this.

to do so run this **BEFORE** you checkout this patchset

```
docker-compose down
docker-compose ps -q | docker rm
docker volume ls -q | grep canvaslms | xargs docker volume rm 
```


then you should be able to get up and running using the following

```
cp docker-compose/config/* config/
dc build
dcr web bundle exec rake db:create db:initial_setup
dc up
```

You should be able to access canvas like normal

Change-Id: Ia7ff76cfdd4f46278fc1cb2a03969fdadaa4a434
Reviewed-on: https://gerrit.instructure.com/91008
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2016-11-15 17:06:37 +00:00