Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DBRepo
Manage
Activity
Members
Labels
Plan
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FAIR Data Austria DB Repository
DBRepo
Commits
5b52e4bc
Verified
Commit
5b52e4bc
authored
1 year ago
by
Martin Weise
Browse files
Options
Downloads
Patches
Plain Diff
Need relative path
parent
bf7e5594
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.docs/build-website.sh
+16
-2
16 additions, 2 deletions
.docs/build-website.sh
.docs/redirect.html
+2
-2
2 additions, 2 deletions
.docs/redirect.html
Dockerfile
+3
-9
3 additions, 9 deletions
Dockerfile
with
21 additions
and
13 deletions
.docs/build-website.sh
+
16
−
2
View file @
5b52e4bc
#!/bin/bash
#!/bin/bash
INDEX_HTML
=
""
INDEX_HTML
=
""
OVERRIDES_MAIN_HTML
=
""
SCRIPTS_EXTRA_JS
=
""
function
generate_docs
{
function
generate_docs
{
BRANCH
=
"release-
$1
"
BRANCH
=
"release-
$1
"
...
@@ -14,6 +16,12 @@ function generate_docs {
...
@@ -14,6 +16,12 @@ function generate_docs {
find .docs/
-type
f
-exec
sed
-i
-e
"s/__CHARTVERSION__/
$1
/g"
{}
\;
find .docs/
-type
f
-exec
sed
-i
-e
"s/__CHARTVERSION__/
$1
/g"
{}
\;
if
[
"
$1
"
=
"latest"
]
;
then
if
[
"
$1
"
=
"latest"
]
;
then
INDEX_HTML
=
$(
cat
.docs/redirect.html
)
INDEX_HTML
=
$(
cat
.docs/redirect.html
)
OVERRIDES_MAIN_HTML
=
$(
cat
.docs/overrides/main.html
)
SCRIPTS_EXTRA_JS
=
$(
cat
.docs/scripts/extra.js
)
else
echo
$OVERRIDES_MAIN_HTML
>
.docs/overrides/main.html
mkdir
-p
.docs/scripts
echo
$SCRIPTS_EXTRA_JS
>
.docs/scripts/extra.js
fi
fi
mkdocs build
>
/dev/null
&&
cp
-r
./site
"./final/
$1
"
mkdocs build
>
/dev/null
&&
cp
-r
./site
"./final/
$1
"
cp
-r
"./swagger/
$1
"
"./final/
$1
/swagger"
cp
-r
"./swagger/
$1
"
"./final/
$1
/swagger"
...
@@ -43,11 +51,16 @@ if [ -z "$APP_VERSION" ]; then
...
@@ -43,11 +51,16 @@ if [ -z "$APP_VERSION" ]; then
echo
"Variable APP_VERSION not set"
echo
"Variable APP_VERSION not set"
exit
2
exit
2
fi
fi
echo
"==================================================="
echo
"APP_VERSION=
$APP_VERSION
"
echo
"APP_VERSION=
$APP_VERSION
"
echo
"==================================================="
# ensure branches exist on machine
# ensure branches exist on machine
git fetch
git fetch
generate_api
"latest"
generate_docs
"latest"
# versions
# versions
for
i
in
"
${
!versions[@]
}
"
;
do
for
i
in
"
${
!versions[@]
}
"
;
do
version
=
"
${
versions
[i]
}
"
version
=
"
${
versions
[i]
}
"
...
@@ -55,10 +68,11 @@ for i in "${!versions[@]}"; do
...
@@ -55,10 +68,11 @@ for i in "${!versions[@]}"; do
generate_docs
"
$version
"
generate_docs
"
$version
"
done
done
# finalization
# finalization
echo
"==================================================="
echo
"==================================================="
echo
"Adding index.html from branch
master
"
echo
"Adding index.html from branch
release-latest
"
echo
$INDEX_HTML
>
.docs/redirect.html
echo
$INDEX_HTML
>
.docs/redirect.html
sed
-i
-e
"s/__APPVERSION__/
${
APP_VERSION
}
/g"
.docs/redirect.html
sed
-i
-e
"s/__APPVERSION__/
${
APP_VERSION
}
/g"
.docs/redirect.html
cp
./.docs/redirect.html ./final/index.html
cp
./.docs/redirect.html ./final/index.html
echo
"==================================================="
echo
"==================================================="
\ No newline at end of file
This diff is collapsed.
Click to expand it.
.docs/redirect.html
+
2
−
2
View file @
5b52e4bc
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<head>
<head>
<meta
charset=
"UTF-8"
>
<meta
charset=
"UTF-8"
>
<title>
Redirect Notice
</title>
<title>
Redirect Notice
</title>
<meta
http-equiv=
"Refresh"
content=
"0; url='
https://www.ifs.tuwien.ac.at
/infrastructures/dbrepo/__APPVERSION__/'"
/>
<meta
http-equiv=
"Refresh"
content=
"0; url='/infrastructures/dbrepo/__APPVERSION__/'"
/>
</head>
</head>
<body>
<body>
<h1>
Redirect Notice
</h1>
<h1>
Redirect Notice
</h1>
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
available at:
available at:
</p>
</p>
<p>
<p>
<a
href=
"
https://www.ifs.tuwien.ac.at
/infrastructures/dbrepo/__APPVERSION__/"
>
https://www.ifs.tuwien.ac.at
/infrastructures/dbrepo/__APPVERSION__/
</a>
<a
href=
"/infrastructures/dbrepo/__APPVERSION__/"
>
/infrastructures/dbrepo/__APPVERSION__/
</a>
</p>
</p>
</body>
</body>
</html>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Dockerfile
+
3
−
9
View file @
5b52e4bc
...
@@ -2,11 +2,11 @@ FROM python:3.11-slim as build
...
@@ -2,11 +2,11 @@ FROM python:3.11-slim as build
WORKDIR
/app
WORKDIR
/app
ENV
VERSIONS="latest,1.4.1,1.4.0"
ENV
APP_VERSION="1.4.1"
RUN
apt-get update
&&
apt-get
install
-y
git
RUN
apt-get update
&&
apt-get
install
-y
git
ENV
VERSIONS="1.4.1,1.4.0,1.3.0"
ENV
APP_VERSION="1.4.1"
COPY
.git/ .git/
COPY
.git/ .git/
COPY
.docs/ .docs/
COPY
.docs/ .docs/
COPY
./requirements.txt ./requirements.txt
COPY
./requirements.txt ./requirements.txt
...
@@ -18,9 +18,3 @@ FROM nginx as runtime
...
@@ -18,9 +18,3 @@ FROM nginx as runtime
WORKDIR
/usr/share/nginx/html/infrastructures/dbrepo/
WORKDIR
/usr/share/nginx/html/infrastructures/dbrepo/
COPY
--from=build /app/final /usr/share/nginx/html/infrastructures/dbrepo/
COPY
--from=build /app/final /usr/share/nginx/html/infrastructures/dbrepo/
RUN
rm
-f
./index.html
RUN
pwd
RUN
ls
-la
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment