Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
235 changes: 192 additions & 43 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5285,7 +5285,7 @@ volumes:
################################################
# Generated using dronegen, do not edit by hand!
# Use 'make dronegen' to update.
# Generated at dronegen/misc.go:134
# Generated at dronegen/os_repos.go:270
################################################

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

kind: pipeline
Expand Down Expand Up @@ -5356,6 +5356,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 @@ -5366,25 +5367,26 @@ 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:
- apt update
- apt install -y aptly
- 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
- 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
- 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"
- rm -rf "$BUCKET_CACHE_PATH"
- df -h "$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 @@ -5393,16 +5395,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 @@ -5413,12 +5423,151 @@ 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"
- rm -rf "$BUCKET_CACHE_PATH"
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 @@ -5427,7 +5576,7 @@ trigger:
include:
- production
- promote-docker
- promote-docker-quay
- promote-docker-ecr
repo:
include:
- gravitational/*
Expand Down Expand Up @@ -5461,26 +5610,23 @@ steps:
- docker pull 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport-ent:$${VERSION}-fips
- 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
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 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
from_secret: PRODUCTION_TELEPORT_DRONE_USER_ECR_SECRET
volumes:
- name: dockersock
path: /var/run
Expand All @@ -5499,12 +5645,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 @@ -5513,7 +5659,7 @@ trigger:
include:
- production
- promote-docker
- promote-docker-ecr
- promote-docker-quay
repo:
include:
- gravitational/*
Expand Down Expand Up @@ -5547,23 +5693,26 @@ steps:
- docker pull 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport-ent:$${VERSION}-fips
- 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 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
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
volumes:
- name: dockersock
path: /var/run
Expand Down Expand Up @@ -5927,6 +6076,6 @@ volumes:
name: drone-s3-debrepo-pvc
---
kind: signature
hmac: 8ea23f6116bc5cb5617d7e7cd655b66a2d0e24d82e611e95917fb8a34b6a826a
hmac: 202db1f2d6e0f4f58248bc2658e956f62194fea4b8bf025fe30ffd23c5c4c25a

...
Loading