From c0a1e074ec2fbb3ea03851780ac109864161bbb0 Mon Sep 17 00:00:00 2001 From: Russell Jones Date: Fri, 17 Dec 2021 04:34:03 +0000 Subject: [PATCH] Update Drone pipeline to fix CentOS 7 repository. Inject CentOS 7 tarballs into RPM repository to allow Teleport 8 to continue to work on CentOS 7. --- .drone.yml | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index adabd421a4ad6..119d7f5b61ad8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1913,6 +1913,7 @@ clone: disable: true depends_on: - build-linux-amd64 +- build-linux-amd64-centos7 steps: - name: Check out code image: docker:git @@ -1950,6 +1951,10 @@ steps: /go/artifacts/ - aws s3 cp s3://$AWS_S3_BUCKET/teleport/$${S3_PATH}teleport-ent-v$${VERSION}-linux-amd64-bin.tar.gz /go/artifacts/ + - 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-centos7-bin.tar.gz + /go/artifacts/ environment: AWS_ACCESS_KEY_ID: from_secret: AWS_ACCESS_KEY_ID @@ -1967,7 +1972,9 @@ steps: - mkdir -m0700 $GNUPG_DIR - echo "$GPG_RPM_SIGNING_ARCHIVE" | base64 -d | tar -xzf - -C $GNUPG_DIR - chown -R root:root $GNUPG_DIR + # Build mainline and CentOS 7 RPMs. - make rpm + - make rpm RPM_FLAGS="-c centos7" - rm -rf $GNUPG_DIR environment: ARCH: amd64 @@ -2045,6 +2052,7 @@ clone: disable: true depends_on: - build-linux-amd64-fips +- build-linux-amd64-centos7-fips steps: - name: Check out code image: docker:git @@ -2080,6 +2088,8 @@ steps: 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 /go/artifacts/ + - 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: from_secret: AWS_ACCESS_KEY_ID @@ -2097,7 +2107,9 @@ steps: - mkdir -m0700 $GNUPG_DIR - echo "$GPG_RPM_SIGNING_ARCHIVE" | base64 -d | tar -xzf - -C $GNUPG_DIR - chown -R root:root $GNUPG_DIR + # Build mainline and CentOS 7 artifacts. - make -C e rpm + - make -C e rpm RPM_FLAGS="-c centos7" - rm -rf $GNUPG_DIR environment: ARCH: amd64 @@ -4604,7 +4616,7 @@ steps: echo "---> Publishing packages to repos for ${DRONE_TAG}" fi - - name: Download RPM repo contents + - name: "RPM: Download RPM repository" image: amazon/aws-cli environment: AWS_S3_BUCKET: @@ -4618,15 +4630,24 @@ steps: path: /rpmrepo commands: - mkdir -p /rpmrepo/teleport/cache - # we explicitly want to delete anything present locally which has been deleted - # from the upstream S3 bucket + # Explicitly delete anything present locally before copying over new assets + # to ensure the repository remains in sync. - aws s3 sync s3://$AWS_S3_BUCKET/teleport/ /rpmrepo/teleport/ --delete - mkdir -p /rpmrepo/teleport/${DRONE_TAG##v} - - cp -a /go/artifacts/*.rpm /rpmrepo/teleport/${DRONE_TAG##v}/ + # This is a hack for Teleport 8. Copy over CentOS 7 RPMs for x86_64 instead + # of the mainline RPMs which only run on CentOS 8+. + # + # In Teleport 9 we will switch the buildbox to CentOS 7 and no longer need + # to do this. This should never make it into master or branch/v9. + - cp -a /go/artifacts/*centos7.x86_64.rpm /rpmrepo/teleport/${DRONE_TAG##v}/ + - cp -a /go/artifacts/*centos7-fips.x86_64.rpm /rpmrepo/teleport/${DRONE_TAG##v}/ + - cp -a /go/artifacts/*arm.rpm /rpmrepo/teleport/${DRONE_TAG##v}/ + - cp -a /go/artifacts/*arm64.rpm /rpmrepo/teleport/${DRONE_TAG##v}/ + - cp -a /go/artifacts/*i386.rpm /rpmrepo/teleport/${DRONE_TAG##v}/ # we do this using a CentOS 7 container to make sure that the repo files are # compatible with older versions, also there's no createrepo package in alpine main - - name: Regenerate RPM repo metadata + - name: "RPM: Regenerate RPM repository metadata" image: centos:7 volumes: - name: rpmrepo @@ -4635,7 +4656,7 @@ steps: - yum -y install createrepo - createrepo --cachedir /rpmrepo/teleport/cache --update /rpmrepo/teleport - - name: Sync RPM repo changes to S3 + - name: "RPM: Publish RPM repository to S3" image: amazon/aws-cli environment: AWS_S3_BUCKET: @@ -4760,6 +4781,6 @@ volumes: name: drone-s3-debrepo-pvc --- kind: signature -hmac: bed10918e395a842810075ba8125364c264062ef2cb554a20bf5bf6e6d0e6195 +hmac: b3ea3b08231c8687650d3605f624cf5bacfbc8088e8567f43518079383f4adac ...