Skip to content

Commit

Permalink
ci: Remove drone(gen) from repo (#38739)
Browse files Browse the repository at this point in the history
Remove `.drone.yml` and `dronegen` which generates it from the repo,
disabling drone on master. Remove references to drone in docs.

The remaining piplines in `.drone.yml` were the tag build and promote
pipelines which now run on GitHub Actions, the push build pipelines that
are currently of limited value and will be re-done differently with a
little thought, and the `teleport-docker-cron-ecr` pipeline which no
longer works as of v15 due to the removal of the legacy OCI images (the
teleport-labs stuff that the pipeline builds is to be removed shortly
too).
  • Loading branch information
camscale authored Feb 28, 2024
1 parent 12c3f50 commit 7835864
Show file tree
Hide file tree
Showing 25 changed files with 7 additions and 6,244 deletions.
2,956 changes: 0 additions & 2,956 deletions .drone.yml

This file was deleted.

16 changes: 2 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ endif
test-sh:
@if ! type bats 2>&1 >/dev/null; then \
echo "Not running 'test-sh' target as 'bats' is not installed."; \
if [ "$${DRONE}" = "true" ]; then echo "This is a failure when running in CI." && exit 1; fi; \
if [ "$${CI}" = "true" ]; then echo "This is a failure when running in CI." && exit 1; fi; \
exit 0; \
fi; \
bats $(BATSFLAGS) ./assets/aws/files/tests
Expand Down Expand Up @@ -1065,7 +1065,7 @@ lint-sh:
lint-helm:
@if ! type yamllint 2>&1 >/dev/null; then \
echo "Not running 'lint-helm' target as 'yamllint' is not installed."; \
if [ "$${DRONE}" = "true" ]; then echo "This is a failure when running in CI." && exit 1; fi; \
if [ "$${CI}" = "true" ]; then echo "This is a failure when running in CI." && exit 1; fi; \
exit 0; \
fi; \
for CHART in ./examples/chart/teleport-cluster ./examples/chart/teleport-kube-agent ./examples/chart/teleport-cluster/charts/teleport-operator; do \
Expand Down Expand Up @@ -1485,18 +1485,6 @@ init-submodules-e:
git submodule init e
git submodule update

# dronegen generates .drone.yml config
#
# Usage:
# - tsh login --proxy=platform.teleport.sh
# - tsh apps login drone
# - set $DRONE_TOKEN and $DRONE_SERVER (http://localhost:8080)
# - tsh proxy app --port=8080 drone
# - make dronegen
.PHONY: dronegen
dronegen:
go run ./dronegen

# backport will automatically create backports for a given PR as long as you have the "gh" tool
# installed locally. To backport, type "make backport PR=1234 TO=branch/1,branch/2".
.PHONY: backport
Expand Down
39 changes: 4 additions & 35 deletions build.assets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ make

# Safely updating build box Dockerfiles

The build box images are used in Drone pipelines and GitHub Actions. The resulting image is pushed
to Amazon ECR and ghcr.io. This means that to safely introduce changes to Dockerfiles, those changes
The build box images are used in GitHub Actions. The resulting image is pushed
to ghcr.io. This means that to safely introduce changes to Dockerfiles, those changes
should be split into two stages:

1. First you open a PR which updates a Dockerfile and get the PR merged.
2. Once it's merged, Drone is going to pick it up, build a new build box image and push it to Amazon
ECR.
2. Once it's merged, GitHub Actions is going to pick it up, build a new build box
image and push it to ghcr.io
3. Then you can open another PR which starts using the new build box image.

# DynamoDB static binary docker build
Expand All @@ -40,34 +40,3 @@ Or simply copy the binary out of the image using a volume (it will be copied to
```
docker run -v $(pwd)/build:/builds -it teleportbuilder cp /gopath/src/github.com/gravitational/teleport/teleport.tgz /builds
```

# OS package repo migrations

An OS package repo migration is semi-manually publishing specific releases to the new APT and YUM repos. This is required in several situations:

- A customer requests that we add an older version to the repos
- We add another OS package repo (for example APK)
- A OS package promotion fails (for example https://drone.platform.teleport.sh/gravitational/teleport/14666/1/3), requires a PR to fix, and we don't want to cut another minor version

Multiple migrations can be performed at once. To run a migration do the following:

1. Clone https://github.com/gravitational/teleport.git.
2. Change to the directory the repo was cloned to.
3. Create a new branch from master.
4. Add the Teleport versions you wish to migration as demonstrated here: https://github.com/gravitational/teleport/commit/151a2f489e3116fc7ce8f55e056529361d3233a6#diff-2e3a64c97d186491e06fb2c7ead081b7ace2b67c4a4d974a563daf7c117a2c50.
5. Set the `migrationBranch` variable to the name of the branch you created in (3) as demonstrated here: https://github.com/gravitational/teleport/commit/151a2f489e3116fc7ce8f55e056529361d3233a6#diff-2e3a64c97d186491e06fb2c7ead081b7ace2b67c4a4d974a563daf7c117a2c50.
6. Get your Drone credentials from here: https://drone.platform.teleport.sh/account.
7. Export your drone credentials as shown under "Example CLI Usage" on the Drone account page
8. Open a new terminal.
9. Run `tsh apps login drone` and follow any prompts.
10. Run `tsh proxy app drone` and copy the printed socket. This should look something like `127.0.0.1:60982`
11. Switch back to your previous terminal.
12. Run `export DRONE_SERVER=http://{host:port}`, replacing `{host:port}` with the data you copied in (10)
13. Run `make dronegen`
14. Commit the two changed files and push/publish the branch
15. Open a PR merging your changes into master via https://github.com/gravitational/teleport/compare
16. Under the "checks" section, click "details" on the check labeled "continuous-integration/drone/push"
17. Once the pipelines complete, comment out the versions you added and blank out the `migrationBranch` string set in (4, 5) as demonstrated here: https://github.com/gravitational/teleport/pull/15531/commits/9095880560cfe6c93e491e39a7604b1faf72c600#diff-2e3a64c97d186491e06fb2c7ead081b7ace2b67c4a4d974a563daf7c117a2c50
18. Run `make dronegen`
19. Commit and push the changes.
20. Merge the PR and backport if required.
2 changes: 0 additions & 2 deletions build.assets/images.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Those variables are extracted from build.assets/Makefile so they can be imported
# by other Makefiles
# These values may need to be updated in `dronegen/container_image_products.go` if
# they change here
ifeq ($(origin RUNTIME_ARCH), undefined)
DIR := $(dir $(lastword $(MAKEFILE_LIST)))
include $(DIR)arch.mk
Expand Down
2 changes: 0 additions & 2 deletions docs/postrelease.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ is published, since the PR will include an update to the plugins version as well
### Major releases only

- [ ] Update support matrix in docs FAQ page
- [ ] Update `branchMajorVersion` const in Dronegen `/dronegen/container_images.go`, then run `make dronegen`
- [ ] Update `CURRENT_VERSION_ROOT`, `PREVIOUS_VERSION_ONE_ROOT`, and `PREVIOUS_VERSION_TWO_ROOT` variables in `.drone.yml`, then run `make dronegen`
- Example: https://github.com/gravitational/teleport/pull/4602
- [ ] Create PR to update default Teleport image referenced in docker/teleport-quickstart.yml
- Example: https://github.com/gravitational/teleport/pull/4655
Expand Down
4 changes: 1 addition & 3 deletions docs/preflight.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ This checklist is to be run prior to cutting the release branch.
- [ ] Update docs/faq.mdx "Which version of Teleport is supported?" section with release date and support info
- [ ] Update the CI buildbox image
- [ ] Update the `BUILDBOX_VERSION` in `build.assets/images.mk`
- [ ] Run `make dronegen` and ensure _all_ buildbox references in the resulting yaml refer to the new image
- [ ] Commit and merge. Drone should build new buildbox images and push to
`public.ecr.aws`
- [ ] Commit and merge. GitHub Actions should build new buildbox images and push to `ghcr.io`
92 changes: 0 additions & 92 deletions dronegen/aws.go

This file was deleted.

Loading

0 comments on commit 7835864

Please sign in to comment.