Commit 8b924f51 authored by Nathalie Furmento's avatar Nathalie Furmento

update /files url in html files

parent 793151b1
Pipeline #159301 passed with stages
in 1 minute and 22 seconds
......@@ -8,10 +8,7 @@ pages:
script:
- apt-get update
- apt-get --yes install rsync
- mkdir .public
- ./scripts/createRedirect.sh
- rsync -avz --chmod=ug=rwX,o=rX --exclude .git/ --exclude .gitlab-ci.yaml contents/ .public
- mv .public public
- ./scripts/createWebServer.sh
artifacts:
paths:
- public
......
#!/bin/bash
dir=$(dirname $0)
public=$dir/..
while read line
do
src=$(echo $line | awk '{print $1}')
dst=$(echo $line | awk '{print $2}')
echo create redirect from $src to $dst
mkdir -p .public/$src
(cat <<EOF
<head>
<title>Page has moved!</title>
<meta http-equiv="Refresh" content="0; URL=$dst" />
</head>
EOF
) > .public/$src/index.html
done< $dir/redirect.txt
#!/bin/bash
dir=$(dirname $0)
createRedirect()
{
while read line
do
src=$(echo $line | awk '{print $1}')
dst=$(echo $line | awk '{print $2}')
echo create redirect from $src to $dst
mkdir -p public/$src
(cat <<EOF
<head>
<title>Page has moved!</title>
<meta http-equiv="Refresh" content="0; URL=$dst" />
</head>
EOF
) > public/$src/index.html
done< $dir/redirect.txt
}
updateFileLinks()
{
for f in $(grep -rsl 'href="/files' public)
do
echo update file links in $f
sed -i 's/href="\/files/href="http:\/\/starpu.gforge.inria.fr\/files/' $f
done
}
rm -rf public
mkdir public
createRedirect
rsync -az --chmod=ug=rwX,o=rX --exclude .htaccess contents/ public
updateFileLinks
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment