From 1af502c75a3fa6466348851e9070b325a0a584f7 Mon Sep 17 00:00:00 2001 From: Saikrishna Bairamoni <84093461+SaikrishnaBairamoni@users.noreply.github.com> Date: Wed, 12 Jun 2024 12:06:45 -0400 Subject: [PATCH] update the dockerhub.yml to replace tags --- .circleci/config.yml | 56 --------------------------------- .github/workflows/dockerhub.yml | 7 ++++- 2 files changed, 6 insertions(+), 57 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index e9f167f03..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,56 +0,0 @@ -version: 2.1 - -# Copyright (C) 2018-2020 LEIDOS. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -jobs: - build: - docker: - - image: 'cimg/openjdk:21.0.2-node' - steps: - - checkout - - run: - name: Initialize Submodules - command: | - set -x - pwd - ls - git submodule init - git submodule update - cd asn1_codec - git submodule init - git submodule update - - run: - name: Analyze on SonarCloud - command: | - echo "URL ${CIRCLE_PULL_REQUEST}" - if [ -z "${CIRCLE_PULL_REQUEST}" ]; then - echo "Non-PR Build Detected. Running analysis on ${CIRCLE_BRANCH}" - mvn -e -X clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar - exit 0; - fi - echo "PR branch ${CIRCLE_BRANCH}" - echo "Repo name ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" - echo "URL ${CIRCLE_PULL_REQUEST}" - export PR_NUM=`echo ${CIRCLE_PULL_REQUEST} | cut -d'/' -f7` - echo "PR number ${PR_NUM}" - export BASE_BRANCH_URL="https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUM}" - export TARGET_BRANCH=$(curl "$BASE_BRANCH_URL" | jq '.base.ref' | tr -d '"') - echo "Target Branch = ${TARGET_BRANCH}" - mvn -e -X clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} -workflows: - main: - jobs: - - build: - context: SonarCloud diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 04eb9c2ab..5db9c2cd2 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -20,8 +20,13 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Replcae Docker tag + id: set_tag + run: echo "TAG=$(echo ${GITHUB_REF##*/} | sed 's/\//-/g')" >> $GITHUB_ENV + - name: Build uses: docker/build-push-action@v3 with: push: true - tags: usdotjpoode/jpo-ode:${{ github.ref_name }} + tags: usdotjpoode/jpo-ode:${{ env.TAG }} \ No newline at end of file