Skip to content

Commit

Permalink
save built WebUI static files into gh-pages repo (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
agoelzer authored Dec 2, 2024
1 parent 7ba9a04 commit 62e1672
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ on:
- "main"
- "rel/*"
jobs:
publish_docker_image:
name: Publish Docker Image
publish_docker_image_and_helm:
name: Publish Docker Image and helm charts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install JDK 17
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -45,15 +47,6 @@ jobs:
name: test-results
path: selenium-tests/target/test-results
retention-days: 7

publish_helm_chart:
name: Publish Helm Chart
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
Expand Down
6 changes: 6 additions & 0 deletions build_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ if [ "$1" == "createHelmPackage" ] ; then
(cd build/charts && helm package ${REPOSITORY})
cat ${CHART_FILE} | sed "s/^version: .*/version: \"${VERSION}-latest\"/g" > build/${CHART_FILE}
(cd build/charts && helm package ${REPOSITORY})

echo "Create tgz file from static files"
mkdir -p build/static_files
docker run nuodbaas-webui tgz_static > build/static_files/${REPOSITORY}-html-${SNAPSHOT}.tgz
cp build/static_files/${REPOSITORY}-html-${SNAPSHOT}.tgz build/static_files/${REPOSITORY}-html-${VERSION}-latest.tgz
exit 0
fi

Expand Down Expand Up @@ -142,6 +147,7 @@ if [ "$1" == "uploadHelmPackage" ] ; then
# Update index with new Helm charts
mv build/charts/*.tgz ./
helm repo index .
mv static_files/*.tgz ./

git add index.yaml *.tgz
git commit -m "Add chart ${NEW_CHART} to index"
Expand Down
7 changes: 7 additions & 0 deletions docker/production/files/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/sh
# (C) Copyright 2024 Dassault Systemes SE. All Rights Reserved.

if [ "$1" == "tgz_static" ] ; then
echo "Exctract static files from image"
cd /usr/share/nginx/html
tar -czf - -C /usr/share/nginx/html *
exit $?
fi

if [ "${NUODB_CP_REST_URL}" != "" ] ; then
find /usr/share/nginx/html -type f | while read line; do
sed -i "s#___NUODB_CP_REST_URL___#${NUODB_CP_REST_URL}#g" ${line}
Expand Down

0 comments on commit 62e1672

Please sign in to comment.