-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
39 lines (28 loc) · 1.3 KB
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -ex # exit immediately with nonzero exit code if anything fails
# Install dependencies
bundle install
LATEST_API_VERSION="v1.3"
# generate the json files
bundle exec ruby scripts/generate_json_files.rb
bundle exec ruby scripts/generate_ftp_links.rb
bundle exec ruby scripts/generate_api_files.rb www/static/api/${LATEST_API_VERSION}
# Copy the original files
cp data/table.json www/static/data/json/table.json
cp data/data_file_links.csv www/static/data/data_file_links.csv
cp data/phenotype-general.csv www/static/data
cp data/phenotype-covid.csv www/static/data
# make old phenotype.csv link work...
cp data/phenotype-general.csv www/static/data/phenotype.csv
# make /api == the latest version of the API documentation
cp www/static/api/openapi.json www/static/api/${LATEST_API_VERSION}
cp www/static/api/openapi.yaml www/static/api/${LATEST_API_VERSION}
hugo -s www --minify
# make old API link work
cp -r www/public/api/v1.0 www/public/api/v1
cp www/public/api/index.html www/public/api/v1
cp www/public/api/index.html www/public/api/v1.0
cp www/public/api/index.html www/public/api/v1.1
cp www/public/api/index.html www/public/api/v1.2
cp www/public/api/index.html www/public/api/${LATEST_API_VERSION}
rsync -a --ignore-existing www/content/uploads/* www/public/images && rm www/public/images/_index.md