Commit Graph
104 Commits
Author SHA1 Message Date
Trent Clarke a3c70378aa Fix OCI promotion (#22867)
Removes unnecessary workflow arguments from the Drone workflow
invocation. Refactors some of the `dronegen` generators to make
this easier to express insife `dronegen`
2023-03-14 01:45:23 +00:00
fheinecke 3e85eb64a6 Fixed enterprise and fips OS packages not uploading to OS package repositories when promoting in the context of private git repos (#21163) 2023-03-09 19:17:45 +00:00
Trent Clarke dff5cd4042 Integrates distroless OCI publishing into drone (#22707)
* Integrate GHA OCIU publishing pipeline with Drone

Adds new drone pipelines for building and promoting distroless
images. The pipelines themselves invoke workflows on GHA and
await their completion.

* Revert dev version

* restore -dev suffix

* Review Comments

* Address review comments
2023-03-08 02:30:59 +00:00
Hugo Shaka 9e1f53d33a Move operator into integrations/ (#22618)
* Move operator into `integrations/`

* fixup! Move operator into `integrations/`

* fixup! fixup! Move operator into `integrations/`

* fixup! fixup! fixup! Move operator into `integrations/`

* fixup! fixup! fixup! fixup! Move operator into `integrations/`
2023-03-06 17:59:02 +00:00
fheinecke 866ec12165 Added --artifact-version flag to OS package repo tool (#22104)
* Added `--target-cloud` flag to OS package repo tool

* Updated OS package repo tool to use "version channel" instead of "artifact version"

* Added help flag examples
2023-02-28 19:04:44 +00:00
fheinecke 810a89c0f0 Add OSS repo name to github actions trigger (#21439)
* Add OSS repo name to github actinons trigger

* Bumped 'e' reference
2023-02-09 23:57:58 +00:00
04aa91367f Updated Dronegen for v12 cron jobs (#21357)
* Updated dronegen for v12 cron jobs

* Stamp .drone.yml

* Stamp .drone.yml

---------

Co-authored-by: Roman Tkachenko <roman@goteleport.com>
Co-authored-by: Marco Dinis <marco.dinis@goteleport.com>
2023-02-07 16:28:07 +00:00
fheinecke 87e9d10d1c Fixed issue where container image tag and push step would fail due to missing docker pull --platform argument (#20855) 2023-01-27 21:18:53 +00:00
fheinecke a86f53ca03 Fixed incorrect container image branch version numbers (#20585) 2023-01-24 02:08:36 +00:00
Roman Tkachenko fb9b2907c5 Bump buildbox version build by Drone to 13 (#20380) 2023-01-19 00:29:38 +00:00
Jeff Pihach 34f102bdeb Enable building teleport with the new UI location (#20361)
* Changes for merging webapps into teleport.
2023-01-18 22:22:25 +00:00
fheinecke bbb652bf25 Added binary signing for darwin tarballs (#18719)
Added binary signing for darwin tarballs
2023-01-12 04:58:50 +00:00
Zac Bergquist 1716a15113 dronegen: remove tdr requirement (#19755)
Since the release of `tsh proxy app` we no longer need a
Teleport-aware Drone CLI and can leverage the standard
drone tool from https://docs.drone.io/cli/install/
2023-01-05 15:46:56 +00:00
Trent Clarke e2c795a4b1 Drone and tagging updates trigger GHA buildsfrom drone (#19830)
This patch performs the (hopefully final) switchover that will make drone
defer to GHA in order to build Teleport ion arm64.

This patch:
 - Replaces all of the Dronegen code to generate arm64 builds locally with
   steps that invoke the GHA builder workflow
 - Changes the release tagging behavior in the Makefile to tag `teleport.e`
   with the same tag as teleport. This is required to for Drone to identify
   the revision of the arm64 build workflow to invoke
 - Updates the e reference to include a revision of `teleport.e` that 
   contains the builder workflows

Thanks to everyone involved in getting this working.
2023-01-04 23:28:50 +00:00
Jakub NyckowskiandAlan Parra 9c80f3802e Enable nolintlint linter (#19406)
* Enable nolintlint linter

* Fix nolint comments in the api package

* Fix RDP client comment

* Address review comment

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Allow unused for nolintlint linter

* Remove redundant casting

* Add comment on why allowed unused is enabled

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2022-12-16 21:13:58 +00:00
fheinecke 29d18c9349 Added selective prerelease check to container images promotion pipeline (#18833)
Added selective prerelease check to container images promotion pipeline
2022-12-06 20:03:51 +00:00
fheinecke 742213a8a9 Fixed container images dockerfile download using hardcoded repo name (#19020) 2022-12-05 22:20:20 +00:00
Rafał Cieślak 726330f5b2 Remove DEBUG env var from Connect macOS dronegen (#18899)
It was added in effort to debug flaky Connect builds (#15836).

However, we discovered that the v11.1.0 macOS version of Connect stopped
working. This was likely due to upgrade of electron-builder which recently
updated its process of building native deps
(electron-userland/electron-builder#7196).

In the Node.js ecosystem, the DEBUG env var is typically used to control
which packages emit debug messages [1]. However, after the update of
electron-builder, the env var also changed the behavior of one of the
packages responsible for building the apps.

This was confirmed by inspecting file tree between different app bundles
and running the build locally with DEBUG set to electron-*.

[1] https://www.npmjs.com/package/debug
2022-11-30 18:02:53 +01:00
Justinas Stankevičius 4db05674eb Release server CI integration improvements (#18513)
* Bump relcli (attach assets atomically)

* Create/attach assets atomically

* Order publish-rlz last in promote target

* Move publish-rlz down

Drone needs dependencies to be defined above the dependent pipeline

* Update relcli (enable publishing "dev" builds)

* Bump relcli to a stable version
2022-11-22 16:03:58 +02:00
Jakub Nyckowski 19dfedb65f Update buildbox version to v12 (#18503)
* Update buildbox version to v12

* Update .drone.yml
2022-11-16 19:22:07 +00:00
Tobiasz Heller d6a280327a Sign tsh on windows builder for connect (#18165) 2022-11-15 15:41:51 +00:00
fheinecke e773e9c442 Removed prerelease check for container images on promote (#18392) 2022-11-14 12:22:24 -06:00
Trent Clarke 0b3403978c Tcsc/v12 versioned windows builder (#18339)
Adds a drone node selector so builds will be routed to the correct buildbox

Also:
1.  changes the version of Visual Studio expected by npm to vs 2022 to match buildbox installation

2. Removes the concurrency limit for window push builds. As there are separate builders for v10, v11
    and v12. Given that the concurrency limits are enforced across all builds with the same name, they
    serialise builds from different teleport versions. it seems wasteful to have a builder for v10 sit idle
    while waiting a v11 build completes.

    The concurrent limits have been left for tag builds, as there are flow-on concurrency concern due to artifact
    uploading, etc.
2022-11-10 12:43:38 +00:00
fheinecke 5e786bd68b Fix cron jobs updating teleport operator on v9 (#18281) 2022-11-08 22:44:26 +00:00
Justinas Stankevičius aabe9a3858 Fetch release notes from changelog when publishing (#18159) 2022-11-08 13:47:29 +00:00
fheinecke 1472e9cf9e Added multiarch build support for Teleport (#17597) 2022-10-31 18:00:55 +00:00
Walt 365ab6ef7e Tweak migration pipelines to skip prerelease checks (#17671)
Without this, migration pipelines will fail because they're not run on
a tagged commit, as seen at:
  https://drone.platform.teleport.sh/gravitational/teleport/16776
2022-10-26 19:51:37 +00:00
Brian Joerger 9725c405a5 Make PIV builds opt-in for Mac and Windows (#17767) 2022-10-25 16:35:34 +00:00
Walt d6f07e4f54 APT/YUM publishing fixes (#17638)
* Serialize apt/yum promote pipelines

These were running in parallel, but we want them to run serially.
Therefore, we add a dependency between each step and its previous step.

* Allow dev build promotes to proceed in deb/rpm pipelines

This helps test a couple more changes from this pipeline when cutting a
dev build.  Particularly, we saw the download and role assumption steps
fail in https://github.com/gravitational/teleport/pull/17334, and this
change would have allowed us to catch that error during testing.

* Fix globbing bug

This bug does not appear to affect anything currently.  However it
should be fixed in case the rm is important at some point in the future.

The bug is: when a wildcard is inside quotes, it is treated as a literal
filename.  So rm -rf "$ARTIFACT_PATH/*" tries to remove the file named
'*' instead of trying to remove everything in artifact path.

* Swap YUM_REPO_NEW_ROLE to YUM_REPO_NEW_AWS_ROLE

All other roles environment variables end in AWS_ROLE, and consistency
is our friend here.
2022-10-21 06:23:21 +00:00
fheinecke 633b9582e7 Added multiarch build support for teleport-operator (#16688)
* Added multiarch build support for teleport oss, ent, and fips

* Exported image/imageTag types

* Resigned dronegen

* Removed remainder of testing changes

* Removed changes to submodules

* Reverted dockerfile-fips change

* FIxed docs wording

* Un-exported most constants

* Removed teleport.e makefile deb call

* Moved "sed | cut magic" to files

* Re-added `mkdir -pv /go/cache` to push.go

* Command deterministic order fix

* Added staging-only tag pipeline

* Moved PR to teleport operator to minimize potential issue impact

* Updated promote to pull and push without build

* Made cron triggers not affect canonical tags

* Added check for pre-existing tags on immutable CRs

* Added immutability check to manifests

* Updated staging ecr to only apply $TIMESTAMP tag on cron triggers

* Updated triggerinfo struct to use a triggerflag struct

* Fixed makefile after git mistake

* Makefile fix

* PR fixes

* Moved internal tools Go version to constant

* Separated container images gofile into multiple files

* Moved testing comment

* Added licenses

* Reorganized and added docs for container images

* Moved const to correct file

* Tag trigger logic test

* Testing specific fix

* Moved testing to v10.3.2

* Make semver dirs

* Refactored local registry name/socket

* Merged previous dockerfile changes

* Added TARGETOS TARGETARCH args

* Updatd tag to testing tag

* Promotion logic test

* Promotion fixes

* Testing specific fix

* Removed prerelease check for testing

* Added staging login commands to promote

* Fixed missing credentials on promotion pull

* Rerun tag test with new "full" semver

* Made staging builds only publish full semver

* Added semver logging command

* Empty commit to trigger Drone

* Promotion test

* Fixed preceeding v on promote pull

* Empty commit to trigger Drone

* Re-enabled verify not prerelease step on promote

* Cron trigger test

* Testing fix

* Testing fix 2

* Added sleep timer on docker buildx build

* Testing cleanup
2022-10-19 02:31:22 +00:00
Michael 4d9b78050e Move enterprise key before Connect binary conditional in mac drone pipe (#17350)
* enterprise key added before connect binary check in pipeline

* updated dronegen

* dronesig
2022-10-12 15:40:45 -05:00
Walt 07cc588735 Fix build-buildboxes timeouts (#17314)
* Refactor build-buildboxes to uses multiple profiles

This greatly reduces the number of steps in the pipeline, allowing drone-runner-kube to successfully schedule the pipeline.

Fixes https://github.com/gravitational/teleport/issues/17310

Furthermore, I also updated un-dronegen'ed pipelines to have same syntax as dronegen'd ones, which is nice for consistency.
2022-10-12 19:59:41 +00:00
Walt 5e5a323ae6 Fix yum repo cleanup (#17334)
Previously, "${ARTIFACT_PATH}" was interpreted as Drone variable
subsitution, resulting in "rm -rf ${ARTIFACT_PATH}/*" becoming
"rm -rf /*", which deleted credentials on the filesystem.
2022-10-12 19:05:54 +00:00
Michael cc1eaf6f75 Add enterprise module support to Connect builds (#17315)
* add windows submodule support for connect builds

* added connect enterprise support to mac builds

* update submodule command

* removed ability to fail webapps.e and recursive

* dronegen
2022-10-12 08:39:53 -05:00
Walt e6e870932e Add AWS Roles to Drone pipelines (#17274)
This is follow up to #17201, that fixes the buildbox pipeline error seen here:

An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::146628656107:user/teleport_build_user_read_only is not authorized to perform: ecr-public:GetAuthorizationToken on resource: * because no identity-based policy allows the ecr-public:GetAuthorizationToken action

Contributes to gravitational/SecOps#213.
2022-10-11 18:45:04 +00:00
Walt acbf575230 Refactor Drone Pipelines to use AWS role assumption (#17201)
This PR updates our various Drone pipelines to use AWS roles for publishing.

Our AWS FTR requires that we do not use any long lived credentials in our AWS accounts and instead use roles. This means we need to move from attaching policies directly to users to attaching policies to roles and having policyless users assume those roles.

https://aws.amazon.com/partners/foundational-technical-review/

Contributes to https://github.com/gravitational/SecOps/issues/213
2022-10-10 20:32:43 +00:00
Justinas Stankevičius 9515fe88a1 Finalize CI release API integration (#16834)
* Switch to production instance of release server

* Stop ignoring failure in release registration

* Bump relcli to v1.1.70
2022-10-05 12:11:20 +00:00
Walt Della 531bc515ae Fetch tags when promoting rpm/deb
Without this any tag that isn't part of the history on master will fail
to successfully promote.  This breaks most dev builds, which don't end
up as part of master or a release branch.
2022-10-04 14:38:15 -07:00
Walt Della 0bd1d1b3d5 Fix OS package repo promotion issue
Without these changes, the promote step will always fail because of a
mismatch between where the repo is cloned and where it is referenced:

  /go/src/.../teleport.git
vs
  /go/src/.../teleport

(cherry picked from commit b209b98f0d)
2022-10-04 14:38:15 -07:00
Brian Joerger ce20b20753 PIV login enforcement (#15874)
Add private key policy enforcement.

  - Add private key policy cert extensions and enforcement.

  - Add private key policy settings and attestation logic.

  - Wire attestation request through login endpoints.

  - Store attestation data for reissue requests.

  - Add private key policy discovery and logic.

  - Relogin on hardware key policy errors.

  - Include integration with Teleport Connect.
2022-09-30 23:27:48 +00:00
Justinas Stankevičius 2efb0670eb Clean up old artifacts when retrying a tag build (#16669)
* Port publish-rlz pipeline to dronegen

* Add artifact cleanup pipeline on tag, "before-all"

* Bump relcli in all pipelines

* Add missing license header

* Refactoring to relcli steps per code review

Only functionally-equivalent changes, .drone.yml identical to previous

* Factor out relcli pipeline

* Use docker:cli to pull relcli

* Add "wait for docker" to relcli pipelines
2022-09-28 13:59:33 +03:00
Brian JoergerandJakub Nyckowski 7d2bd715c4 Add piv build dependencies (#16424)
* Add piv build dependencies.

  - Add LIBPCSCLITE build tag.

  - Add libpcsclite static linking using gravitational/pcsc fork.

  - Enable use of dynamic pcsc library with LIBPCSCLITE=dynamic.

  - Refactor CGOFLAG in Makefile.

  - Update Centos7 Dockerfile and drone.

* Refactor RELEASE_MESSAGE for readability. Now produces message like: "RELEASE_MESSAGE=Building with GOOS=linux GOARCH=amd64 REPRODUCIBLE= and with PIV support and without PAM support, FIPS support, BPF support, Windows RDP client, libfido2, Touch ID."

Co-authored-by: Jakub Nyckowski <jakub.nyckowski@goteleport.com>
2022-09-22 23:16:51 +00:00
Justinas Stankevičius c4153b937e Register Windows native artifacts in release API (#16197)
* Register Windows native artifacts in release API

* Update relcli
2022-09-20 13:42:04 +03:00
Alan Parra a75fcc21d8 Update golangci-lint to 1.49.0 (#16507)
Update metalinter, fix a few lint warnings and replace deprecated linters.

`deadcode`, `structcheck` and `varcheck` are abandoned and now replaced by [`unused`][1].

Since 1.19, `go fmt` reformats godocs according to https://go.dev/doc/comment. I've done a bulk-reformatting of the codebase to keep the linter happy. Backporting is mostly harmless (the exception being `lib/services/role_test.go`, that for some reason breaks the _old_ linter using the new format).

[1]: https://golangci-lint.run/usage/linters/

* Bump golangci-lint version
* Replace abandoned linters
* Fix bodyclose on lib/auth/github.com
* Fix bodyclose on lib/kube/proxy/streamproto/proto_test.go
* Fix bodyclose on lib/srv/alpnproxy/proxy_test.go
* Fix bodyclose on lib/web/conn_upgrade_test.go
* Silence staticcheck on lib/kube/proxy/forwarder_test.go
* Silence staticcheck on lib/utils/certs_test.go
* Address BuildNameToCertificate deprecation warnings
* Run `go fmt ./...`
* Run `go fmt ./...` on api/
* Ignore formatting in role_test.go
* Remove redundant initializers in lib/srv/uacc/
* Update e/
2022-09-19 22:38:59 +00:00
Justinas Stankevičius 62f7537d65 Categorize Teleport Connect linux builds correctly (#16270) 2022-09-09 14:15:54 +00:00
Justinas Stankevičius bd0a5c43d8 Calculate shasums of TCon Linux OS packages (#16253) 2022-09-08 19:50:38 +00:00
Trent Clarke e076f7835c Adds slack channel alert to Teleport Connect build (#15937)
WARNING: Due to issues with the windows drone executor's poor escaping when it echoes commands, I have moved the error message functionality into the PS build functions in build.assets/windows/build.ps1. This means that any failures that occur during the code checkout step will not be reported.

I'm not sure that this is the correct tradeoff, but it may well suffice for now.
2022-08-31 11:32:31 +10:00
Trent Clarke 1f58333531 Build Teleport Connect for Windows (#15292)
Uses Drone to build Teleport Connect for Windows on a Native 
Windows builder.

This PR adds 2 pipelines to the Drone YAML:

1. `push-build-native-windows-amd64`: Invoked on a push to master, 
   branch/v*, etc., and asserts that Teleport Connect can be built, and
   
2. `build-native-windows-amd64`: Invoked when a branch tag is 
   committed to the teleport Repo. Builds Teleport Connect and uploads 
   it to dronestorage
   
These builds are run on a native windows builder (as opposed to tsh, 
which is built in a linux environment and cross-compiled for Windows)
2022-08-29 16:56:55 +10:00
Rafał Cieślak 4ed203a2a0 dronegen: Enable verbose logs for electron tooling on macOS (#15836) 2022-08-26 15:43:16 +00:00
Rafał Cieślak b4c94ebf9b Add drone pipeline for building Connect with signed tsh.app (#15763)
* Add proof of concept of Connect pipeline

The proof of concept includes a lot of copy-pasted lines which will get
cleared up in subsequent commits.

* Extract copying artifacts into separate functions

The tag pipeline no longer needs to worry about Connect artifacts.

* Reuse steps to install & cleanup toolchains

* Share toolchain configuration commands between pipelines

* Share build commands among different pipelines

* Download webapps only if a pipeline builds Connect

As seen by the changes to .drone.yml, this removes unnecessary webapps
clones from these tag pipelines: build-darwin-amd64, build-darwin-amd64-pkg,
build-darwin-amd64-pkg-tsh. None of them needs webapps to function anymore
and the pkg pipelines never needed webapps in the first place.
2022-08-24 16:38:42 +02:00