[v11.3.x] Chore: Remove verification steps for deb/rpm in drone (#97297)
Chore: Remove verification steps for deb/rpm in drone (#96991)
remove verification steps for deb/rpm in drone
(cherry picked from commit feeb2c6ce0)
Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
This commit is contained in:
co-authored by
Serge Zaitsev
parent
17d7ca7232
commit
e80e6e532c
@@ -28,8 +28,6 @@ load(
|
||||
"verify_gen_cue_step",
|
||||
"verify_gen_jsonnet_step",
|
||||
"verify_grafanacom_step",
|
||||
"verify_linux_DEB_packages_step",
|
||||
"verify_linux_RPM_packages_step",
|
||||
"wire_install_step",
|
||||
"yarn_install_step",
|
||||
)
|
||||
@@ -195,8 +193,6 @@ def publish_packages_pipeline():
|
||||
compile_build_cmd(),
|
||||
publish_linux_packages_step(package_manager = "deb"),
|
||||
publish_linux_packages_step(package_manager = "rpm"),
|
||||
verify_linux_DEB_packages_step(depends_on = ["publish-linux-packages-deb"]),
|
||||
verify_linux_RPM_packages_step(depends_on = ["publish-linux-packages-rpm"]),
|
||||
publish_grafanacom_step(ver_mode = "release"),
|
||||
verify_grafanacom_step(),
|
||||
]
|
||||
@@ -217,17 +213,6 @@ def publish_packages_pipeline():
|
||||
verify_grafanacom_step(depends_on = []),
|
||||
],
|
||||
),
|
||||
pipeline(
|
||||
name = "verify-linux-packages",
|
||||
trigger = {
|
||||
"event": ["promote"],
|
||||
"target": "verify-linux-packages",
|
||||
},
|
||||
steps = [
|
||||
verify_linux_DEB_packages_step(),
|
||||
verify_linux_RPM_packages_step(),
|
||||
],
|
||||
),
|
||||
pipeline(
|
||||
name = "publish-packages",
|
||||
trigger = trigger,
|
||||
|
||||
@@ -1302,94 +1302,6 @@ def retry_command(command, attempts = 60, delay = 30):
|
||||
"done",
|
||||
]
|
||||
|
||||
def verify_linux_DEB_packages_step(depends_on = []):
|
||||
install_command = "apt-get update >/dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive apt-get install -yq grafana=$version >/dev/null 2>&1"
|
||||
|
||||
return {
|
||||
"name": "verify-linux-DEB-packages",
|
||||
"image": images["ubuntu"],
|
||||
"environment": {},
|
||||
"commands": [
|
||||
'export version=$(echo ${TAG} | sed -e "s/+security-/-/g")',
|
||||
'echo "Step 1: Updating package lists..."',
|
||||
"apt-get update >/dev/null 2>&1",
|
||||
'echo "Step 2: Installing prerequisites..."',
|
||||
"DEBIAN_FRONTEND=noninteractive apt-get install -yq apt-transport-https software-properties-common wget >/dev/null 2>&1",
|
||||
'echo "Step 3: Adding Grafana GPG key..."',
|
||||
"mkdir -p /etc/apt/keyrings/",
|
||||
"wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | tee /etc/apt/keyrings/grafana.gpg > /dev/null",
|
||||
'echo "Step 4: Adding Grafana repository..."',
|
||||
'echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | tee -a /etc/apt/sources.list.d/grafana.list',
|
||||
'echo "Step 5: Installing Grafana..."',
|
||||
# The packages take a bit of time to propogate within the repo. This retry will check their availability within 10 minutes.
|
||||
] + retry_command(install_command) + [
|
||||
'echo "Step 6: Verifying Grafana installation..."',
|
||||
'if dpkg -s grafana | grep -q "Version: $version"; then',
|
||||
' echo "Successfully verified Grafana version $version"',
|
||||
"else",
|
||||
' echo "Failed to verify Grafana version $version"',
|
||||
" exit 1",
|
||||
"fi",
|
||||
'echo "Verification complete."',
|
||||
],
|
||||
"depends_on": depends_on,
|
||||
}
|
||||
|
||||
def verify_linux_RPM_packages_step(depends_on = []):
|
||||
repo_config = (
|
||||
"[grafana]\n" +
|
||||
"name=grafana\n" +
|
||||
"baseurl=https://rpm.grafana.com\n" +
|
||||
"repo_gpgcheck=0\n" + # Change this to 0
|
||||
"enabled=1\n" +
|
||||
"gpgcheck=0\n" + # Change this to 0
|
||||
"gpgkey=https://rpm.grafana.com/gpg.key\n" +
|
||||
"sslverify=1\n" +
|
||||
"sslcacert=/etc/pki/tls/certs/ca-bundle.crt\n"
|
||||
)
|
||||
|
||||
install_command = "dnf install -y --nogpgcheck grafana-$version >/dev/null 2>&1"
|
||||
|
||||
return {
|
||||
"name": "verify-linux-RPM-packages",
|
||||
"image": images["rocky"],
|
||||
"environment": {},
|
||||
"commands": [
|
||||
'echo "Step 1: Updating package lists..."',
|
||||
"dnf check-update -y >/dev/null 2>&1 || true",
|
||||
'echo "Step 2: Installing prerequisites..."',
|
||||
"dnf install -y dnf-utils >/dev/null 2>&1",
|
||||
'echo "Step 3: Adding Grafana GPG key..."',
|
||||
"rpm --import https://rpm.grafana.com/gpg.key",
|
||||
'echo "Step 4: Configuring Grafana repository..."',
|
||||
"echo -e '" + repo_config + "' > /etc/yum.repos.d/grafana.repo",
|
||||
'echo "Step 5: Checking RPM repository..."',
|
||||
'export version=$(echo "${TAG}" | sed -e "s/+security-/^security_/g")',
|
||||
"dnf list available grafana-$version",
|
||||
"if [ $? -eq 0 ]; then",
|
||||
' echo "Grafana package found in repository. Installing from repo..."',
|
||||
] + retry_command(install_command) + [
|
||||
' echo "Verifying GPG key..."',
|
||||
" rpm --import https://rpm.grafana.com/gpg.key",
|
||||
" rpm -qa gpg-pubkey* | xargs rpm -qi | grep -i grafana",
|
||||
"else",
|
||||
' echo "Grafana package version $version not found in repository."',
|
||||
" dnf repolist",
|
||||
" dnf list available grafana*",
|
||||
" exit 1",
|
||||
"fi",
|
||||
'echo "Step 6: Verifying Grafana installation..."',
|
||||
'if rpm -q grafana | grep -q "$verison"; then',
|
||||
' echo "Successfully verified Grafana version $version"',
|
||||
"else",
|
||||
' echo "Failed to verify Grafana version $version"',
|
||||
" exit 1",
|
||||
"fi",
|
||||
'echo "Verification complete."',
|
||||
],
|
||||
"depends_on": depends_on,
|
||||
}
|
||||
|
||||
def verify_gen_cue_step():
|
||||
return {
|
||||
"name": "verify-gen-cue",
|
||||
|
||||
Reference in New Issue
Block a user