#!/bin/bash # Create JIRA issue for bootc release # Returns JIRA ticket key (e.g., RHEL-104567) on success set -euo pipefail VERSION="${1:-}" UPSTREAM_URL="${2:-}" if [[ -z "$VERSION" ]]; then echo "Usage: $0 [upstream_url]" >&2 exit 1 fi if [[ -z "$UPSTREAM_URL" ]]; then UPSTREAM_URL="https://github.com/containers/bootc/releases/tag/v${VERSION}" fi log_info() { echo "[JIRA] $*" } log_error() { echo "[JIRA ERROR] $*" >&2 } # Check for required env vars if [[ -z "${JIRA_API_TOKEN:-}" ]]; then log_error "JIRA_API_TOKEN environment variable not set" exit 1 fi # JIRA API endpoint (v3 as per Red Hat Jira) JIRA_API="https://issues.redhat.com/rest/api/3/issue" # Create payload SUMMARY="Update bootc to ${VERSION} in CentOS Stream" DESCRIPTION="Automated release update from upstream bootc v${VERSION} Upstream release: ${UPSTREAM_URL} This issue was created automatically by bootc-release-bot." PAYLOAD=$(cat <&2 exit 1 fi else log_error "API request failed with HTTP $HTTP_CODE" echo "$BODY" >&2 exit 1 fi