Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.3.0 refactor directory structure: Clean up unnecessary files and restructure repo #259

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .env

This file was deleted.

2 changes: 1 addition & 1 deletion .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ updates:
-
package-ecosystem: "docker"
target-branch: main
directory: /
directory: ./dpp-frontend/
labels:
- "dependabot"
- "docker"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:

- name: Install ESLint
run: |
cd dpp-frontend
npm install [email protected] --legacy-peer-deps
npm install @microsoft/[email protected] --legacy-peer-deps

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
id: build-frontend
uses: docker/build-push-action@v3
with:
context: .
context: dpp-frontend
push: true
tags: ${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE}}:${{ env.TAG }}

Expand All @@ -98,7 +98,7 @@
tags: ${{ env.REGISTRY }}/${{ env.BACKEND_IMAGE}}:${{ env.TAG }}

- name: Set up Helm
uses: azure/setup-helm@v3

Check warning on line 101 in .github/workflows/helm-test.yaml

View workflow job for this annotation

GitHub Actions / Analyze

[MEDIUM] Unpinned Actions Full Length Commit SHA

Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. When selecting a SHA, you should verify it is from the action's repository and not a repository fork.
with:
version: v3.9.3

Expand Down
110 changes: 57 additions & 53 deletions .github/workflows/publish-dpp-backend-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ env:
IMAGE_NAMESPACE: 'tractusx'

jobs:
build:
build-on-docker:
if: github.repository == 'eclipse-tractusx/digital-product-pass'
runs-on: ubuntu-latest
permissions:
packages: write
Expand All @@ -59,104 +60,107 @@ jobs:
with:
ref: ${{ github.ref }}

- name: Setup Java
uses: ./.github/actions/setup-java

# Build actions for GHCR registry
- name: Docker meta for GHCR
id: meta-for-ghcr
if: ${{ github.repository != 'eclipse-tractusx/digital-product-pass' }}
# Build actions for docker hub registry
- name: Docker meta
id: meta-for-dockerhub
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }}
${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}

# Login against GHCR registry
# Login against docker registry
# https://github.com/docker/login-action
- name: Log into GHCR registry
if: ${{ github.repository != 'eclipse-tractusx/digital-product-pass' }}
- name: Log into a Docker registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

# Build Java code with Maven
- name: Build dpp backend with maven for GHCR registry
if: ${{ github.repository != 'eclipse-tractusx/digital-product-pass' }}
- name: Build dpp backend with maven
run: |
cd dpp-backend/digitalproductpass
mvn -B clean install

# Build and push Docker image with Buildx
# https://github.com/docker/build-push-action
- name: Build and push backend for GHCR registry
id: build-and-push-backend-ghcr
if: ${{ github.repository != 'eclipse-tractusx/digital-product-pass' }}
- name: Build and push backend
id: build-and-push-backend-dockerhub
uses: docker/build-push-action@v5
with:
context: dpp-backend/digitalproductpass
push: true
tags: ${{ steps.meta-for-ghcr.outputs.tags }}, ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta-for-ghcr.outputs.labels }}
tags: ${{ steps.meta-for-dockerhub.outputs.tags }}, ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta-for-dockerhub.outputs.labels }}

# Build actions for docker hub registry
- name: Docker meta for Docker Hub
id: meta-for-dockerhub
if: ${{ github.repository == 'eclipse-tractusx/digital-product-pass' }}
# https://github.com/peter-evans/dockerhub-description
# Important step to push image description to DockerHub
- name: Update Docker Hub description
uses: peter-evans/dockerhub-description@v4
with:
# readme-filepath defaults to toplevel README.md, Only necessary if you have a dedicated file with your 'Notice for docker images'
readme-filepath: docs/notice.md
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}

build-on-ghcr:
if: github.repository != 'eclipse-tractusx/digital-product-pass'
runs-on: ubuntu-latest
permissions:
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Setup Java
uses: ./.github/actions/setup-java

# Build actions for GHCR registry
- name: Docker meta
id: meta-for-ghcr
uses: docker/metadata-action@v5
with:
images: |
${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}

# Login against docker registry
# Login against GHCR registry
# https://github.com/docker/login-action
- name: Log into a Docker registry
if: ${{ github.repository == 'eclipse-tractusx/digital-product-pass' }}
- name: Log into GHCR registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Build Java code with Maven
- name: Build dpp backend with maven for Docker Hub
if: ${{ github.repository == 'eclipse-tractusx/digital-product-pass' }}
- name: Build dpp backend with maven
run: |
cd dpp-backend/digitalproductpass
mvn -B clean install

# Build and push Docker image with Buildx
# https://github.com/docker/build-push-action
- name: Build and push backend for Docker Hub
id: build-and-push-backend-dockerhub
if: ${{ github.repository == 'eclipse-tractusx/digital-product-pass' }}
- name: Build and push backend
id: build-and-push-backend-ghcr
uses: docker/build-push-action@v5
with:
context: dpp-backend/digitalproductpass
push: true
tags: ${{ steps.meta-for-dockerhub.outputs.tags }}, ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta-for-dockerhub.outputs.labels }}

