Commit graph

22 commits

Author SHA1 Message Date
Jakub Nyckowski 32673f7eca
Build version checker - multiple fixes (#30580)
* Build version checker - multiple fixes

In several files, the command 'go run' has been updated to 'CC=gcc go run'. This ensures that gcc is used when compiling the Go code, to provide better cross platform support. Prior to this change, the Go compiler was making platform specific builds.

This was a significant issue with the 'kube operator' goal where the built binary could not operate across different platforms.

The change has been applied consistently throughout the codebase in 'Makefile', 'container_image_triggers.go', 'version.mk', 'os_repos.go', and 'build.assets/Makefile' files. Compliance with this new standard should be maintained going forward for any new compilation requests.

* Update .drone.yml

* Replace CC=gcc environment variable with CGO_ENABLED=0

The CC=gcc environment variable was replaced with CGO_ENABLED=0 as CGO is not needed.

* Update .drone.yml
2023-08-16 23:26:41 +00:00
fheinecke 85c49b0980
Added parallel OS package publishing and rolling release channel (#28659)
* Added parallel OS package publishing and rolling release channel

* Bump `e` for test

* Fixed parallelism issue

* Re-ran make dronegen

* Addressed PR comments

* reverted accidental e ref change

* Linter fix

* Bumped `e` to `gravitational/teleport` master ref
2023-08-08 04:52:03 +00:00
fheinecke 25f2731a07
Updated promotion pipelines to publish OS packages in series (#24753) 2023-04-18 23:12:38 +00:00
fheinecke 7262c14f54
Added flag to gh-trigger-workflow tool to wait for pre-existing runs (#24696)
* Added flag to `gh-trigger-workflow tool` to wait for pre-existing runs

* Addressed PR comments

* workflowId -> workflowID

* Id -> ID
2023-04-17 21:40:53 +00:00
fheinecke 4d3145b5bf
Fixed OPRT migration issues (#24655)
* Fixed OPRT migration issues

* Removed package-to-test from unsupported teleport-ent-updater package
2023-04-16 20:32:20 +00:00
fheinecke af97f525e2
Flipped environment logic for OS package promotion (#24639) 2023-04-16 13:34:27 +00:00
fheinecke 4c0113df9e
Removed "workflow-tag" argument from OPRT GHA call (#24637) 2023-04-15 19:38:49 +00:00
fheinecke 5001cfb5ac
Added missing mkdir call when determining if a release is a pre-release. (#24634)
* Added missing mkdir call

* Updated to calculate dirname at dronegen time
2023-04-15 15:10:01 +00:00
fheinecke 5690cb007e
Migrate publishing of new APT and YUM repos to GHA (#24350)
* Deleted OPRT from this repo

* Migrated dronegen to call gha workflow

* Removed dead pipelines

* Removed unused function to appease linter

* Accounted for private repo promotions

* Updated to use package name filter

* Accounted for teleport-ent-updater publishing
2023-04-14 19:42:53 +00:00
Cam Hutchison cae6593ff7
Fix substution of ENV_FILTER (#23631)
Change `${{ENV_FILTER}}` to `$${ENV_FILTER}`, as double-dollar is the
way to escape an expansion so that drone does not try to do it, and
instead pass `${ENV_FILTER}` to the shell to expand.

Update the drone pipeline config with:

    make dronegen

Fixes: https://github.com/gravitational/teleport/pull/23536
Reference: https://docs.drone.io/pipeline/environment/substitution/#escaping
2023-03-27 18:05:53 +00:00
fheinecke a86aeb8c93
Fixed Drone syntax related to private repo publishing (#23536) 2023-03-24 17:57:26 +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
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
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
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
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
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
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
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
fheinecke b022fea56b
Added YUM implementation of OS package build tool (#14203)
* Added YUM implementation of OS package build tool

* Addressed PR comments

* Added YUM migrations

* Added curl to YUM dependencies

* Changed pipelines to use golang:1.18.4-bullseye for Go

* Implemented proper repo downloading logic

* Fixed other merge conflicts

* Added artifacts cleanup

* Removed delete on s3 sync

* Added RPM migrations

* v8 migrations

* Partial v8 migration

* Migration remainder

* Reduced requested resources

* Updated resource limits per step

* Added k8s stage resource limits to drone

* Fixed format issue

* Removed resource requests

* Added `depends_on` support to dronegen

* v8.3 migrations

* Fixed parallelism

* Removed migration parallelism

* Fixed RPM base arch lookup

* v6 and v7 YUM migration

* Fixed missing ISA

* Updated repo file path

* Added logging

* Removed vars from repo file

* v8.3 migration first batch

* v8.3 migration second batch

* v9.0 migration

* v9.1 migration

* v9.2 migration

* v9.3 first migration

* v9.3 second migration

* v10.0 migration

* Removed migrations

* Disabled shell linting non-issues

* Fixed linter problem

* More linter fixes
2022-08-02 21:32:59 +00:00