Skip to content

Commit

Permalink
triggers the jenkins build
Browse files Browse the repository at this point in the history
  • Loading branch information
suchetla committed Jul 15, 2024
1 parent 61743c7 commit 4e9add4
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/trigger-jenkins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,26 @@ jobs:
- name: Set up environment variables
run: |
echo "Setting up environment variables..."
echo "JENKINS_URL: ${{ secrets.JENKINS_URL }}"
echo "JOB_NAME: ${{ secrets.JOB_NAME }}"
echo "JENKINS_USER: ${{ secrets.JENKINS_USER }}"
echo "JENKINS_URL is set"
echo "JOB_NAME starts with ${JOB_NAME:0:4}"
echo "JENKINS_USER starts with ${JENKINS_USER:0:2}"
echo "GIT_COMMIT: ${{ github.sha }}"
echo "GIT_BRANCH: ${{ github.ref }}"
echo "PR_NUMBER: ${{ github.event.number }}"
echo "GITHUB_REPO: ${{ github.repository }}"
- name: Test DNS Resolution
run: |
echo "Testing DNS resolution for Jenkins URL..."
nslookup $(echo "${{ secrets.JENKINS_URL }}" | awk -F[/:] '{print $4}') || exit 1
- name: Test Jenkins URL
run: |
echo "Testing Jenkins URL..."
curl -I "${{ secrets.JENKINS_URL }}" || exit 1
- name: Trigger Jenkins Build
if: success() # Proceed only if the previous steps succeed
env:
JENKINS_URL: ${{ secrets.JENKINS_URL }}
JOB_NAME: ${{ secrets.JOB_NAME }}
Expand Down

0 comments on commit 4e9add4

Please sign in to comment.