-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #318 from SlateFoundation/develop
Release: v2.17.2
- Loading branch information
Showing
7 changed files
with
190 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[holosource] | ||
url = "https://github.com/JarvusInnovations/emergence-skeleton-v2" | ||
ref = "refs/tags/v2.8.11" | ||
ref = "refs/tags/v2.8.13" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# Contacts Spreadsheet | ||
|
||
## Initialize git branch | ||
|
||
Initialize a new git repository if needed, or just `cd` into an existing one: | ||
|
||
```bash | ||
git init myschool-slate | ||
cd myschool-slate | ||
``` | ||
|
||
Then check out a fresh branch to track content import content: | ||
|
||
```bash | ||
git checkout --orphan gitsheets/imports/contacts | ||
``` | ||
|
||
Declare a new gitsheet to store contact data by creating this file: | ||
|
||
=== ".gitsheets/student-contacts.toml" | ||
|
||
```toml | ||
[gitsheet] | ||
root = "student-contacts" | ||
path = "${{ '{{' }} student.username }}" | ||
|
||
[gitsheet.fields.student] | ||
default = {} | ||
``` | ||
|
||
Finally, stage and commit the gitsheet declaration: | ||
|
||
```bash | ||
git add .gitsheets/student-contacts.toml | ||
git commit -m "feat: define student-contacts gitsheet" | ||
``` | ||
|
||
## Spreadsheet template | ||
|
||
Populate this template with student and relationship contact details: | ||
|
||
```csv | ||
student.name,student.username,student.number,student.email.personal,student.phone.home,student.phone.mobile,guardian1.name,guardian1.relationship,guardian1.email.personal,guardian1.phone.home,guardian1.phone.mobile,guardian1.phone.work,guardian2.name,guardian2.relationship,guardian2.email.personal,guardian2.phone.home,guardian2.phone.mobile,guardian2.phone.work | ||
John Doe,johndoe7,,[email protected],,267-111-1234,Michael Doe,Father,[email protected],,267-222-1234,394-231-3245,Jane Doe,Mother,[email protected],,267-384-2835,325-234-3818 | ||
``` | ||
|
||
## Load spreadsheet into gitsheet | ||
|
||
Use the `git sheet upsert` command to load the filled CSV from the previous template: | ||
|
||
```bash | ||
git sheet upsert \ | ||
--delete-missing \ | ||
"student-contacts" \ | ||
~/Downloads/myschool_contacts.csv | ||
``` | ||
|
||
And then commit the resulting staged records: | ||
|
||
```bash | ||
git commit -m "data: load student contacts from spreadsheet" | ||
``` | ||
|
||
## Review relationship labels | ||
|
||
Use this command to analyze all the relationship labels used in this dataset: | ||
|
||
```bash | ||
git sheet query student-contacts \ | ||
| jq '[ .[].guardian1.relationship, .[].guardian2.relationship ] | unique' | ||
``` | ||
|
||
If any strange values or abbreviations are present, consider using find/replace on the original spreadsheet to normalize this with some more standard values, and then repeat the load step above to add a commit with your changes. | ||
|
||
## Extract data from Slate instance into gitsheet | ||
|
||
Install the `slate-gitsheets` command if needed: | ||
|
||
```bash | ||
npm install -g slate-gitsheets | ||
``` | ||
|
||
Download users from Slate into another branch: | ||
|
||
```bash | ||
slate-gitsheets extract-slate \ | ||
--ref=gitsheets/slate \ | ||
--host=https://myschool.org/ \ | ||
--host-name=myschool | ||
``` | ||
|
||
## Merge spreadsheet data into Slate data | ||
|
||
Merge data from the `student-contacts` gitsheet into the Slate `users` gitsheet: | ||
|
||
```bash | ||
slate-gitsheets merge-contacts \ | ||
--contacts-ref=gitsheets/imports/contacts \ | ||
--slate-ref=gitsheets/slate | ||
``` | ||
|
||
## Load data from gitsheets into Slate instance | ||
|
||
```bash | ||
slate-gitsheets load-slate \ | ||
--ref=gitsheets/slate \ | ||
--host=https://myschool.org/ \ | ||
--host-name=myschool | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
|
||
# script/-test-bootstrap: Check dependencies for testing. | ||
|
||
set -e | ||
cd "$(dirname "$0")/.." | ||
|
||
|
||
echo | ||
echo "==> studio-bootstrap: verifying hologit" | ||
|
||
if ! [ -x "$(command -v git-holo)" ]; then | ||
echo "Please install git-holo command with npm: npm install -g hologit" | ||
echo "Or with Habitat: hab pkg install --binlink jarvus/hologit" | ||
exit 1 | ||
fi | ||
|
||
|
||
echo | ||
echo "==> bootstrap: verifying Node.js…" | ||
|
||
if ! [ -x "$(command -v node)" ]; then | ||
echo | ||
echo " Please install Node.js: https://nodejs.org/en/download/" | ||
exit 1 | ||
fi | ||
|
||
node_version="$(node --version)" | ||
echo " Found node version: ${node_version}" | ||
if ! [[ $node_version =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then | ||
echo | ||
echo " Could not parse node version: ${node_version}" | ||
echo " Please install node v14.x" | ||
exit 1 | ||
fi | ||
|
||
# check that node >= MAJOR.MINOR | ||
node_min_major="14" | ||
node_min_minor="15" | ||
|
||
IFS='.' read -ra node_version_split <<< "${node_version#v}" | ||
if [ "${node_version_split[0]}" -lt "${node_min_major}" ] || [[ "${node_version_split[0]}" -le "${node_min_major}" && "${node_version_split[1]}" -lt "${node_min_minor}" ]]; then | ||
echo | ||
echo " Please install Node.js >= ${node_min_major}.${node_min_minor}.x" | ||
echo | ||
exit 1 | ||
fi | ||
|
||
if ! [ -x "$(command -v npm)" ]; then | ||
echo "Please install the npm command" | ||
exit 1 | ||
fi | ||
|
||
if ! [ -x "$(command -v npx)" ]; then | ||
echo "Please install the npx command (part of newer npm distributions)" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters