-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
executable file
·43 lines (34 loc) · 985 Bytes
/
run
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
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p git openssh
# vi: ft=sh
# shellcheck shell=bash
set -euo pipefail
# Set up SSH
eval "$(ssh-agent -s)"
echo "${SSH_PRIVATE_KEY}" | tr -d '\r' | ssh-add - > /dev/null
unset SSH_PRIVATE_KEY
# Set up git
git config user.name "GitLab CI"
git config user.email "[email protected]"
git remote rm origin || :
git remote add origin git@"${CI_SERVER_HOST}":"${CI_PROJECT_PATH}"
export GIT_SSH_COMMAND="ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null"
# Switch to correct branch
git fetch origin data
git checkout data
git reset --hard origin/data
# Generate data
ulimit -n 16384
target/release/typo3nix
if [[ "${TYPO3NIX_TEST_MODE:-}" = 1 ]]; then
exit 0
fi
# Do we need to commit anything?
if ! git status --porcelain | grep -q "extensions.json"; then
echo "Nothing changed"
exit 0
fi
# Commit and push
git add extensions.json
git commit -m "Automatic extensions.json update"
git push -o ci.skip origin data