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
bf7e5594
Verified
Commit
bf7e5594
authored
1 year ago
by
Martin Weise
Browse files
Options
Downloads
Patches
Plain Diff
Updated the build script
parent
6a9e5839
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.docs/build-website.sh
+15
-28
15 additions, 28 deletions
.docs/build-website.sh
Dockerfile
+1
-1
1 addition, 1 deletion
Dockerfile
with
16 additions
and
29 deletions
.docs/build-website.sh
+
15
−
28
View file @
bf7e5594
#!/bin/bash
INDEX_HTML
=
""
function
generate_docs
{
BRANCH
=
"release-
$1
"
echo
"==================================================="
echo
"Building DOCS for version
$1
on branch
$
2
"
echo
"Building DOCS for version
$1
on branch
$
BRANCH
"
echo
"==================================================="
git reset
--hard
&&
git checkout
"
$
2
"
git reset
--hard
&&
git checkout
"
$
BRANCH
"
pip
install
-r
./requirements.txt
>
/dev/null
mkdir
-p
./final
find .docs/
-type
f
-exec
sed
-i
-e
"s/__APPVERSION__/
$1
/g"
{}
\;
find .docs/
-type
f
-exec
sed
-i
-e
"s/__CHARTVERSION__/
$1
/g"
{}
\;
if
[
"
$1
"
=
"latest"
]
;
then
INDEX_HTML
=
$(
cat
.docs/redirect.html
)
OVERRIDES_MAIN_HTML
=
$(
cat
.docs/overrides/main.html
)
else
echo
$OVERRIDES_MAIN_HTML
>
.docs/overrides/main.html
fi
mkdocs build
>
/dev/null
&&
cp
-r
./site
"./final/
$1
"
cp
-r
"./swagger/
$1
"
"./final/
$1
/swagger"
}
function
generate_api
{
BRANCH
=
"release-
$1
"
echo
"==================================================="
echo
"Building API for version
$1
on branch
$
2
"
echo
"Building API for version
$1
on branch
$
BRANCH
"
echo
"==================================================="
git reset
--hard
&&
git checkout
"
$
2
"
git reset
--hard
&&
git checkout
"
$
BRANCH
"
bash .docs/.swagger/swagger-site.sh
find ./site
-type
f
-exec
sed
-i
-e
"s/__APPVERSION__/
$1
/g"
{}
\;
mkdir
-p
"./swagger/
$1
"
cp
-r
./site/
*
"./swagger/
$1
/"
}
INDEX_HTML
=
""
OVERRIDES_MAIN_HTML
=
""
# usage
if
[
-z
"
$
v1_TAG
S
"
]
;
then
echo
"Variable
v1_TAG
S not set"
if
[
-z
"
$
VERSION
S
"
]
;
then
echo
"Variable
VERSION
S not set"
exit
1
fi
tags
=(
${
v1_TAG
S
//,/
}
)
versions
=(
${
VERSION
S
//,/
}
)
# usage
if
[
-z
"
$APP_VERSION
"
]
;
then
...
...
@@ -47,25 +45,14 @@ if [ -z "$APP_VERSION" ]; then
fi
echo
"APP_VERSION=
$APP_VERSION
"
echo
" ~> latest"
for
i
in
"
${
!tags[@]
}
"
;
do
version
=
"
${
tags
[i]
}
"
echo
" ~>
$version
"
done
# ensure branches exist on machine
git fetch
# latest
generate_api
"latest"
"master"
generate_docs
"latest"
"master"
# versions
for
i
in
"
${
!
tag
s[@]
}
"
;
do
version
=
"
${
tag
s
[i]
}
"
generate_api
"
$version
"
"v
$version
"
generate_docs
"
$version
"
"v
$version
"
for
i
in
"
${
!
version
s[@]
}
"
;
do
version
=
"
${
version
s
[i]
}
"
generate_api
"
$version
"
generate_docs
"
$version
"
done
# finalization
...
...
This diff is collapsed.
Click to expand it.
Dockerfile
+
1
−
1
View file @
bf7e5594
...
...
@@ -2,7 +2,7 @@ FROM python:3.11-slim as build
WORKDIR
/app
ENV
v1_TAGS="
1.4.
0
,1.4.
1
"
ENV
VERSIONS="latest,
1.4.
1
,1.4.
0
"
ENV
APP_VERSION="1.4.1"
RUN
apt-get update
&&
apt-get
install
-y
git
...
...
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