forked from etalab/transport-normes-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·34 lines (27 loc) · 907 Bytes
/
build.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
#!/usr/bin/env bash
# stop processing on basic errors
set -e
# NOTE: temporarily freezing to the latest tag,
# ultimately something more flexible with be introduced
# (e.g. multi-version support, and first "automatic latest version")
SIRI_VERSION=v1.7
TEMP_FOLDER=tmp
CONTENT_FOLDER=content/normes
SIRI_REPO_NAME=transport-profil-siri-fr
echo "Retrieving content via git..."
git submodule update --init --remote $CONTENT_FOLDER
echo "Removing legacy SIRI content..."
rm -rf $CONTENT_FOLDER/SIRI
echo "Cloning new SIRI content..."
rm -rf $TEMP_FOLDER | true
mkdir $TEMP_FOLDER && cd $TEMP_FOLDER
git clone https://github.com/etalab/$SIRI_REPO_NAME.git
cd $SIRI_REPO_NAME
# just for debugging purposes
git tag -l
git checkout tags/$SIRI_VERSION
cd ../..
echo "Copying new SIRI content to the right place..."
cp -r $TEMP_FOLDER/$SIRI_REPO_NAME/SIRI $CONTENT_FOLDER
echo "Building site..."
hugo --minify