Skip to content

Add Jenkins Webhook and RFS E2E job on PR #5

Add Jenkins Webhook and RFS E2E job on PR

Add Jenkins Webhook and RFS E2E job on PR #5

Workflow file for this run

name: Jenkins E2E
on:
push:
pull_request:
env:
python-version: '3.11'
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
rfs-e2e-aws-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./jenkins/webhookTriggers
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: Install dependencies for python webhook
run: |
python3 -m pip install --upgrade pipenv
pipenv install --deploy
- name: Trigger jenkins job and wait for completion
env:
WEBHOOK_TOKEN: ${{ secrets.JENKINS_MIGRATIONS_GENERIC_WEBHOOK_TOKEN }}
run: |
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
branch_name="${{ github.event.pull_request.head.ref }}"
pr_repo_url="https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git"
else
branch_name="${{ github.ref_name }}"
pr_repo_url="${{ github.repository }}"
fi
echo "Running jenkins test on repo: $pr_repo_url and branch: $branch_name"
pipenv run python3 default_webhook_trigger.py \
--jenkins_url="https://migrations.ci.opensearch.org" \
--pipeline_token="$WEBHOOK_TOKEN" \
--job_name=rfs-default-e2e-test \
--job_param="GIT_REPO_URL=$pr_repo_url" \
--job_param="GIT_BRANCH=$branch_name"