forked from reproducible-reporting/dmp-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·61 lines (52 loc) · 1.45 KB
/
Copy pathtest.sh
File metadata and controls
executable file
·61 lines (52 loc) · 1.45 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
# SPDX-FileCopyrightText: © 2024 RepRep's DMP Template Authors <https://github.com/reproducible-reporting/dmp-template/blob/main/AUTHORS.md>
# SPDX-License-Identifier: CC-BY-NC-SA-4.0
# Test whether the instructions in the README.md file do not generate errors.
set -e
# Make a working directory
REPO="../../$(basename ${PWD})"
WORKDIR="../nobackup/dmp-test"
# Run the cookiecutter template
if [ -d "${WORKDIR}" ]; then
cd "${WORKDIR}"
cookiecutter ${REPO} --replay --overwrite-if-exists
else
mkdir -p "${WORKDIR}"
cd "${WORKDIR}"
echo > config.yaml << EOF
---
slug: test
short_name: test
long_name: Test DMP
full_name: Test User
work_email: test.user@example.org
year: 2525
EOF
cookiecutter ${REPO} --config-file config.yaml --no-input
fi
# Run the instructions in the README.md file
cd dmp-project-short
rm -rf .git
git init
git add .
git commit -a -m "Initial commit"
# Set up the virtual environment.
./setup-venv-pip.sh
source .envrc
pre-commit install
# Overwrite the template.yaml file for testing
cd dmp
cat > template.yaml << EOF
# SPDX-FileCopyrightText: © 2024 RepRep's DMP Template Authors <https://github.com/reproducible-reporting/dmp-template/blob/main/AUTHORS.md>
# SPDX-License-Identifier: CC-BY-NC-SA-4.0
version: v2.0
github_owner: reproducible-reporting
github_repository: dmp-template
local:
- ../../${REPO}/
- ../../${REPO}/dmp_template.typ
EOF
# Build the DMP
stepup boot
# Try a commit
git commit -a -m "Second commit"