Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
60e1ea2
Added YUM implementation of OS package build tool
fheinecke Jun 14, 2022
63d5f1c
Addressed PR comments
fheinecke Jul 21, 2022
4b8c71e
Added YUM migrations
fheinecke Jul 21, 2022
511d07d
Added curl to YUM dependencies
fheinecke Jul 21, 2022
7fe7de3
Changed pipelines to use golang:1.18.4-bullseye for Go
fheinecke Jul 21, 2022
ac7174b
Implemented proper repo downloading logic
fheinecke Jul 27, 2022
fca6f10
Merge remote-tracking branch 'origin/master' into fred/rfd-0058-YUM-i…
fheinecke Jul 27, 2022
ec32dda
Fixed other merge conflicts
fheinecke Jul 27, 2022
6e9561f
Added artifacts cleanup
fheinecke Jul 27, 2022
4485978
Removed delete on s3 sync
fheinecke Jul 27, 2022
ec1354e
Added RPM migrations
fheinecke Jul 27, 2022
31eea00
v8 migrations
fheinecke Jul 27, 2022
da952c5
Partial v8 migration
fheinecke Jul 27, 2022
d32f4ba
Migration remainder
fheinecke Jul 27, 2022
cb4d671
Reduced requested resources
fheinecke Jul 27, 2022
85adf16
Updated resource limits per step
fheinecke Jul 27, 2022
7f46cc4
Added k8s stage resource limits to drone
fheinecke Jul 27, 2022
ae39fa8
Fixed format issue
fheinecke Jul 27, 2022
7c8f7b0
Removed resource requests
fheinecke Jul 27, 2022
a004c78
Added `depends_on` support to dronegen
fheinecke Jul 27, 2022
22044d8
v8.3 migrations
fheinecke Jul 27, 2022
1ef9802
Fixed parallelism
fheinecke Jul 28, 2022
748590d
Merge branch 'master' into fred/rfd-0058-YUM-implementation
fheinecke Jul 28, 2022
c45fd7b
Removed migration parallelism
fheinecke Jul 28, 2022
2063c29
Fixed RPM base arch lookup
fheinecke Jul 28, 2022
8d3c8f5
v6 and v7 YUM migration
fheinecke Jul 28, 2022
31943f9
Fixed missing ISA
fheinecke Jul 28, 2022
825011f
Updated repo file path
fheinecke Jul 28, 2022
f241b25
Added logging
fheinecke Jul 28, 2022
18ff6e3
Removed vars from repo file
fheinecke Jul 28, 2022
5aecf83
v8.3 migration first batch
fheinecke Jul 28, 2022
c139e9f
v8.3 migration second batch
fheinecke Jul 28, 2022
f480d72
v9.0 migration
fheinecke Jul 28, 2022
49551ed
v9.1 migration
fheinecke Jul 28, 2022
b8cab5e
v9.2 migration
fheinecke Jul 28, 2022
3827798
v9.3 first migration
fheinecke Jul 28, 2022
addf3b1
v9.3 second migration
fheinecke Jul 28, 2022
9007eb6
v10.0 migration
fheinecke Jul 28, 2022
ab698f0
Removed migrations
fheinecke Jul 28, 2022
46408a8
Disabled shell linting non-issues
fheinecke Jul 29, 2022
4853a3a
Merge branch 'master' into fred/rfd-0058-YUM-implementation
fheinecke Jul 29, 2022
a02ef87
Fixed linter problem
fheinecke Jul 29, 2022
306ee13
More linter fixes
fheinecke Jul 29, 2022
7e11834
Merge remote-tracking branch 'origin/master' into fred/rfd-0058-YUM-i…
fheinecke Aug 2, 2022
54288e6
Resigned dronegen
fheinecke Aug 2, 2022
0c4d340
Merge branch 'master' into fred/rfd-0058-YUM-implementation
fheinecke Aug 2, 2022
305efc0
Merge branch 'master' into fred/rfd-0058-YUM-implementation
fheinecke Aug 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
257 changes: 202 additions & 55 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5398,7 +5398,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/misc.go:138
# Generated at dronegen/os_repos.go:270
################################################

