From 7d622ed4f59593c128e7952b76fe5bbabc2a4dd4 Mon Sep 17 00:00:00 2001 From: vivekr-splunk Date: Fri, 29 Sep 2023 13:07:04 -0700 Subject: [PATCH] build changes to support 2 some changes Signed-off-by: vivekr-splunk --- .env | 3 ++- .github/workflows/build-test-push-workflow.yml | 17 +++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.env b/.env index 7b60b0239..1c0a95830 100644 --- a/.env +++ b/.env @@ -7,7 +7,8 @@ AZ_CLI_VERSION=2.30.0 EKSCTL_VERSION=v0.143.0 EKS_CLUSTER_K8_VERSION=1.26 SPLUNK_ENTERPRISE_RELEASE_IMAGE=docker.io/splunk/splunk:9.0.5 -SPLUNK_RELEASE_IMAGE=[splunk:9.0.5, splunk:9.1.1] +SPLUNK_CURRENT_IMAGE=splunk/splunk:9.0.5 +SPLUNK_PREVIOUS_IMAGE=splunk/splunk:9.1.1 ECR_REPOSITORY=docker.io AWS_DEFAULT_REGION=us-west-2 SPLUNK_OPERATOR_IMAGE_NAME=splunk/splunk-operator diff --git a/.github/workflows/build-test-push-workflow.yml b/.github/workflows/build-test-push-workflow.yml index 904c58776..4a1eb2490 100644 --- a/.github/workflows/build-test-push-workflow.yml +++ b/.github/workflows/build-test-push-workflow.yml @@ -133,6 +133,7 @@ jobs: strategy: fail-fast: false matrix: + splunk_version: [ splunk/splunk:9.0.5, splunk/splunk:9.1.1 ] test: [ basic, appframeworks1, @@ -145,7 +146,7 @@ jobs: env: CLUSTER_NODES: 1 CLUSTER_WORKERS: 3 - #SPLUNK_ENTERPRISE_IMAGE: ${{ steps.dotenv.outputs.SPLUNK_ENTERPRISE_IMAGE }} + SPLUNK_ENTERPRISE_IMAGE: ${{ matrix.splunk_version }} #SPLUNK_ENTERPRISE_RELEASE_IMAGE: ${{ steps.dotenv.outputs.SPLUNK_ENTERPRISE_RELEASE_IMAGE }} SPLUNK_OPERATOR_IMAGE_NAME: splunk/splunk-operator SPLUNK_OPERATOR_IMAGE_FILENAME: splunk-operator @@ -173,10 +174,10 @@ jobs: - name: Dotenv Action id: dotenv uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359 - - name: Change splunk enterprise to release image on main branches - if: github.ref == 'refs/heads/main' - run: | - echo "SPLUNK_ENTERPRISE_IMAGE=${{ steps.dotenv.outputs.SPLUNK_ENTERPRISE_RELEASE_IMAGE }}" >> $GITHUB_ENV + #- name: Change splunk enterprise to release image on main branches + # if: github.ref == 'refs/heads/main' + # run: | + # echo "SPLUNK_ENTERPRISE_IMAGE=${{ steps.dotenv.outputs.SPLUNK_ENTERPRISE_RELEASE_IMAGE }}" >> $GITHUB_ENV - name: Install Kubectl uses: Azure/setup-kubectl@v3 with: @@ -219,7 +220,7 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN}} - name: Pull Splunk Enterprise Image - run: docker pull ${{ steps.dotenv.outputs.SPLUNK_ENTERPRISE_IMAGE }} + run: docker pull ${{ matrix.splunk_version }} - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: @@ -231,8 +232,8 @@ jobs: uses: aws-actions/amazon-ecr-login@v1 - name: Tag and Push Splunk Enterprise Image to ECR run: | - docker tag ${{ steps.dotenv.outputs.SPLUNK_ENTERPRISE_IMAGE }} ${{ secrets.ECR_REPOSITORY }}/${{ steps.dotenv.outputs.SPLUNK_ENTERPRISE_IMAGE }} - docker push ${{ secrets.ECR_REPOSITORY }}/${{ steps.dotenv.outputs.SPLUNK_ENTERPRISE_IMAGE }} + docker tag ${{ matrix.splunk_version }} ${{ secrets.ECR_REPOSITORY }}/${{ matrix.splunk_version }} + docker push ${{ secrets.ECR_REPOSITORY }}/${{ matrix.splunk_version }} - name: Pull Splunk Operator Image Locally run: | docker pull ${{ secrets.ECR_REPOSITORY }}/${{ steps.dotenv.outputs.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA