-
Notifications
You must be signed in to change notification settings - Fork 1
/
upload.sh
executable file
·43 lines (35 loc) · 1019 Bytes
/
upload.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
40
41
42
43
#!/bin/bash
### Required environment variables ###
# export IGEM_TEAM=your_team_name #
# export IGEM_USERNAME=your_username #
# export IGEM_PASSWORD=your_password #
######################################
######## Required python data ########
# - Virtual environment called venv #
# - igem-wikisync installed in it #
######################################
# Use hugo to build the site to the public folder
echo "Started building the site"
hugo -D
if [ $? -eq 0 ]; then
echo "Finished building the site"
else
echo "Failed to build the site"
exit
fi
# Load the credentials for the iGEM site from a separate non-tracked file
CRED_FILE=load_creds.sh
if [ -f "$CRED_FILE" ]; then
source $CRED_FILE
fi
echo "Loaded credentials"
# Upload the wiki using the igem-wikisync library in a python venv
echo "Starting upload"
source venv/bin/activate
python3 wikisync.py $IGEM_TEAM
echo "Finished upload"
# Clean up, removing any build directories
echo "Cleaning up"
rm -rf public
rm -rf out
mkdir out