# https://github.com/peter-evans/dockerhub-description
# Important step to push image description to DockerHub
- name: Update Docker Hub description
if: ${{ github.repository == 'eclipse-tractusx/digital-product-pass' }}
uses: peter-evans/dockerhub-description@v4
with:
# readme-filepath defaults to toplevel README.md, Only necessary if you have a dedicated file with your 'Notice for docker images'
readme-filepath: docs/notice.md
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
tags: ${{ steps.meta-for-ghcr.outputs.tags }}, ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta-for-ghcr.outputs.labels }}
104 changes: 54 additions & 50 deletions .github/workflows/publish-dpp-frontend-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,104 +49,108 @@
REPO_URL: ${{ github.server_url }}/${{ github.repository }}

jobs:
build:

build-on-docker:
if: github.repository == 'eclipse-tractusx/digital-product-pass'
runs-on: ubuntu-latest
permissions:
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

# Build actions for GHCR registry
- name: Docker meta for GHCR
id: meta-for-ghcr
if: ${{ github.repository != 'eclipse-tractusx/digital-product-pass' }}
# Build actions for docker hub registry
- name: Docker meta
id: meta-for-dockerhub
uses: docker/metadata-action@v5
with:
context: dpp-frontend
images: |
${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }}
${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}

# Login against GHCR registry
# Login against docker registry
# https://github.com/docker/login-action
- name: Log into GHCR registry
if: ${{ github.repository != 'eclipse-tractusx/digital-product-pass' }}
- name: Log into a Docker registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

# Build and push Docker image with Buildx
# https://github.com/docker/build-push-action
- name: Build and push frontend for GHCR registry
id: build-and-push-frontend-ghcr
if: ${{ github.repository != 'eclipse-tractusx/digital-product-pass' }}
- name: Build and push frontend
id: build-and-push-frontend-dockerhub
uses: docker/build-push-action@v5

Check warning on line 86 in .github/workflows/publish-dpp-frontend-docker-image.yml

View workflow job for this annotation

GitHub Actions / Analyze

[MEDIUM] Unpinned Actions Full Length Commit SHA

Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. When selecting a SHA, you should verify it is from the action's repository and not a repository fork.
with:
context: dpp-frontend
push: true
tags: ${{ steps.meta-for-ghcr.outputs.tags }}, ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta-for-ghcr.outputs.labels }}
tags: ${{ steps.meta-for-dockerhub.outputs.tags }}, ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta-for-dockerhub.outputs.labels }}
build-args: |
REPO_COMMIT_ID=${{ env.COMMIT_SHA }}
REPO_ENDPOINT_URL=${{ env.REPO_URL }}

# Build actions for docker hub registry
- name: Docker meta for Docker Hub
id: meta-for-dockerhub
if: ${{ github.repository == 'eclipse-tractusx/digital-product-pass' }}

# https://github.com/peter-evans/dockerhub-description
# Important step to push image description to DockerHub
- name: Update Docker Hub description
uses: peter-evans/dockerhub-description@v4

Check warning on line 100 in .github/workflows/publish-dpp-frontend-docker-image.yml

View workflow job for this annotation

GitHub Actions / Analyze

[MEDIUM] Unpinned Actions Full Length Commit SHA

Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. When selecting a SHA, you should verify it is from the action's repository and not a repository fork.
with:
# readme-filepath defaults to toplevel README.md, Only necessary if you have a dedicated file with your 'Notice for docker images'
readme-filepath: docs/notice.md
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}

build-on-ghcr:
if: github.repository != 'eclipse-tractusx/digital-product-pass'
runs-on: ubuntu-latest
permissions:
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

# Build actions for GHCR registry
- name: Docker meta
id: meta-for-ghcr
uses: docker/metadata-action@v5
with:
images: |
${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}

# Login against docker registry
# Login against GHCR registry
# https://github.com/docker/login-action
- name: Log into a Docker registry
if: ${{ github.repository == 'eclipse-tractusx/digital-product-pass' }}
- name: Log into GHCR registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Build and push Docker image with Buildx
# https://github.com/docker/build-push-action
- name: Build and push frontend for Docker Hub
id: build-and-push-frontend-dockerhub
if: ${{ github.repository == 'eclipse-tractusx/digital-product-pass' }}
- name: Build and push frontend for GHCR registry
id: build-and-push-frontend-ghcr
uses: docker/build-push-action@v5
with:
context: dpp-frontend
push: true
tags: ${{ steps.meta-for-dockerhub.outputs.tags }}, ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta-for-dockerhub.outputs.labels }}
tags: ${{ steps.meta-for-ghcr.outputs.tags }}, ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta-for-ghcr.outputs.labels }}
build-args: |
REPO_COMMIT_ID=${{ env.COMMIT_SHA }}
REPO_ENDPOINT_URL=${{ env.REPO_URL }}


# https://github.com/peter-evans/dockerhub-description
# Important step to push image description to DockerHub
- name: Update Docker Hub description
if: ${{ github.repository == 'eclipse-tractusx/digital-product-pass' }}
uses: peter-evans/dockerhub-description@v4
with:
# readme-filepath defaults to toplevel README.md, Only necessary if you have a dedicated file with your 'Notice for docker images'
readme-filepath: docs/notice.md
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}
3 changes: 1 addition & 2 deletions .github/workflows/release-helm-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ jobs:

- name: Install Helm Repos
run: |
helm repo add product-edc https://catenax-ng.github.io/product-edc
helm repo add tractusx-dev https://eclipse-tractusx.github.io/charts/dev
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add cx-backend-service https://denisneuling.github.io/cx-backend-service

- name: Run chart-releaser
uses: helm/[email protected]
Expand Down
Loading
Loading