Add git-http-backend autopkgtest
Peter Colberg
5 years ago
|
0 |
Tests: git-http-backend
|
|
1 |
Restrictions: allow-stderr, isolation-container, needs-root
|
|
2 |
Depends: git, nginx-light
|
|
0 |
#!/bin/sh
|
|
1 |
set -eux
|
|
2 |
|
|
3 |
cd "$AUTOPKGTEST_TMP"
|
|
4 |
|
|
5 |
export GIT_AUTHOR_NAME=root
|
|
6 |
export GIT_AUTHOR_EMAIL=root@localhost
|
|
7 |
export GIT_AUTHOR_DATE="@1234567890 +0000"
|
|
8 |
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
|
|
9 |
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
|
|
10 |
export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
|
|
11 |
|
|
12 |
git init test1
|
|
13 |
git -C test1 commit --allow-empty -m test
|
|
14 |
|
|
15 |
tee /etc/nginx/sites-available/default <<EOF
|
|
16 |
server {
|
|
17 |
listen 80;
|
|
18 |
|
|
19 |
location / {
|
|
20 |
fastcgi_pass unix:/run/fcgiwrap.socket;
|
|
21 |
include fastcgi_params;
|
|
22 |
fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
|
|
23 |
fastcgi_param GIT_PROJECT_ROOT "$AUTOPKGTEST_TMP";
|
|
24 |
fastcgi_param GIT_HTTP_EXPORT_ALL "";
|
|
25 |
fastcgi_param PATH_INFO \$uri;
|
|
26 |
fastcgi_param NO_BUFFERING "";
|
|
27 |
fastcgi_buffering off;
|
|
28 |
gzip off;
|
|
29 |
}
|
|
30 |
}
|
|
31 |
EOF
|
|
32 |
systemctl restart nginx
|
|
33 |
|
|
34 |
git clone http://localhost/test1 test2
|
|
35 |
git -C test2 show --pretty=fuller 0f8c7c069313fcd3ef17b35305386916e4ffa9cd
|