From 664f8180425386da511436e864810535fcdc75e5 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 5 May 2021 14:18:15 +0200 Subject: ci: Remove unused Gitlab and Travis CI configurations --- opendc-web/opendc-web-api/.gitlab-ci.yml | 26 -------------------------- opendc-web/opendc-web-ui/.travis.yml | 9 --------- 2 files changed, 35 deletions(-) delete mode 100644 opendc-web/opendc-web-api/.gitlab-ci.yml delete mode 100644 opendc-web/opendc-web-ui/.travis.yml (limited to 'opendc-web') diff --git a/opendc-web/opendc-web-api/.gitlab-ci.yml b/opendc-web/opendc-web-api/.gitlab-ci.yml deleted file mode 100644 index d80ba836..00000000 --- a/opendc-web/opendc-web-api/.gitlab-ci.yml +++ /dev/null @@ -1,26 +0,0 @@ -image: "python:3.8" - -variables: - PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" - -cache: - paths: - - .cache/pip - -stages: - - static-analysis - - test - -static-analysis: - stage: static-analysis - script: - - python --version - - pip install -r requirements.txt - - pylint opendc - -test: - stage: test - script: - - python --version - - pip install -r requirements.txt - - pytest opendc diff --git a/opendc-web/opendc-web-ui/.travis.yml b/opendc-web/opendc-web-ui/.travis.yml deleted file mode 100644 index c3554fe4..00000000 --- a/opendc-web/opendc-web-ui/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -node_js: - - 10 -cache: - directories: - - node_modules -script: - - npm run build - - npm test -- cgit v1.2.3 From 3c805a50ca710e123aa18ad1bfa01ea4f1ee40d2 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 5 May 2021 14:28:20 +0200 Subject: build: Update Docker ignores to prevent unnecessary builds This changes updates the .dockerignore files in the repository in order to prevent building when not necessary. --- opendc-web/opendc-web-api/.dockerignore | 8 ++++++++ opendc-web/opendc-web-ui/.dockerignore | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 opendc-web/opendc-web-api/.dockerignore (limited to 'opendc-web') diff --git a/opendc-web/opendc-web-api/.dockerignore b/opendc-web/opendc-web-api/.dockerignore new file mode 100644 index 00000000..06d67de9 --- /dev/null +++ b/opendc-web/opendc-web-api/.dockerignore @@ -0,0 +1,8 @@ +Dockerfile + +.idea/ +**/out +*.iml +.idea_modules/ + +.pytest_cache diff --git a/opendc-web/opendc-web-ui/.dockerignore b/opendc-web/opendc-web-ui/.dockerignore index dd87e2d7..b91894f6 100644 --- a/opendc-web/opendc-web-ui/.dockerignore +++ b/opendc-web/opendc-web-ui/.dockerignore @@ -1,2 +1,9 @@ +Dockerfile + +.idea/ +**/out +*.iml +.idea_modules/ + node_modules build -- cgit v1.2.3 From e8bb95cb35ed1b02a85cf7cbea5bfc20fe0324c2 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 5 May 2021 14:50:38 +0200 Subject: build: Support runtime variables in frontend Docker image This change adds support for dynamically specifying various variables for the frontend Docker image through environmental variables. Previously, these were embedded directly into the source code, which requires rebuilding the entire image to change these variables. --- opendc-web/opendc-web-ui/Dockerfile | 17 ++++++----------- opendc-web/opendc-web-ui/public/index.html | 9 ++++++++- opendc-web/opendc-web-ui/scripts/envsubst-html.sh | 19 +++++++++++++++++++ .../opendc-web-ui/src/api/routes/token-signin.js | 2 +- opendc-web/opendc-web-ui/src/api/socket.js | 2 +- opendc-web/opendc-web-ui/src/containers/auth/Login.js | 6 +++--- opendc-web/opendc-web-ui/src/index.js | 5 +++-- 7 files changed, 41 insertions(+), 19 deletions(-) create mode 100755 opendc-web/opendc-web-ui/scripts/envsubst-html.sh (limited to 'opendc-web') diff --git a/opendc-web/opendc-web-ui/Dockerfile b/opendc-web/opendc-web-ui/Dockerfile index 20e16b08..7aa3a7bf 100644 --- a/opendc-web/opendc-web-ui/Dockerfile +++ b/opendc-web/opendc-web-ui/Dockerfile @@ -1,4 +1,4 @@ -FROM node:14 AS staging +FROM node:15 AS staging MAINTAINER OpenDC Maintainers # Copy package details @@ -6,21 +6,16 @@ COPY ./package.json ./yarn.lock /opendc/ RUN cd /opendc && yarn # Build frontend -FROM node:14 AS build - -ARG OPENDC_OAUTH_CLIENT_ID -ARG OPENDC_API_BASE_URL -ARG OPENDC_FRONTEND_SENTRY_DSN +FROM node:15 AS build COPY ./ /opendc COPY --from=staging /opendc/node_modules /opendc/node_modules RUN cd /opendc/ \ - && export REACT_APP_OAUTH_CLIENT_ID=$OPENDC_OAUTH_CLIENT_ID \ - && export REACT_APP_API_BASE_URL=$OPENDC_API_BASE_URL \ - && export REACT_APP_SENTRY_DSN=$OPENDC_FRONTEND_SENTRY_DSN \ - && yarn build + && yarn build \ + && mv build/index.html build/index.html.template # Setup nginx to serve the frontend -FROM nginx:1.19 +FROM nginx:1.20 +COPY --from=build /opendc/scripts/envsubst-html.sh /docker-entrypoint.d/00-envsubst-html.sh COPY --from=build /opendc/build /usr/share/nginx/html COPY nginx.conf /etc/nginx/conf.d/default.conf diff --git a/opendc-web/opendc-web-ui/public/index.html b/opendc-web/opendc-web-ui/public/index.html index 44a0d80f..da734797 100644 --- a/opendc-web/opendc-web-ui/public/index.html +++ b/opendc-web/opendc-web-ui/public/index.html @@ -33,7 +33,7 @@ - + @@ -52,6 +52,13 @@ gtag('js', new Date()) gtag('config', 'UA-84285092-3') +