Skip to content

Commit 3746b47

Browse files
author
yolo h8cker 93
committed
Add script to publish static trajs
1 parent bd2e36d commit 3746b47

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,14 @@ aws s3 sync s3://codeclash/logs/ logs/
3535
### Trajectory viewer
3636

3737
Assuming that your logs ar in `logs/`, start the viewer with `python run_viewer.py`. Use `-d` (`--directory`) to specify a custom path to your logs.
38+
39+
To deploy to the static site, run
40+
41+
> [!CAUTION]
42+
> This will overwrite anything on the public display. Make sure you have all trajectories
43+
44+
```bash
45+
cd REPO_ROOT
46+
aws s3 sync logs/ s3://codeclash/logs/
47+
./build_static_and_push.sh
48+
```

build_static_and_push.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
set -euo pipefail
5+
6+
# START AT MAIN REPO ROOT
7+
rm -rf build
8+
echo "Building static site..."
9+
python freeze_viewer.py
10+
echo "Copying README..."
11+
cp codeclash/viewer/_STATIC_README.md build/README.md
12+
echo "Size of build directory:"
13+
du -hs build
14+
echo "Pushing to github..."
15+
cd build
16+
git init
17+
git config user.name "yolo h8cker 93"
18+
git config user.email "yoloh8cker93@codeclash.ai"
19+
git config commit.gpgsign false
20+
git add .
21+
git commit --no-gpg-sign -m "Deploy static site"
22+
git branch -M main
23+
git remote add origin git@github.com:klieret/emagedoc-static-viewer
24+
git push -f origin main
25+
cd ..
26+
rm -rf build

codeclash/viewer/_STATIC_README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Static hosting of trajectories
2+
3+
How this works:
4+
5+
1. Run `freeze_viewer.py` to generate the static site in the `build` directory.
6+
2. Push to the github repo. Let's not keep any history to keep things small
7+
3. Deployed via Kilian's netlify to https://cheery-melba-4698df.netlify.app/
8+
9+
## Commands
10+
11+
> [!CAUTION]
12+
> This will overwrite anything on the public display. Make sure you have all trajectories
13+
14+
```bash
15+
cd REPO_ROOT
16+
aws s3 sync logs/ s3://codeclash/logs/
17+
./build_static_and_push.sh
18+
```

0 commit comments

Comments
 (0)