/
entrypoint.sh
executable file
·41 lines (34 loc) · 1.08 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
#!/bin/sh -l
set -euo pipefail
# Save the working directory
WORKINGDIR=$PWD
# Create and serve a remote repo
mkdir -p /git/remote
git config --global init.defaultBranch main
git init --bare /git/remote/test-base.git
git daemon --verbose --enable=receive-pack --base-path=/git/remote --export-all /git/remote &>/dev/null &
# Give the daemon time to start
sleep 2
# Create a local clone and make an initial commit
mkdir -p /git/local
git clone git://127.0.0.1/test-base.git /git/local/test-base
cd /git/local/test-base
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
echo "#test-base" > README.md
git add .
git commit -m "initial commit"
git push -u
git log -1 --pretty=oneline
git config --global --unset user.email
git config --global --unset user.name
git config -l
# Clone a server-side fork of the base repo
cd $WORKINGDIR
git clone --mirror git://127.0.0.1/test-base.git /git/remote/test-fork.git
cd /git/remote/test-fork.git
git log -1 --pretty=oneline
# Restore the working directory
cd $WORKINGDIR
# Execute integration tests
jest int --runInBand