kind: pipeline
Expand Down Expand Up @@ -5426,7 +5426,7 @@ steps:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/misc.go:162
# Generated at dronegen/os_repos.go:294
################################################

kind: pipeline
Expand Down Expand Up @@ -5469,6 +5469,7 @@ steps:
image: amazon/aws-cli
commands:
- mkdir -pv "$ARTIFACT_PATH"
- rm -rf "${ARTIFACT_PATH}/*"
- aws s3 sync --no-progress --delete --exclude "*" --include "*.deb*" s3://$AWS_S3_BUCKET/teleport/tag/${DRONE_TAG##v}/
"$ARTIFACT_PATH"
environment:
Expand All @@ -5479,25 +5480,25 @@ steps:
from_secret: AWS_S3_BUCKET
AWS_SECRET_ACCESS_KEY:
from_secret: AWS_SECRET_ACCESS_KEY
depends_on:
- Verify build is tagged
- Check out code
- Check if tag is prerelease
- name: Publish debs to APT repos for "${DRONE_TAG}"
image: golang:1.18.1-bullseye
image: golang:1.18.4-bullseye
commands:
- mkdir -pv -m0700 $GNUPGHOME
- echo "$GPG_RPM_SIGNING_ARCHIVE" | base64 -d | tar -xzf - -C $GNUPGHOME
- chown -R root:root $GNUPGHOME
- apt update
- apt install aptly tree -y
- apt install -y aptly
- mkdir -pv -m0700 "$GNUPGHOME"
- echo "$GPG_RPM_SIGNING_ARCHIVE" | base64 -d | tar -xzf - -C $GNUPGHOME
- chown -R root:root "$GNUPGHOME"
- cd "/go/src/github.com/gravitational/teleport/build.assets/tooling"
- export VERSION="${DRONE_TAG}"
- export RELEASE_CHANNEL="stable"
- go run ./cmd/build-apt-repos -bucket "$APT_S3_BUCKET" -local-bucket-path "$BUCKET_CACHE_PATH"
-artifact-version "$VERSION" -release-channel "$RELEASE_CHANNEL" -aptly-root-dir
"$APTLY_ROOT_DIR" -artifact-path "$ARTIFACT_PATH" -log-level 4
- rm -rf "$BUCKET_CACHE_PATH"
- df -h "$APTLY_ROOT_DIR"
- go run ./cmd/build-os-package-repos apt -bucket "$REPO_S3_BUCKET" -local-bucket-path
"$BUCKET_CACHE_PATH" -artifact-version "$VERSION" -release-channel "$RELEASE_CHANNEL"
-artifact-path "$ARTIFACT_PATH" -log-level 4 -aptly-root-dir "$APTLY_ROOT_DIR"
environment:
APT_S3_BUCKET:
from_secret: APT_REPO_NEW_AWS_S3_BUCKET
APTLY_ROOT_DIR: /mnt/aptly
ARTIFACT_PATH: /go/artifacts
AWS_ACCESS_KEY_ID:
Expand All @@ -5506,16 +5507,24 @@ steps:
AWS_SECRET_ACCESS_KEY:
from_secret: APT_REPO_NEW_AWS_SECRET_ACCESS_KEY
BUCKET_CACHE_PATH: /tmp/bucket
DEBIAN_FRONTEND: noninteractive
GNUPGHOME: /tmpfs/gnupg
GPG_RPM_SIGNING_ARCHIVE:
from_secret: GPG_RPM_SIGNING_ARCHIVE
REPO_S3_BUCKET:
from_secret: APT_REPO_NEW_AWS_S3_BUCKET
volumes:
- name: aptrepo
- name: apt-persistence
path: /mnt
- name: tmpfs
path: /tmpfs
depends_on:
- Download artifacts for "${DRONE_TAG}"
- Verify build is tagged
- Check out code
- Check if tag is prerelease
volumes:
- name: aptrepo
- name: apt-persistence
claim:
name: drone-s3-aptrepo-pvc
- name: tmpfs
Expand All @@ -5526,12 +5535,150 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/promote.go:81
# Generated at dronegen/os_repos.go:270
################################################

