-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentrypoint.sh
executable file
·59 lines (46 loc) · 1.84 KB
/
entrypoint.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
git config --global user.name "$1"
git config --global user.email "$2"
# Create ~/.ssh folder
mkdir -p /root/.ssh
chmod 700 /root/.ssh
# Add github and gin.g-node.org as trusted hosts
ssh-keyscan -H github.com | install -m 600 /dev/stdin /root/.ssh/known_hosts
ssh-keyscan -H gin.g-node.org >> /root/.ssh/known_hosts
# Start ssh agent
eval "$(ssh-agent -s)"
# Add key to ssh agent
ssh-add - <<< "${SECRET_KEY}"
echo "Installing TemplateFlow Archive super-dataset ..."
datalad install [email protected]:templateflow/templateflow.git
echo "Installing template ${GITHUB_REPOSITORY##*/} ..."
cd templateflow/
git submodule set-url -- ${GITHUB_REPOSITORY##*/} [email protected]:templateflow/${GITHUB_REPOSITORY##*/}.git
datalad install ${GITHUB_REPOSITORY##*/}
echo "Updating template ${GITHUB_REPOSITORY##*/} ..."
datalad update -d ${GITHUB_REPOSITORY##*/} --merge any .
# Update GIN
echo "Configuring g-Node/GIN remote ..."
pushd ${GITHUB_REPOSITORY##*/}
datalad siblings configure -d . --name gin \
--pushurl [email protected]:/templateflow/${GITHUB_REPOSITORY##*/}.git \
--url https://gin.g-node.org/templateflow/${GITHUB_REPOSITORY##*/}
git config --unset-all remote.gin.annex-ignore
datalad siblings configure --name gin --as-common-datasrc gin-src
datalad save -m "up: template action after content change"
echo "Pushing to g-Node/GIN ..."
datalad push --to gin .
echo "Pushing to GitHub ..."
datalad push --to origin .
echo "Pushing super-dataset ..."
popd
git submodule set-url -- ${GITHUB_REPOSITORY##*/} https://github.com/templateflow/${GITHUB_REPOSITORY##*/}
datalad save -m "update(${GITHUB_REPOSITORY##*/}): template action"
datalad push --to origin .
# Update S3
echo "Exporting to S3 bucket ..."
datalad siblings -d ${GITHUB_REPOSITORY##*/}/ enable -s s3
pushd ${GITHUB_REPOSITORY##*/}
datalad get -r *
git annex export master --to s3
popd