Skip to content

Commit

Permalink
Merge pull request #259 from catenax-ng/release/3.0.0-refactor-direct…
Browse files Browse the repository at this point in the history
…ory-structure

Release/2.3.0 refactor directory structure: Clean up unnecessary files and restructure repo
  • Loading branch information
saudkhan116 authored Apr 16, 2024
2 parents a444118 + 4bc1526 commit 754c97e
Show file tree
Hide file tree
Showing 266 changed files with 18,710 additions and 24,500 deletions.
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 @@ jobs:
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 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 @@ env:
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
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
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

Check warning on line 123 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:
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

0 comments on commit 754c97e

Please sign in to comment.