Commit 552c7d28 authored by Houtan Bastani's avatar Houtan Bastani

add function to create snapshots

parent cb9e8375
Pipeline #453 passed with stages
in 23 seconds
......@@ -16,6 +16,9 @@ build:
- gem install jekyll
- gem install bundler
- (cd _data && wget http://www.dynare.org/RePEc/cpm/dynare/wp.yml)
- pwd
- ls -la
- bash setup-snapshots.sh
- bundle install
script:
- (cd assets/images/logo && make)
......
......@@ -170,6 +170,8 @@ exclude:
- /assets/images/logo/*.tex
- /assets/images/logo/*.sh
- /assets/RePEc/rdf2yml.py
- .gitlab-ci.yml
- setup-snapshots.sh
keep_files:
- .git
- /assets/images/*
......
#!/bin/bash
mkdir -p assets/snapshot
cd assets/snapshot
wget http://eris.dynare.org/snapshot/macosx.json
wget http://eris.dynare.org/snapshot/source.json
wget http://eris.dynare.org/snapshot/windows.json
wget http://eris.dynare.org/snapshot/windows-zip.json
declare -a arr=("macosx" "source" "windows" "windows-zip")
for dir in "${arr[@]}"
do
mkdir $dir
filenames=(`jq .[].filename $dir.json`)
timestamps=(`jq .[].date $dir.json`)
n=`jq length $dir.json`
n=`expr $n - 1`
cd $dir
for i in `seq 0 $n`;
do
filename="${filenames[i]%\"}"
filename="${filename#\"}"
timestamp="${timestamps[i]%\"}"
timestamp="${timestamp#\"}"
echo $filename $timestamp
touch -amt $timestamp $filename
done
cd ..
done
rm *.json
cd ../..
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment