From a35f8d603f6fb16a6fe951954f2a2a607b6b43d3 Mon Sep 17 00:00:00 2001 From: Daniel Pimenta <105205108+daniel-pimenta-DME@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:05:18 +0000 Subject: [PATCH 1/2] Release (#20) * Add helm charts * Rename to identity portal * Add portal components * Fix ci * Fix ci * Update configs * Update keycloak realm * Revert realm to master * Add service calls and cookies * Clear request uri on service change * Fix cookie delete * Add more service links * Update ci * Update ci * Fix issue * Fix ci * Fix scrollbars * Add refresh token * Fix dockerfile * Add offline access * Revert offline token --- src/app/@core/configs/keycloak.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/@core/configs/keycloak.config.ts b/src/app/@core/configs/keycloak.config.ts index 3dec969..c6ff700 100644 --- a/src/app/@core/configs/keycloak.config.ts +++ b/src/app/@core/configs/keycloak.config.ts @@ -33,7 +33,7 @@ export function initializeKeycloak(keycloak: KeycloakService) { }, initOptions: { onLoad: 'check-sso', - scope: 'openid offline_access' + scope: 'openid' } }).catch(onReject => console.error(onReject)); } \ No newline at end of file From d502bf77ad11e85ad76ac519e379616da1efc55c Mon Sep 17 00:00:00 2001 From: Daniel Pimenta <105205108+daniel-pimenta-DME@users.noreply.github.com> Date: Tue, 2 Jan 2024 12:08:55 +0000 Subject: [PATCH 2/2] Release (#22) * Add helm charts * Rename to identity portal * Add portal components * Fix ci * Fix ci * Update configs * Update keycloak realm * Revert realm to master * Add service calls and cookies * Clear request uri on service change * Fix cookie delete * Add more service links * Update ci * Update ci * Fix issue * Fix ci * Fix scrollbars * Add refresh token * Fix dockerfile * Add offline access * Revert offline token * Add demo workflow * Fix workflow * Fix angular config * Fix dockerfile * Update README.md * Update README.md --- .github/workflows/docker-publish-demo.yml | 114 +++++++++++++++++++ .github/workflows/docker-publish-develop.yml | 1 + .github/workflows/docker-publish-master.yml | 1 + README.md | 15 +-- angular.json | 33 +++++- package.json | 4 +- 6 files changed, 154 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/docker-publish-demo.yml diff --git a/.github/workflows/docker-publish-demo.yml b/.github/workflows/docker-publish-demo.yml new file mode 100644 index 0000000..c1e0635 --- /dev/null +++ b/.github/workflows/docker-publish-demo.yml @@ -0,0 +1,114 @@ +name: Docker + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +on: + push: + branches: [ "demo" ] + tags: [ 'v*.*.*' ] + +env: + # Use docker.io for Docker Hub if empty + GITHUB_REGISTRY: ghcr.io + DOCKER_REGISTRY: docker.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Install the cosign tool except on PR + # https://github.com/sigstore/cosign-installer + - name: Install cosign + if: github.event_name != 'pull_request' + uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1 + with: + cosign-release: 'v2.1.1' + + # Workaround: https://github.com/docker/build-push-action/issues/461 + - name: Setup Docker buildx + uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.GITHUB_REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c + with: + registry: ${{ env.GITHUB_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=demo + type=ref,event=tag + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a + with: + push: ${{ github.event_name != 'pull_request' }} + build-args: CONFIGURATION=demo + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + # Sign the resulting Docker image digest except on PRs. + # This will only write to the public Rekor transparency log when the Docker + # repository is public to avoid leaking data. If you would like to publish + # transparency data even for private images, pass --force to cosign below. + # https://github.com/sigstore/cosign + - name: Sign the published Docker image + if: ${{ github.event_name != 'pull_request' }} + env: + # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable + TAGS: ${{ steps.meta.outputs.tags }} + DIGEST: ${{ steps.build-and-push.outputs.digest }} + # This step uses the identity token to provision an ephemeral certificate + # against the sigstore community Fulcio instance. + run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} + + - name: Log into registry ${{ env.DOCKER_REGISTRY }} + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: docker_meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: "{{defaultContext}}" + push: true + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/docker-publish-develop.yml b/.github/workflows/docker-publish-develop.yml index 9fb62bc..70829b3 100644 --- a/.github/workflows/docker-publish-develop.yml +++ b/.github/workflows/docker-publish-develop.yml @@ -74,6 +74,7 @@ jobs: uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a with: push: ${{ github.event_name != 'pull_request' }} + build-args: CONFIGURATION=develop tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha diff --git a/.github/workflows/docker-publish-master.yml b/.github/workflows/docker-publish-master.yml index 2ae1249..81b1e63 100644 --- a/.github/workflows/docker-publish-master.yml +++ b/.github/workflows/docker-publish-master.yml @@ -74,6 +74,7 @@ jobs: uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a with: push: ${{ github.event_name != 'pull_request' }} + build-args: CONFIGURATION=production tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha diff --git a/README.md b/README.md index cf1e7dd..5f495d3 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,6 @@

- - Logo -

eoepca-portal

@@ -235,14 +232,14 @@ Project Link: [https://github.com/EOEPCA/eoepca-portal](https://github.com/EOEPC - README.md is based on [this template](https://github.com/othneildrew/Best-README-Template) by [Othneil Drew](https://github.com/othneildrew). -[contributors-shield]: https://img.shields.io/github/contributors/EOEPCA/eoepca-portalsvg?style=flat-square +[contributors-shield]: https://img.shields.io/github/contributors/EOEPCA/eoepca-portal.svg?style=flat-square [contributors-url]: https://github.com/EOEPCA/eoepca-portal/graphs/contributors -[forks-shield]: https://img.shields.io/github/forks/EOEPCA/eoepca-portalsvg?style=flat-square +[forks-shield]: https://img.shields.io/github/forks/EOEPCA/eoepca-portal.svg?style=flat-square [forks-url]: https://github.com/EOEPCA/eoepca-portal/network/members -[stars-shield]: https://img.shields.io/github/stars/EOEPCA/eoepca-portalsvg?style=flat-square +[stars-shield]: https://img.shields.io/github/stars/EOEPCA/eoepca-portal.svg?style=flat-square [stars-url]: https://github.com/EOEPCA/eoepca-portal/stargazers -[issues-shield]: https://img.shields.io/github/issues/EOEPCA/eoepca-portalsvg?style=flat-square +[issues-shield]: https://img.shields.io/github/issues/EOEPCA/eoepca-portal.svg?style=flat-square [issues-url]: https://github.com/EOEPCA/eoepca-portal/issues -[license-shield]: https://img.shields.io/github/license/EOEPCA/eoepca-portalsvg?style=flat-square +[license-shield]: https://img.shields.io/github/license/EOEPCA/eoepca-portal.svg?style=flat-square [license-url]: https://github.com/EOEPCA/eoepca-portal/blob/master/LICENSE -[build-shield]: https://www.travis-ci.com/EOEPCA/eoepca-portalsvg?branch=master \ No newline at end of file +[build-shield]: https://www.travis-ci.com/EOEPCA/eoepca-portal.svg?branch=master diff --git a/angular.json b/angular.json index 9b5f48d..af7be11 100644 --- a/angular.json +++ b/angular.json @@ -77,6 +77,27 @@ } ] }, + "demo": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "500kb", + "maximumError": "1mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], + "outputHashing": "all", + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.demo.ts" + } + ] + }, "develop": { "budgets": [ { @@ -115,11 +136,17 @@ "production": { "browserTarget": "eoepca-portal:build:production" }, - "development": { - "browserTarget": "eoepca-portal:build:development" + "demo": { + "browserTarget": "eoepca-portal:build:demo" + }, + "staging": { + "browserTarget": "eoepca-portal:build:staging" + }, + "develop": { + "browserTarget": "eoepca-portal:build:develop" } }, - "defaultConfiguration": "development" + "defaultConfiguration": "develop" }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", diff --git a/package.json b/package.json index eb1a0c9..9f7c49f 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "ng": "ng", "start": "ng serve", "build": "ng build", - "watch": "ng build --watch --configuration development", + "watch": "ng build --watch --configuration develop", "test": "ng test", "start:production": "ng serve --configuration=production", "start:staging": "ng serve --configuration=staging", @@ -53,4 +53,4 @@ "karma-jasmine-html-reporter": "~2.1.0", "typescript": "~5.1.3" } -} +} \ No newline at end of file