[master forward-port] Fixed RPMs using artifacts compiled against a too-new version of glibc (#11026)

* Fixed RPMs using artifacts compiled against a too-new version of glibc

* Fixed RPM naming issue

* Apply suggestions from code review

Co-authored-by: Gus Luxton <gus@goteleport.com>

Co-authored-by: Gus Luxton <gus@goteleport.com>
This commit is contained in:
fheinecke
2022-03-25 20:55:31 +00:00
committed by GitHub
co-authored by Gus Luxton
parent 58ca1bdbb0
commit 1daf7d2302
3 changed files with 62 additions and 36 deletions
+31 -31
View File
@@ -1052,7 +1052,7 @@ steps:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################
kind: pipeline
@@ -1194,7 +1194,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################
kind: pipeline
@@ -1335,7 +1335,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################
kind: pipeline
@@ -1474,7 +1474,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################
kind: pipeline
@@ -1613,12 +1613,12 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################
kind: pipeline
type: kubernetes
name: build-linux-amd64-rpm
name: build-linux-amd64-centos7-rpm
trigger:
event:
include:
@@ -1634,7 +1634,7 @@ workspace:
clone:
disable: true
depends_on:
- build-linux-amd64
- build-linux-amd64-centos7
steps:
- name: Check out code
image: docker:git
@@ -1668,9 +1668,9 @@ steps:
- export VERSION=$(cat /go/.version.txt)
- if [[ "${DRONE_TAG}" != "" ]]; then export S3_PATH="tag/$${DRONE_TAG##v}/"; else
export S3_PATH="tag/"; fi
- aws s3 cp s3://$AWS_S3_BUCKET/teleport/$${S3_PATH}teleport-v$${VERSION}-linux-amd64-bin.tar.gz
- aws s3 cp s3://$AWS_S3_BUCKET/teleport/$${S3_PATH}teleport-v$${VERSION}-linux-amd64-centos7-bin.tar.gz
/go/artifacts/
- aws s3 cp s3://$AWS_S3_BUCKET/teleport/$${S3_PATH}teleport-ent-v$${VERSION}-linux-amd64-bin.tar.gz
- aws s3 cp s3://$AWS_S3_BUCKET/teleport/$${S3_PATH}teleport-ent-v$${VERSION}-linux-amd64-centos7-bin.tar.gz
/go/artifacts/
environment:
AWS_ACCESS_KEY_ID:
@@ -1683,7 +1683,7 @@ steps:
- name: Build artifacts
image: docker
commands:
- apk add --no-cache bash curl gzip make tar
- apk add --no-cache bash curl gzip make tar go
- cd /go/src/github.com/gravitational/teleport
- export VERSION=$(cat /go/.version.txt)
- mkdir -m0700 $GNUPG_DIR
@@ -1779,12 +1779,12 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################
kind: pipeline
type: kubernetes
name: build-linux-amd64-fips-rpm
name: build-linux-amd64-centos7-fips-rpm
trigger:
event:
include:
@@ -1800,7 +1800,7 @@ workspace:
clone:
disable: true
depends_on:
- build-linux-amd64-fips
- build-linux-amd64-centos7-fips
steps:
- name: Check out code
image: docker:git
@@ -1834,7 +1834,7 @@ steps:
- export VERSION=$(cat /go/.version.txt)
- if [[ "${DRONE_TAG}" != "" ]]; then export S3_PATH="tag/$${DRONE_TAG##v}/"; else
export S3_PATH="tag/"; fi
- aws s3 cp s3://$AWS_S3_BUCKET/teleport/$${S3_PATH}teleport-ent-v$${VERSION}-linux-amd64-fips-bin.tar.gz
- aws s3 cp s3://$AWS_S3_BUCKET/teleport/$${S3_PATH}teleport-ent-v$${VERSION}-linux-amd64-centos7-fips-bin.tar.gz
/go/artifacts/
environment:
AWS_ACCESS_KEY_ID:
@@ -1847,7 +1847,7 @@ steps:
- name: Build artifacts
image: docker
commands:
- apk add --no-cache bash curl gzip make tar
- apk add --no-cache bash curl gzip make tar go
- cd /go/src/github.com/gravitational/teleport
- export VERSION=$(cat /go/.version.txt)
- mkdir -m0700 $GNUPG_DIR
@@ -1942,7 +1942,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################
kind: pipeline
@@ -2094,7 +2094,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################
kind: pipeline
@@ -2243,7 +2243,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################
kind: pipeline
@@ -2382,7 +2382,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################
kind: pipeline
@@ -2452,7 +2452,7 @@ steps:
- name: Build artifacts
image: docker
commands:
- apk add --no-cache bash curl gzip make tar
- apk add --no-cache bash curl gzip make tar go
- cd /go/src/github.com/gravitational/teleport
- export VERSION=$(cat /go/.version.txt)
- mkdir -m0700 $GNUPG_DIR
@@ -2548,7 +2548,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################
kind: pipeline
@@ -3226,7 +3226,7 @@ steps:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################
kind: pipeline
@@ -3365,7 +3365,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################
kind: pipeline
@@ -3504,7 +3504,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################
kind: pipeline
@@ -3656,7 +3656,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################
kind: pipeline
@@ -3808,7 +3808,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################
kind: pipeline
@@ -3878,7 +3878,7 @@ steps:
- name: Build artifacts
image: docker
commands:
- apk add --no-cache bash curl gzip make tar
- apk add --no-cache bash curl gzip make tar go
- cd /go/src/github.com/gravitational/teleport
- export VERSION=$(cat /go/.version.txt)
- mkdir -m0700 $GNUPG_DIR
@@ -3974,7 +3974,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:410
# Generated at dronegen/tag.go:431
################################################
kind: pipeline
@@ -4044,7 +4044,7 @@ steps:
- name: Build artifacts
image: docker
commands:
- apk add --no-cache bash curl gzip make tar
- apk add --no-cache bash curl gzip make tar go
- cd /go/src/github.com/gravitational/teleport
- export VERSION=$(cat /go/.version.txt)
- mkdir -m0700 $GNUPG_DIR
@@ -4140,7 +4140,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/tag.go:225
# Generated at dronegen/tag.go:230
################################################
kind: pipeline
@@ -5084,6 +5084,6 @@ volumes:
name: drone-s3-debrepo-pvc
---
kind: signature
hmac: 8d0b79ebd4a3a0432402abf3b2773f45f8d787c0114d921dcdb5c909f2c338db
hmac: 3f643ea1aa5c364c56c9c61f71a199828e5e8013d9032239cd4d260510fd6fd0
...
+8 -3
View File
@@ -192,14 +192,19 @@ elif [[ "${ARCH}" == "arm64" ]]; then
TEXT_ARCH="ARMv8/ARM64"
fi
# amd64 RPMs should use CentOS 7 compatible artifacts
if [[ "${PACKAGE_TYPE}" == "rpm" && "${ARCH}" == "x86_64" ]]; then
OPTIONAL_TARBALL_SECTION+="-centos7"
fi
# set optional runtime section for filename
if [[ "${RUNTIME}" == "fips" ]]; then
OPTIONAL_RUNTIME_SECTION="-fips"
OPTIONAL_RUNTIME_SECTION+="-fips"
fi
# set variables appropriately depending on type of package being built
if [[ "${TELEPORT_TYPE}" == "ent" ]]; then
TARBALL_FILENAME="teleport-ent-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz"
TARBALL_FILENAME="teleport-ent-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTIONAL_TARBALL_SECTION}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz"
URL="${DOWNLOAD_ROOT}/${TARBALL_FILENAME}"
TAR_PATH="teleport-ent"
RPM_NAME="teleport-ent"
@@ -210,7 +215,7 @@ if [[ "${TELEPORT_TYPE}" == "ent" ]]; then
TYPE_DESCRIPTION="[${TEXT_ARCH} Enterprise edition]"
fi
else
TARBALL_FILENAME="teleport-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz"
TARBALL_FILENAME="teleport-v${TELEPORT_VERSION}-${PLATFORM}-${FILENAME_ARCH}${OPTIONAL_TARBALL_SECTION}${OPTIONAL_RUNTIME_SECTION}-bin.tar.gz"
URL="${DOWNLOAD_ROOT}/${TARBALL_FILENAME}"
TAR_PATH="teleport"
RPM_NAME="teleport"
+23 -2
View File
@@ -16,6 +16,7 @@ package main
import (
"fmt"
"strings"
)
const (
@@ -175,7 +176,11 @@ func tagPipelines() []pipeline {
// RPM/DEB package builds
for _, packageType := range []string{rpmPackage, debPackage} {
ps = append(ps, tagPackagePipeline(packageType, buildType{os: "linux", arch: arch, fips: fips}))
bt := buildType{os: "linux", arch: arch, fips: fips}
if packageType == "rpm" && arch == "amd64" {
bt.centos7 = true
}
ps = append(ps, tagPackagePipeline(packageType, bt))
}
}
}
@@ -283,6 +288,11 @@ func tagDownloadArtifactCommands(b buildType) []string {
}
artifactOSS := true
artifactType := fmt.Sprintf("%s-%s", b.os, b.arch)
if b.centos7 {
artifactType += "-centos7"
}
if b.fips {
artifactType += "-fips"
artifactOSS = false
@@ -362,8 +372,19 @@ func tagPackagePipeline(packageType string, b buildType) pipeline {
}
dependentPipeline := fmt.Sprintf("build-%s-%s", b.os, b.arch)
if b.centos7 {
dependentPipeline += "-centos7"
}
apkPackages := []string{"bash", "curl", "gzip", "make", "tar"}
if packageType == rpmPackage {
// Required by `make rpm`
apkPackages = append(apkPackages, "go")
}
packageBuildCommands := []string{
`apk add --no-cache bash curl gzip make tar`,
fmt.Sprintf("apk add --no-cache %s", strings.Join(apkPackages, " ")),
`cd /go/src/github.com/gravitational/teleport`,
`export VERSION=$(cat /go/.version.txt)`,
}