-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathupdate_repo.sh.jinja2
42 lines (39 loc) · 1.85 KB
/
update_repo.sh.jinja2
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
echo "This (experimental) update script will create a new repo according to your config file. It will:"
echo "(1) overwrite your repositories Makefile, ODK sparql queries (your custom queries wont be touched) and docker wrapper (run.sh)."
echo "(2) and add missing files, if any."
set -e
OID={{project.id}}
ROOTDIR=../..
SRCDIR=..
CONFIG=$OID"-odk.yaml"
rm -rf target
mkdir target
/tools/odk.py seed -c -g -C $CONFIG
ls -l target/$OID/src
ls -l $SRCDIR/
cp target/$OID/src/scripts/update_repo.sh $SRCDIR/scripts/
rsync -r -u --ignore-existing --exclude 'patterns/data/default/example.tsv' --exclude 'patterns/dosdp-patterns/example.yaml' target/$OID/src/ $SRCDIR/
{% if project.documentation is not none %}
rsync -r -u --ignore-existing target/$OID/docs/ $ROOTDIR/docs
mkdir -p $ROOTDIR/docs/odk-workflows
rm -rf $ROOTDIR/docs/odk-workflows/*
cp -r target/$OID/docs/odk-workflows/* $ROOTDIR/docs/odk-workflows
{% endif -%}
cp target/$OID/src/ontology/Makefile $SRCDIR/ontology/
cp target/$OID/src/ontology/run.sh $SRCDIR/ontology/
cp -r target/$OID/src/sparql/* $SRCDIR/sparql/
{%- if project.ci is defined -%}{% if 'travis' in project.ci %}
cp -n target/$OID/.travis.yml $ROOTDIR/
{%- endif -%}{% if 'github_actions' in project.ci %}
mkdir -p $ROOTDIR/.github
mkdir -p $ROOTDIR/.github/workflows
cp -n target/$OID/.github/workflows/qc.yml $ROOTDIR/.github/workflows/qc.yml
cp -n target/$OID/.github/workflows/diff.yml $ROOTDIR/.github/workflows/diff.yml
{% if project.documentation is not none %}
cp -n target/$OID/.github/workflows/docs.yml $ROOTDIR/.github/workflows/docs.yml
{% endif %}{% endif %}{% endif %}
{% if project.documentation is not none %}
cp -n target/$OID/mkdocs.yaml $ROOTDIR/
{% endif %}
echo "WARNING: These files should be manually migrated: mkdocs.yaml, .gitignore, src/ontology/catalog.xml (if you added a new import or component)"
echo "Update successfully completed."