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

Update CICD to move label deletion to Jenkinsfile #2568

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions .cicd/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@ def generateStage(nodeLabel) {
catch(err) {
echo "Error: Post Results from ${nodeLabel}"
}
sh '''
export machine=${NODE_NAME}
export CHANGE_ID=${CHANGE_ID}
GIT_OWNER=$(echo $GIT_URL | cut -d '/' -f4)
GIT_REPO_NAME=$(echo $GIT_URL | cut -d '/' -f5 | cut -d '.' -f1)
set +x

echo "Testing concluded...removing label ${label} for ${machine} from ${GIT_URL}"
echo "https://api.github.com/repos/${GIT_OWNER}/${GIT_REPO_NAME}/issues/${CHANGE_ID}/labels /${machine}-${label}"
curl --silent -X DELETE -H "Accept: application/vnd.github.v3+json" -H "Authorization: Bearer ${GITHUB_TOKEN}" https://api.github.com/repos/${GIT_OWNER}/${GIT_REPO_NAME}/issues/${CHANGE_ID}/labels/{$machine-RT,$machine-BL}
'''
}
}
}
Expand Down
13 changes: 0 additions & 13 deletions .cicd/scripts/post_test_results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,6 @@ function post_test() {
GIT_URL=${GIT_URL:-"ufs-weather-model"}
CHANGE_ID=${CHANGE_ID:-"develop"}

GIT_OWNER=$(echo ${GIT_URL} | cut -d '/' -f4)
GIT_REPO_NAME=$(echo ${GIT_URL} | cut -d '/' -f5 | cut -d '.' -f1)

set +x
echo "GIT_URL=${GIT_URL}"
echo "CHANGE_ID=${CHANGE_ID}"
echo "GIT_OWNER=${GIT_OWNER} GIT_REPO_NAME=${GIT_REPO_NAME}"

echo "Testing concluded...removing label ${label} for ${machine} from ${GIT_URL}"
echo "https://api.github.com/repos/${GIT_OWNER}/${GIT_REPO_NAME}/issues/${CHANGE_ID}/labels /${machine}-${label}"
curl --silent -X DELETE -H "Accept: application/vnd.github.v3+json" -H "Authorization: Bearer ${GITHUB_TOKEN}" https://api.github.com/repos/${GIT_OWNER}/${GIT_REPO_NAME}/issues/${CHANGE_ID}/labels/${machine}-${label}
set -x

git config user.email "ecc.platform@noaa.gov"
git config user.name "epic-cicd-jenkins"

Expand Down
Loading