From 90214ae82e7758b430f2cfa21deb0160d8df84fb Mon Sep 17 00:00:00 2001 From: Christopher Guindon Date: Wed, 30 Nov 2022 11:52:16 -0500 Subject: [PATCH 1/6] migrate off netlify Signed-off-by: Christopher Guindon --- Jenkinsfile.www | 11 +++++++++++ README.md | 7 ++----- build.sh | 17 +++++++++++++++++ netlify.toml | 4 ---- 4 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 Jenkinsfile.www create mode 100644 build.sh delete mode 100644 netlify.toml diff --git a/Jenkinsfile.www b/Jenkinsfile.www new file mode 100644 index 00000000..6c00181b --- /dev/null +++ b/Jenkinsfile.www @@ -0,0 +1,11 @@ +@Library('releng-pipeline') _ + +hugo ( + appName: 'membership-www-preview.eclipse.org', + productionBranchName: "do-not-deploy-production", + productionDomain: 'membership-www-preview.eclipse.org', + build: [ + script: 'build.sh', + destinationFolder: 'src/main/www/public' + ] +) diff --git a/README.md b/README.md index d4bbe1b0..f35c7a10 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,7 @@ # react-eclipsefdn-members -[![Netlify Status](https://api.netlify.com/api/v1/badges/b0087dce-17ae-46f6-bbea-b3813d35be3f/deploy-status)](https://app.netlify.com/sites/eclipsefdn-react-members/deploys) - Supported by our member organizations, the Eclipse Foundation provides our community with Intellectual Property, Mentorship, Marketing, Event and IT Services. - - [Getting Started](#getting-started) - [CSRF and API Security](#csrf-and-api-security) @@ -72,7 +69,7 @@ Additionally, when requesting any PII/form data, a CSRF token will need to be pa #### Environment and properties -This setup assumes that the users developing for this application are employees of Eclipse Foundation with access to internal tooling and servers. If you do not have access to these resources, manual installation and setups will be required. To do initial setup, run `make setup` in the root of the directory project. This will fetch the missing SQL needed for DB initialization as well as start up the database with all of the needed tables for running the application. +This setup assumes that the users developing for this application are employees of Eclipse Foundation with access to internal tooling and servers. If you do not have access to these resources, manual installation and setups will be required. To do initial setup, run `make setup` in the root of the directory project. This will fetch the missing SQL needed for DB initialization as well as start up the database with all of the needed tables for running the application. Once initial setup is done, retrieve the secrets in the Webdev collection in BitWarden related to this service. They follow the naming pattern of `membership-*-dev-secrets`, where the star is replaced by the service the secrets are used for. These dev secrets will bind to the dockerized MariaDB mentioned in the previous step as well as the EF Keycloak instance, connecting to the staging realms (separate from production assets). These secrets should be placed under `./config/*/secret.properties`, where the star is the service folder in the BitWarden secret name. This needs to be done before starting the actual services as otherwise Docker will create folders with incorrect permissions and need to be manually fixed. Additionally, if the mariadb password has been changed from default, replace the `quarkus.datasource.password` and `quarkus.datasource.*.password` values with the local password value. This can be retrieved by using `echo $MARIADB_PASSWORD` in the terminal if you're unsure. @@ -128,7 +125,7 @@ Linux / MacOS: /etc/hosts [^ Top](#react-eclipsefdn-members) ### MariaDB setup -The base definitions of the tables as required for the connection of this API are defined under `./application/src/main/resources/sql/rem_ddl.sql`, `./portal/src/main/resources/sql/eclipsedb_ddl.sql`, `./portal/src/main/resources/sql/dashboard_ddl.sql`, and a final file from the FoundationDB API (TODO). These should all be added present in the MariaDB instance to support this API. +The base definitions of the tables as required for the connection of this API are defined under `./application/src/main/resources/sql/rem_ddl.sql`, `./portal/src/main/resources/sql/eclipsedb_ddl.sql`, `./portal/src/main/resources/sql/dashboard_ddl.sql`, and a final file from the FoundationDB API (TODO). These should all be added present in the MariaDB instance to support this API. ### Keycloak Setup diff --git a/build.sh b/build.sh new file mode 100644 index 00000000..06859176 --- /dev/null +++ b/build.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# =========================================================================== +# Copyright (c) 2021 Eclipse Foundation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Christopher Guindon (Eclipse Foundation) +# ========================================================================== + +set -euo pipefail + +yarn --cwd src/main/www install --frozen-lockfile +yarn --cwd src/main/www build +hugo --source src/main/www --gc --minify --baseURL "${2}" \ No newline at end of file diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index 8b1605fd..00000000 --- a/netlify.toml +++ /dev/null @@ -1,4 +0,0 @@ -[build] - base = "src/main/www" - command = "rm -rf node_modules && yarn --frozen-lockfile && yarn build" - publish = "build" \ No newline at end of file -- GitLab From 016dc1370c88e7017d5923c095301fd271feeb99 Mon Sep 17 00:00:00 2001 From: Christopher Guindon Date: Wed, 30 Nov 2022 14:50:30 -0500 Subject: [PATCH 2/6] migrate off netlify Signed-off-by: Christopher Guindon --- Jenkinsfile.www | 2 +- build.sh | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 build.sh diff --git a/Jenkinsfile.www b/Jenkinsfile.www index 6c00181b..db673179 100644 --- a/Jenkinsfile.www +++ b/Jenkinsfile.www @@ -5,7 +5,7 @@ hugo ( productionBranchName: "do-not-deploy-production", productionDomain: 'membership-www-preview.eclipse.org', build: [ - script: 'build.sh', + script: 'bin/build.sh', destinationFolder: 'src/main/www/public' ] ) diff --git a/build.sh b/build.sh deleted file mode 100644 index 06859176..00000000 --- a/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# =========================================================================== -# Copyright (c) 2021 Eclipse Foundation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Christopher Guindon (Eclipse Foundation) -# ========================================================================== - -set -euo pipefail - -yarn --cwd src/main/www install --frozen-lockfile -yarn --cwd src/main/www build -hugo --source src/main/www --gc --minify --baseURL "${2}" \ No newline at end of file -- GitLab From c1432cd5025e94d9e7354ee2b53ed22f1b3eb87d Mon Sep 17 00:00:00 2001 From: Christopher Guindon Date: Wed, 30 Nov 2022 14:55:26 -0500 Subject: [PATCH 3/6] migrate off netlify Signed-off-by: Christopher Guindon --- .gitignore | 1 - bin/build.sh | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 bin/build.sh diff --git a/.gitignore b/.gitignore index 1ead873c..002f8086 100644 --- a/.gitignore +++ b/.gitignore @@ -49,7 +49,6 @@ release.properties .project .classpath .settings/ -bin/ # IntelliJ .idea diff --git a/bin/build.sh b/bin/build.sh new file mode 100644 index 00000000..3e085ae5 --- /dev/null +++ b/bin/build.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# =========================================================================== +# Copyright (c) 2021 Eclipse Foundation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Christopher Guindon (Eclipse Foundation) +# ========================================================================== + +set -euo pipefail + +yarn --cwd src/main/www install --frozen-lockfile +yarn --cwd src/main/www build -- GitLab From 6337c12117651a7b36b061e6602555d0162fd56a Mon Sep 17 00:00:00 2001 From: Christopher Guindon Date: Wed, 30 Nov 2022 15:24:54 -0500 Subject: [PATCH 4/6] migrate off netlify Signed-off-by: Christopher Guindon --- Jenkinsfile.www | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile.www b/Jenkinsfile.www index db673179..722505cb 100644 --- a/Jenkinsfile.www +++ b/Jenkinsfile.www @@ -6,6 +6,6 @@ hugo ( productionDomain: 'membership-www-preview.eclipse.org', build: [ script: 'bin/build.sh', - destinationFolder: 'src/main/www/public' + destinationFolder: 'src/main/www/build' ] ) -- GitLab From c91f783a7552e1c1e123b6a02edcb30a4f85780b Mon Sep 17 00:00:00 2001 From: "sebastien.heurtematte" Date: Mon, 5 Dec 2022 11:06:58 +0100 Subject: [PATCH 5/6] fix: dockerignore for building docker image --- .dockerignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 1475abe5..3d9e75fb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,3 @@ -* !target/*-runner !target/*-runner.jar !target/lib/* -- GitLab From f1550a928bb1c8eec9f73a27c1732f988b05ba66 Mon Sep 17 00:00:00 2001 From: Christopher Guindon Date: Mon, 5 Dec 2022 15:41:12 +0000 Subject: [PATCH 6/6] Update .dockerignore --- .dockerignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 3d9e75fb..3f217b8c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,8 @@ +* +!*default.conf !target/*-runner !target/*-runner.jar !target/lib/* !target/quarkus-app/* !config/nginx/* -!src/main/www/build/* \ No newline at end of file +!src/main/www/build/* -- GitLab