Skip to content

Commit

Permalink
Update Drone pipeline to fix CentOS 7 repository.
Browse files Browse the repository at this point in the history
Inject CentOS 7 tarballs into RPM repository to allow Teleport 8 to
continue to work on CentOS 7.
  • Loading branch information
russjones committed Dec 18, 2021
1 parent fda9e59 commit c0a1e07
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1913,6 +1913,7 @@ clone:
disable: true
depends_on:
- build-linux-amd64
- build-linux-amd64-centos7
steps:
- name: Check out code
image: docker:git
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -4760,6 +4781,6 @@ volumes:
name: drone-s3-debrepo-pvc
---
kind: signature
hmac: bed10918e395a842810075ba8125364c264062ef2cb554a20bf5bf6e6d0e6195
hmac: b3ea3b08231c8687650d3605f624cf5bacfbc8088e8567f43518079383f4adac

...

0 comments on commit c0a1e07

Please sign in to comment.