Skip to content

Commit

Permalink
Merge 9ef8ddf into sapling-pr-archive-ktf
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf authored Jan 22, 2025
2 parents fd02086 + 9ef8ddf commit 75d4c2f
Show file tree
Hide file tree
Showing 20 changed files with 157 additions and 387 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/build-any-ib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
# Launch the build-any-ib job in Jenkins
name: Build any IB

"on":
workflow_dispatch:
inputs:
package_name:
type: string
description: Name of the package to build
default: "O2"
alidist_slug:
type: string
description: Alidist version to use for the package (group/repo[@branch])
default: "alisw/alidist@master"
architecture:
type: choice
description: Architecture to build the package for
default: "slc9_x86-64"
options:
- "slc9_x86-64"
- "slc9_aarch64"
- "slc8_x86-64"
- "slc7_x86-64"
- "ubuntu2004_x86-64"
- "ubuntu2204_x86-64"
- "ubuntu2404_x86-64"
- "osx_x86-64"

permissions: {}

jobs:
build-any-ib:
runs-on: ubuntu-latest

env:
# --- Jenkins and SSO params ---
JENKINS_URL: ${{ secrets.JENKINS_URL }}
SSO_AUTH_URL: ${{ secrets.SSO_AUTH_URL }}
CLIENT_ID: ${{ secrets.SSO_JENKINS_API_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.SSO_JENKINS_API_CLIENT_SECRET }}
TARGET_APP: ${{ secrets.SSO_JENKINS_API_TARGET_APP }}
JOB_NAME: "build-any-ib"

# --- build-any-ib build params ---
# ALIBUILD_SLUG: ${{ inputs.alibuild_slug }}
ALIDIST_SLUG: ${{ inputs.alidist_slug }}
ARCHITECTURE: ${{ inputs.architecture }}
PACKAGE_NAME: ${{ inputs.package_name }}
# OVERRIDE_TAGS: ${{ inputs.override_tags }}
# OVERRIDE_VERSIONS: ${{ inputs.override_versions }}
# DEFAULTS: "o2"
# PUBLISH_BUILDS: "true"
# USE_REMOTE_STORE: "true"

steps:
- name: Launch the build-any-ib job in Jenkins and wait for completion
run: |
set -euo pipefail
# Login against SSO
TOKEN="$(curl --location -X POST "$SSO_AUTH_URL" \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode "client_id=$CLIENT_ID" \
--data-urlencode "client_secret=$CLIENT_SECRET" \
--data-urlencode "audience=$TARGET_APP" | jq -r '.access_token')"
# Trigger the Jenkins job and get the queue item location
QUEUE_URL=$(curl -w "%{redirect_url}" -s -o /dev/null "$JENKINS_URL/job/$JOB_NAME/buildWithParameters" \
-H "Authorization: Bearer $TOKEN" \
--data "PACKAGE_NAME=$PACKAGE_NAME" \
--data "ALIDIST_SLUG=$ALIDIST_SLUG" \
--data "ARCHITECTURE=$ARCHITECTURE" | grep -i "Location:" | awk '{print $2}' | tr -d '\r' |\
xargs | sed 's/http/https/') # Remove any trailing whitespace, change http to https
if [ -z "$QUEUE_URL" ]; then
echo "::error::Failed to get queue URL from Jenkins"
exit 1
fi
# Poll the queue item until we get the actual job URL
while true; do
QUEUE_RESPONSE=$(curl -L -s "$QUEUE_URL/api/json" -H "Authorization: Bearer $TOKEN")
if echo "$QUEUE_RESPONSE" | jq -e '.executable.url' > /dev/null; then
BUILD_URL=$(echo "$QUEUE_RESPONSE" | jq -r '.executable.url')
break
fi
echo "Waiting for job to start..."
sleep 10
done
echo "Job started at: $BUILD_URL"
BUILD_URL=${BUILD_URL//alijenkins/alijenkins-api}
while true; do
JOB_STATUS=$(curl -s "$BUILD_URL/api/json" -H "Authorization: Bearer $TOKEN" | jq -r '.result')
if [ "$JOB_STATUS" = "SUCCESS" ]; then
echo "Job completed successfully!"
exit 0
elif [ "$JOB_STATUS" = "FAILURE" ] || [ "$JOB_STATUS" = "ABORTED" ]; then
echo "::error::Jenkins job failed with status: $JOB_STATUS"
exit 1
elif [ "$JOB_STATUS" = "null" ]; then
echo "Job is still running..."
sleep 30
else
echo "::error::Unknown Jenkins job status: $JOB_STATUS"
exit 1
fi
done
7 changes: 5 additions & 2 deletions .github/workflows/c++-code-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,11 @@ jobs:
"Remove the trailing spaces at the end of the line.")
}
match($0, /\t+/) {
error("Tab characters found",
"Indent code using spaces instead of tabs.")
# Only check for tabs in C/C++ source files and Python/Shell scripts
if (FILENAME ~ /\.[ch](xx|pp)?$/ || FILENAME ~ /\.(py|sh)$/) {
error("Tab characters found",
"Indent code using spaces instead of tabs.")
}
}
END {
exit exit_code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-ccdbcache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install prerequisites
run: python3 -m pip install requests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install prerequisites
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-cvmfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install prerequisites
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-publisher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install prerequisites
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install prerequisites
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clean-pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:

steps:
- name: Set up Python 3
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.x

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/o2-full-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ jobs:
include:
- el_version: el7
container: centos:7
alibuild_tag: v1.17.12
alibuild_tag: v1.17.13
- el_version: el8
container: almalinux:8
alibuild_tag: v1.17.12
alibuild_tag: v1.17.13
- el_version: el9
container: almalinux:9
alibuild_tag: v1.17.12
alibuild_tag: v1.17.13
- el_version: fedora
container: fedora:40
alibuild_tag: v1.17.12
alibuild_tag: v1.17.13

name: "RPM (${{ matrix.el_version }})"
container: ${{ matrix.container }}
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
name: DEB (${{ matrix.ubuntu_codename }})
container: ubuntu:${{ matrix.ubuntu_codename }}
env:
ALIBUILD_TAG: v1.17.12
ALIBUILD_TAG: v1.17.13
ALIBUILD_DISTRO: ${{ matrix.ubuntu_codename }}
DEBIAN_FRONTEND: noninteractive
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-security-approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

steps:
- name: Set up Python 3
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.x

Expand Down
157 changes: 0 additions & 157 deletions Jenkinsfile

This file was deleted.

6 changes: 3 additions & 3 deletions ci/run-http.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ pip3 install --user --upgrade pip
pip3 install --ignore-installed --upgrade --user -e "${ALI_BOT_DIR}[services]"

# Setup GitLab credentials (to push new data)
printf 'protocol=https\nhost=gitlab.cern.ch\nusername=alibuild\npassword=%s\n' "$GITLAB_TOKEN" |
git credential-store --file git-creds store
git config --global credential.helper "store --file $PWD/git-creds"
printf 'protocol=https\nhost=gitlab.cern.ch\nusername=%s\npassword=%s\n' "$GITLAB_USER" "$GITLAB_PASS" |
git credential-store --file ~/.git-creds store
git config --global credential.helper 'store --file ~/.git-creds'

# Setup GitHub API credentials (to communicate with PRs)
echo "$PR_TOKEN" > ~/.github-token
Expand Down
Loading

0 comments on commit 75d4c2f

Please sign in to comment.