Skip to content

Commit

Permalink
create log files for scripts
Browse files Browse the repository at this point in the history
This addresses "No such file or directory" for first-time users
of script/canvas_update and script/prepare/prepare .

Test Plan:
  - qa-cr

Change-Id: I65373682830c7cfb169b6d0b5436dc24542cd446
Reviewed-on: https://gerrit.instructure.com/167770
Tested-by: Jenkins
Reviewed-by: Brian Watson <[email protected]>
QA-Review: Michael Hargiss <[email protected]>
Product-Review: Michael Hargiss <[email protected]>
  • Loading branch information
mycargus committed Oct 11, 2018
1 parent cd53efe commit 058d9a5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions script/canvas_update
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,6 @@ done

if [ "$PERFORM_UPDATE" == "true" ]; then
trap print_results INT TERM EXIT
create_log_file
update_canvas
fi
6 changes: 6 additions & 0 deletions script/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
# *be careful* when you modify these functions as doing so will impact multiple
# scripts that likely aren't used or tested in continuous integration builds.

function create_log_file {
if [ ! -f "$LOG" ]; then
echo "" > "$LOG"
fi
}

function echo_console_and_log {
echo "$1"
echo "$1" >>"$LOG"
Expand Down
15 changes: 15 additions & 0 deletions script/prepare/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ quite recall all the database migration and asset compilation tasks.
It can also nuke your Javascript dependencies, force re-install them, and more.
See the full feature list below.

## What does it NOT do?

We assume the following:

- you've already installed Postgres (postgresapp.com is an excellent option
for Mac users)
- postgres is running
- you've already installed Node.js
- you've already installed Yarn

## Setup

Add a symlink to `prepare` in your /usr/local/bin/ directory, like so:
Expand Down Expand Up @@ -58,6 +68,10 @@ $ git checkout master
$ prepare
```

You might encounter problems with some Ruby dependencies. The ["Dependency
Installation" section](https://github.com/instructure/canvas-lms/wiki/Quick-Start#dependency-installation)
in the public Canvas LMS Github wiki has some useful tips.

## What else can it do for me?

Let's say you've branched off master and committed code changes. Now you want to
Expand Down Expand Up @@ -97,6 +111,7 @@ Current and planned:
- [x] Supports a fresh installation of Javascript dependencies (useful for new Canvas setups)
- [ ] Supports `git cherry-pick`
- [ ] Supports a "quick" option, i.e. skipping asset compilation entirely
- [ ] Run delayed jobs in the background

## Code Credit

Expand Down
2 changes: 1 addition & 1 deletion script/prepare/prepare
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ done

if [ "$PERFORM_UPDATE" == "true" ]; then
trap print_results INT TERM EXIT

create_log_file
patchset_id="$1"

if [ "$patchset_id" == "-i" ] || [ "$patchset_id" == "-n" ]; then
Expand Down

0 comments on commit 058d9a5

Please sign in to comment.