kind: pipeline
type: kubernetes
name: promote-docker-quay
name: migrate-yum-new-repos
trigger:
event:
include:
- custom
repo:
include:
- non-existent-repository
branch:
include:
- non-existent-branch
clone:
disable: true
steps:
- name: Placeholder
image: alpine:latest
commands:
- echo "This command, step, and pipeline never runs"

---
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/os_repos.go:294
################################################

kind: pipeline
type: kubernetes
name: publish-yum-new-repos
trigger:
event:
include:
- promote
target:
include:
- production
repo:
include:
- gravitational/teleport
workspace:
path: /go
clone:
disable: true
steps:
- name: Verify build is tagged
image: alpine:latest
commands:
- '[ -n ${DRONE_TAG} ] || (echo ''DRONE_TAG is not set. Is the commit tagged?''
&& exit 1)'
- name: Check out code
image: alpine/git:latest
commands:
- mkdir -p "/go/src/github.com/gravitational/teleport"
- cd "/go/src/github.com/gravitational/teleport"
- git clone https://github.com/gravitational/${DRONE_REPO_NAME}.git .
- git checkout "${DRONE_TAG}"
- name: Check if tag is prerelease
image: golang:1.17-alpine
commands:
- cd "/go/src/github.com/gravitational/teleport/build.assets/tooling"
- go run ./cmd/check -tag ${DRONE_TAG} -check prerelease || (echo '---> This is
a prerelease, not publishing ${DRONE_TAG} packages to APT repos' && exit 78)
- name: Download artifacts for "${DRONE_TAG}"
image: amazon/aws-cli
commands:
- mkdir -pv "$ARTIFACT_PATH"
- rm -rf "${ARTIFACT_PATH}/*"
- aws s3 sync --no-progress --delete --exclude "*" --include "*.rpm*" s3://$AWS_S3_BUCKET/teleport/tag/${DRONE_TAG##v}/
"$ARTIFACT_PATH"
environment:
ARTIFACT_PATH: /go/artifacts
AWS_ACCESS_KEY_ID:
from_secret: AWS_ACCESS_KEY_ID
AWS_S3_BUCKET:
from_secret: AWS_S3_BUCKET
AWS_SECRET_ACCESS_KEY:
from_secret: AWS_SECRET_ACCESS_KEY
depends_on:
- Verify build is tagged
- Check out code
- Check if tag is prerelease
- name: Publish rpms to YUM repos for "${DRONE_TAG}"
image: golang:1.18.4-bullseye
commands:
- apt update
- apt install -y createrepo-c
- mkdir -pv "$CACHE_DIR"
- mkdir -pv -m0700 "$GNUPGHOME"
- echo "$GPG_RPM_SIGNING_ARCHIVE" | base64 -d | tar -xzf - -C $GNUPGHOME
- chown -R root:root "$GNUPGHOME"
- cd "/go/src/github.com/gravitational/teleport/build.assets/tooling"
- export VERSION="${DRONE_TAG}"
- export RELEASE_CHANNEL="stable"
- go run ./cmd/build-os-package-repos yum -bucket "$REPO_S3_BUCKET" -local-bucket-path
"$BUCKET_CACHE_PATH" -artifact-version "$VERSION" -release-channel "$RELEASE_CHANNEL"
-artifact-path "$ARTIFACT_PATH" -log-level 4 -cache-dir "$CACHE_DIR"
environment:
ARTIFACT_PATH: /go/artifacts
AWS_ACCESS_KEY_ID:
from_secret: YUM_REPO_NEW_AWS_ACCESS_KEY_ID
AWS_REGION: us-west-2
AWS_SECRET_ACCESS_KEY:
from_secret: YUM_REPO_NEW_AWS_SECRET_ACCESS_KEY
BUCKET_CACHE_PATH: /mnt/bucket
CACHE_DIR: /mnt/createrepo_cache
DEBIAN_FRONTEND: noninteractive
GNUPGHOME: /tmpfs/gnupg
GPG_RPM_SIGNING_ARCHIVE:
from_secret: GPG_RPM_SIGNING_ARCHIVE
REPO_S3_BUCKET:
from_secret: YUM_REPO_NEW_AWS_S3_BUCKET
volumes:
- name: yum-persistence
path: /mnt
- name: tmpfs
path: /tmpfs
depends_on:
- Download artifacts for "${DRONE_TAG}"
- Verify build is tagged
- Check out code
- Check if tag is prerelease
volumes:
- name: yum-persistence
claim:
name: drone-s3-yumrepo-pvc
- name: tmpfs
temp:
medium: memory

---
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/promote.go:28
################################################

kind: pipeline
type: kubernetes
name: promote-docker-ecr
trigger:
event:
include:
Expand All @@ -5540,7 +5687,7 @@ trigger:
include:
- production
- promote-docker
- promote-docker-quay
- promote-docker-ecr
repo:
include:
- gravitational/*
Expand All @@ -5566,43 +5713,31 @@ steps:
commands:
- apk add --no-cache aws-cli
- export VERSION=${DRONE_TAG##v}
- docker login -u="$STAGING_QUAY_USERNAME" -p="$STAGING_QUAY_PASSWORD" quay.io
- aws ecr get-login-password --region=us-west-2 | docker login -u="AWS" --password-stdin
146628656107.dkr.ecr.us-west-2.amazonaws.com
- echo "---> Pulling images for $${VERSION}"
- docker pull 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport:$${VERSION}
- docker pull 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport-ent:$${VERSION}
- docker pull 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport-ent:$${VERSION}-fips
- docker pull quay.io/gravitational/teleport-operator-ci:$${VERSION}
- echo "---> Tagging images for $${VERSION}"
- docker tag 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport:$${VERSION}
quay.io/gravitational/teleport:$${VERSION}
public.ecr.aws/gravitational/teleport:$${VERSION}
- docker tag 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport-ent:$${VERSION}
quay.io/gravitational/teleport-ent:$${VERSION}
public.ecr.aws/gravitational/teleport-ent:$${VERSION}
- docker tag 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport-ent:$${VERSION}-fips
quay.io/gravitational/teleport-ent:$${VERSION}-fips
- docker tag quay.io/gravitational/teleport-operator-ci:$${VERSION} quay.io/gravitational/teleport-operator:$${VERSION}
- docker logout quay.io
public.ecr.aws/gravitational/teleport-ent:$${VERSION}-fips
- docker logout 146628656107.dkr.ecr.us-west-2.amazonaws.com
- docker login -u="$QUAY_USERNAME" -p="$QUAY_PASSWORD" quay.io
- aws ecr-public get-login-password --region=us-east-1 | docker login -u="AWS" --password-stdin
public.ecr.aws
- echo "---> Pushing images for $${VERSION}"
- docker push quay.io/gravitational/teleport:$${VERSION}
- docker push quay.io/gravitational/teleport-ent:$${VERSION}
- docker push quay.io/gravitational/teleport-ent:$${VERSION}-fips
- docker push quay.io/gravitational/teleport-operator:$${VERSION}
- docker push public.ecr.aws/gravitational/teleport:$${VERSION}
- docker push public.ecr.aws/gravitational/teleport-ent:$${VERSION}
- docker push public.ecr.aws/gravitational/teleport-ent:$${VERSION}-fips
environment:
AWS_ACCESS_KEY_ID:
from_secret: STAGING_TELEPORT_DRONE_USER_ECR_KEY
from_secret: PRODUCTION_TELEPORT_DRONE_USER_ECR_KEY
AWS_SECRET_ACCESS_KEY:
from_secret: STAGING_TELEPORT_DRONE_USER_ECR_SECRET
QUAY_PASSWORD:
from_secret: PRODUCTION_QUAYIO_DOCKER_PASSWORD
QUAY_USERNAME:
from_secret: PRODUCTION_QUAYIO_DOCKER_USERNAME
STAGING_QUAY_PASSWORD:
from_secret: QUAYIO_DOCKER_PASSWORD
STAGING_QUAY_USERNAME:
from_secret: QUAYIO_DOCKER_USERNAME
from_secret: PRODUCTION_TELEPORT_DRONE_USER_ECR_SECRET
volumes:
- name: dockersock
path: /var/run
Expand All @@ -5621,12 +5756,12 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/promote.go:27
# Generated at dronegen/promote.go:82
################################################

kind: pipeline
type: kubernetes
name: promote-docker-ecr
name: promote-docker-quay
trigger:
event:
include:
Expand All @@ -5635,7 +5770,7 @@ trigger:
include:
- production
- promote-docker
- promote-docker-ecr
- promote-docker-quay
repo:
include:
- gravitational/*
Expand All @@ -5661,31 +5796,43 @@ steps:
commands:
- apk add --no-cache aws-cli
- export VERSION=${DRONE_TAG##v}
- docker login -u="$STAGING_QUAY_USERNAME" -p="$STAGING_QUAY_PASSWORD" quay.io
- aws ecr get-login-password --region=us-west-2 | docker login -u="AWS" --password-stdin
146628656107.dkr.ecr.us-west-2.amazonaws.com
- echo "---> Pulling images for $${VERSION}"
- docker pull 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport:$${VERSION}
- docker pull 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport-ent:$${VERSION}
- docker pull 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport-ent:$${VERSION}-fips
- docker pull quay.io/gravitational/teleport-operator-ci:$${VERSION}
- echo "---> Tagging images for $${VERSION}"
- docker tag 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport:$${VERSION}
public.ecr.aws/gravitational/teleport:$${VERSION}
quay.io/gravitational/teleport:$${VERSION}
- docker tag 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport-ent:$${VERSION}
public.ecr.aws/gravitational/teleport-ent:$${VERSION}
quay.io/gravitational/teleport-ent:$${VERSION}
- docker tag 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport-ent:$${VERSION}-fips
public.ecr.aws/gravitational/teleport-ent:$${VERSION}-fips
quay.io/gravitational/teleport-ent:$${VERSION}-fips
- docker tag quay.io/gravitational/teleport-operator-ci:$${VERSION} quay.io/gravitational/teleport-operator:$${VERSION}
- docker logout quay.io
- docker logout 146628656107.dkr.ecr.us-west-2.amazonaws.com
- aws ecr-public get-login-password --region=us-east-1 | docker login -u="AWS" --password-stdin
public.ecr.aws
- docker login -u="$QUAY_USERNAME" -p="$QUAY_PASSWORD" quay.io
- echo "---> Pushing images for $${VERSION}"
- docker push public.ecr.aws/gravitational/teleport:$${VERSION}
- docker push public.ecr.aws/gravitational/teleport-ent:$${VERSION}
- docker push public.ecr.aws/gravitational/teleport-ent:$${VERSION}-fips
- docker push quay.io/gravitational/teleport:$${VERSION}
- docker push quay.io/gravitational/teleport-ent:$${VERSION}
- docker push quay.io/gravitational/teleport-ent:$${VERSION}-fips
- ERSION}
environment:
AWS_ACCESS_KEY_ID:
from_secret: PRODUCTION_TELEPORT_DRONE_USER_ECR_KEY
from_secret: STAGING_TELEPORT_DRONE_USER_ECR_KEY
AWS_SECRET_ACCESS_KEY:
from_secret: PRODUCTION_TELEPORT_DRONE_USER_ECR_SECRET
from_secret: STAGING_TELEPORT_DRONE_USER_ECR_SECRET
QUAY_PASSWORD:
from_secret: PRODUCTION_QUAYIO_DOCKER_PASSWORD
QUAY_USERNAME:
from_secret: PRODUCTION_QUAYIO_DOCKER_USERNAME
STAGING_QUAY_PASSWORD:
from_secret: QUAYIO_DOCKER_PASSWORD
STAGING_QUAY_USERNAME:
from_secret: QUAYIO_DOCKER_USERNAME
volumes:
- name: dockersock
path: /var/run
Expand Down Expand Up @@ -6091,6 +6238,6 @@ volumes:
name: drone-s3-debrepo-pvc
---
kind: signature
hmac: cfe9263c545d10b26f27dc10b8b5e5b833d0fca4333860550dae28113cef681a
hmac: 886b4ee9d5440155e696730354e0d8f773def8d703105d58d7017bf997e0c687

...
Loading