From d1ee9728a7a109e4a773c0950168852ac0261588 Mon Sep 17 00:00:00 2001 From: Giovanni Liva Date: Mon, 28 Nov 2022 09:48:35 +0100 Subject: [PATCH] Remove commented parts Signed-off-by: Giovanni Liva --- .github/workflows/CI.yaml | 308 +++++++++++++++++++------------------- 1 file changed, 154 insertions(+), 154 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 7090e4300c..1a41edfd32 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -91,77 +91,77 @@ jobs: flags: ${{ matrix.config.name }} -# build_image: -# name: Build Docker Image -# needs: prepare_ci_run -# runs-on: ubuntu-22.04 -# env: -# BRANCH: ${{ needs.prepare_ci_run.outputs.BRANCH }} -# DATETIME: ${{ needs.prepare_ci_run.outputs.DATETIME }} -# BUILD_TIME: ${{ needs.prepare_ci_run.outputs.BUILD_TIME }} -# GIT_SHA: ${{ needs.prepare_ci_run.outputs.GIT_SHA }} -# RELEASE_REGISTRY: "localhost:5000/keptn" -# strategy: -# matrix: -# config: -# - name: "keptn-lifecycle-operator" -# folder: "operator/" -# - name: "scheduler" -# folder: "scheduler/" -# - name: "functions-runtime" -# folder: "functions-runtime/" -# steps: -# - name: Check out code -# uses: actions/checkout@v3 -# -# - name: Set up Docker Buildx -# id: buildx -# uses: docker/setup-buildx-action@v2 -# -# - name: Build Docker Image -# uses: docker/build-push-action@v3 -# with: -# context: ${{ matrix.config.folder }} -# platforms: linux/amd64 -# target: production -# tags: | -# ${{ env.RELEASE_REGISTRY }}/${{ matrix.config.name }}:dev-${{ env.DATETIME }} -# build-args: | -# GIT_HASH=${{ env.GIT_SHA }} -# RELEASE_VERSION=dev-${{ env.DATETIME }} -# BUILD_TIME=${{ env.BUILD_TIME }} -# CONTROLLER_TOOLS_VERSION=${{ env.CONTROLLER_TOOLS_VERSION }} -# SCHEDULER_COMPATIBLE_K8S_VERSION=${{ env.SCHEDULER_COMPATIBLE_K8S_VERSION }} -# builder: ${{ steps.buildx.outputs.name }} -# push: false -# cache-from: type=gha, scope=${{ github.workflow }} -# cache-to: type=gha, scope=${{ github.workflow }} -# outputs: type=docker,dest=/tmp/${{ matrix.config.name }}-image.tar -# -# - name: Upload image as artifact -# uses: actions/upload-artifact@v3 -# with: -# name: ${{ matrix.config.name }}-image.tar -# path: /tmp/${{ matrix.config.name }}-image.tar -# -# - name: Install controller-gen -# if: matrix.config.name == 'keptn-lifecycle-operator' -# working-directory: ./${{ matrix.config.folder }} -# run: make controller-gen -# -# - name: Generate release.yaml -# if: matrix.config.name != 'functions-runtime' -# working-directory: ./${{ matrix.config.folder }} -# env: -# TAG: dev-${{ env.DATETIME }} -# run: make release-manifests -# -# - name: Upload release.yaml for tests -# if: matrix.config.name != 'functions-runtime' -# uses: actions/upload-artifact@v3 -# with: -# name: ${{ matrix.config.name }}-manifest-test -# path: ${{ matrix.config.folder }}/config/rendered/release.yaml + build_image: + name: Build Docker Image + needs: prepare_ci_run + runs-on: ubuntu-22.04 + env: + BRANCH: ${{ needs.prepare_ci_run.outputs.BRANCH }} + DATETIME: ${{ needs.prepare_ci_run.outputs.DATETIME }} + BUILD_TIME: ${{ needs.prepare_ci_run.outputs.BUILD_TIME }} + GIT_SHA: ${{ needs.prepare_ci_run.outputs.GIT_SHA }} + RELEASE_REGISTRY: "localhost:5000/keptn" + strategy: + matrix: + config: + - name: "keptn-lifecycle-operator" + folder: "operator/" + - name: "scheduler" + folder: "scheduler/" + - name: "functions-runtime" + folder: "functions-runtime/" + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Build Docker Image + uses: docker/build-push-action@v3 + with: + context: ${{ matrix.config.folder }} + platforms: linux/amd64 + target: production + tags: | + ${{ env.RELEASE_REGISTRY }}/${{ matrix.config.name }}:dev-${{ env.DATETIME }} + build-args: | + GIT_HASH=${{ env.GIT_SHA }} + RELEASE_VERSION=dev-${{ env.DATETIME }} + BUILD_TIME=${{ env.BUILD_TIME }} + CONTROLLER_TOOLS_VERSION=${{ env.CONTROLLER_TOOLS_VERSION }} + SCHEDULER_COMPATIBLE_K8S_VERSION=${{ env.SCHEDULER_COMPATIBLE_K8S_VERSION }} + builder: ${{ steps.buildx.outputs.name }} + push: false + cache-from: type=gha, scope=${{ github.workflow }} + cache-to: type=gha, scope=${{ github.workflow }} + outputs: type=docker,dest=/tmp/${{ matrix.config.name }}-image.tar + + - name: Upload image as artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.config.name }}-image.tar + path: /tmp/${{ matrix.config.name }}-image.tar + + - name: Install controller-gen + if: matrix.config.name == 'keptn-lifecycle-operator' + working-directory: ./${{ matrix.config.folder }} + run: make controller-gen + + - name: Generate release.yaml + if: matrix.config.name != 'functions-runtime' + working-directory: ./${{ matrix.config.folder }} + env: + TAG: dev-${{ env.DATETIME }} + run: make release-manifests + + - name: Upload release.yaml for tests + if: matrix.config.name != 'functions-runtime' + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.config.name }}-manifest-test + path: ${{ matrix.config.folder }}/config/rendered/release.yaml component_tests: name: Component Tests @@ -169,86 +169,86 @@ jobs: uses: ./.github/workflows/component-test.yml -# integration_tests: -# name: Integration Tests -# needs: [ prepare_ci_run, build_image ] -# uses: ./.github/workflows/integration-test.yml -# -# e2e_tests: -# name: End to End Tests -# needs: [ prepare_ci_run, build_image ] -# uses: ./.github/workflows/e2e-test.yml -# -# performance_tests: -# name: Performance Tests -# needs: [ prepare_ci_run, build_image ] -# uses: ./.github/workflows/performance-test.yml -# -# upload_images: -# name: Upload images to ghcr registry -# needs: [prepare_ci_run, test, component_tests, integration_tests, e2e_tests, performance_tests] -# if: github.event_name == 'push' && needs.prepare_ci_run.outputs.NON_FORKED_AND_NON_ROBOT_RUN == 'true' # only run on push to main/maintenance branches -# runs-on: ubuntu-22.04 -# strategy: -# matrix: -# config: -# - name: "keptn-lifecycle-operator" -# folder: "operator/" -# - name: "scheduler" -# folder: "scheduler/" -# - name: "functions-runtime" -# folder: "functions-runtime/" -# permissions: -# packages: write # Needed for pushing images to the registry -# steps: -# - name: Check out code -# uses: actions/checkout@v3 -# -# - name: Login to GitHub Container Registry -# uses: docker/login-action@v2 -# with: -# registry: "ghcr.io" -# username: ${{ github.actor }} -# password: ${{ secrets.GITHUB_TOKEN }} -# -# - name: Set up Docker Buildx -# id: buildx -# uses: docker/setup-buildx-action@v2 -# -# - name: Build Docker Image -# uses: docker/build-push-action@v3 -# with: -# context: ${{ matrix.config.folder }} -# platforms: linux/amd64,linux/arm64 -# target: production -# tags: | -# ghcr.io/keptn/${{ matrix.config.name }}:dev-${{ env.DATETIME }} -# build-args: | -# GIT_HASH=${{ env.GIT_SHA }} -# RELEASE_VERSION=dev-${{ env.DATETIME }} -# BUILD_TIME=${{ env.BUILD_TIME }} -# CONTROLLER_TOOLS_VERSION=${{ env.CONTROLLER_TOOLS_VERSION }} -# SCHEDULER_COMPATIBLE_K8S_VERSION=${{ env.SCHEDULER_COMPATIBLE_K8S_VERSION }} -# builder: ${{ steps.buildx.outputs.name }} -# push: true -# cache-from: type=gha, scope=${{ github.workflow }} -# cache-to: type=gha, scope=${{ github.workflow }} -# -# - name: Install controller-gen -# if: matrix.config.name == 'keptn-lifecycle-operator' -# working-directory: ./${{ matrix.config.folder }} -# run: make controller-gen -# -# - name: Generate release.yaml -# if: matrix.config.name != 'functions-runtime' -# working-directory: ./${{ matrix.config.folder }} -# env: -# TAG: dev-${{ env.DATETIME }} -# run: make release-manifests -# -# - name: Upload release.yaml -# if: matrix.config.name != 'functions-runtime' -# uses: actions/upload-artifact@v3 -# with: -# name: ${{ matrix.config.name }}-manifest -# path: ${{ matrix.config.folder }}/config/rendered/release.yaml + integration_tests: + name: Integration Tests + needs: [ prepare_ci_run, build_image ] + uses: ./.github/workflows/integration-test.yml + + e2e_tests: + name: End to End Tests + needs: [ prepare_ci_run, build_image ] + uses: ./.github/workflows/e2e-test.yml + + performance_tests: + name: Performance Tests + needs: [ prepare_ci_run, build_image ] + uses: ./.github/workflows/performance-test.yml + + upload_images: + name: Upload images to ghcr registry + needs: [prepare_ci_run, test, component_tests, integration_tests, e2e_tests, performance_tests] + if: github.event_name == 'push' && needs.prepare_ci_run.outputs.NON_FORKED_AND_NON_ROBOT_RUN == 'true' # only run on push to main/maintenance branches + runs-on: ubuntu-22.04 + strategy: + matrix: + config: + - name: "keptn-lifecycle-operator" + folder: "operator/" + - name: "scheduler" + folder: "scheduler/" + - name: "functions-runtime" + folder: "functions-runtime/" + permissions: + packages: write # Needed for pushing images to the registry + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: "ghcr.io" + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Build Docker Image + uses: docker/build-push-action@v3 + with: + context: ${{ matrix.config.folder }} + platforms: linux/amd64,linux/arm64 + target: production + tags: | + ghcr.io/keptn/${{ matrix.config.name }}:dev-${{ env.DATETIME }} + build-args: | + GIT_HASH=${{ env.GIT_SHA }} + RELEASE_VERSION=dev-${{ env.DATETIME }} + BUILD_TIME=${{ env.BUILD_TIME }} + CONTROLLER_TOOLS_VERSION=${{ env.CONTROLLER_TOOLS_VERSION }} + SCHEDULER_COMPATIBLE_K8S_VERSION=${{ env.SCHEDULER_COMPATIBLE_K8S_VERSION }} + builder: ${{ steps.buildx.outputs.name }} + push: true + cache-from: type=gha, scope=${{ github.workflow }} + cache-to: type=gha, scope=${{ github.workflow }} + + - name: Install controller-gen + if: matrix.config.name == 'keptn-lifecycle-operator' + working-directory: ./${{ matrix.config.folder }} + run: make controller-gen + + - name: Generate release.yaml + if: matrix.config.name != 'functions-runtime' + working-directory: ./${{ matrix.config.folder }} + env: + TAG: dev-${{ env.DATETIME }} + run: make release-manifests + + - name: Upload release.yaml + if: matrix.config.name != 'functions-runtime' + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.config.name }}-manifest + path: ${{ matrix.config.folder }}/config/rendered/release.yaml