Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
87ef4cf
Added multiarch build support for Teleport
fheinecke Oct 19, 2022
08738dc
Merge branch 'master' into fred/multiarch-teleport-actual-container-i…
fheinecke Oct 19, 2022
d288768
Removed old Teleport image build/promote/update code
fheinecke Oct 19, 2022
0a89417
Test run 1
fheinecke Oct 19, 2022
f97729a
Switch to pull artifacts from S3
fheinecke Oct 20, 2022
0cdb023
Duplicate name fix
fheinecke Oct 20, 2022
37f9112
OOO argument call fix
fheinecke Oct 20, 2022
16a7ae7
Multiple aws assume role fix
fheinecke Oct 20, 2022
6e4817d
Refactoring
fheinecke Oct 20, 2022
5ddde6f
Resigned drone.yml
fheinecke Oct 20, 2022
8b5aa34
Fixes
fheinecke Oct 20, 2022
d0cf6d9
Shell scripting fixes
fheinecke Oct 20, 2022
e73187e
More shell fixes
fheinecke Oct 20, 2022
b24fb6f
Resign drone.yml
fheinecke Oct 20, 2022
8e37462
Another try
fheinecke Oct 20, 2022
25c7bcb
Changed tag to one that actually has build artifacts
fheinecke Oct 20, 2022
323dcda
s3 cp fix
fheinecke Oct 20, 2022
17127a6
S3 cp fix
fheinecke Oct 20, 2022
145069e
'/' fix
fheinecke Oct 20, 2022
58864ca
Fixed docker build args evaluating in a shell context
fheinecke Oct 20, 2022
a46f60d
Dockerfile deb relative path fix
fheinecke Oct 20, 2022
222f899
Makefile update for tag trigger
fheinecke Oct 20, 2022
d07d056
Added missing makefile dependency
fheinecke Oct 20, 2022
408f82e
Tag update
fheinecke Oct 20, 2022
bcbdbdf
Drone testing tag update
fheinecke Oct 20, 2022
2b117c4
Added login to staging repo on build for pull purposes
fheinecke Oct 20, 2022
b257837
Changed to public ecr login
fheinecke Oct 20, 2022
a4b4d58
Changed buildx build login credentials to prod creds
fheinecke Oct 20, 2022
3d8491d
Promotion test with prerelease check in place
fheinecke Oct 20, 2022
dd8d2be
Promotion test without prerelease check
fheinecke Oct 20, 2022
e818116
Image naming fix
fheinecke Oct 25, 2022
2173580
Empty-Commit
fheinecke Oct 25, 2022
36f3c1c
Empty-Commit
fheinecke Oct 25, 2022
302c892
Empty-Commit
fheinecke Oct 25, 2022
2b8487e
Added support for AWS RBAC
fheinecke Oct 28, 2022
faad6f6
Fixed step dependencies and aws role testing name
fheinecke Oct 28, 2022
8c41ec6
Empty commit for Drone
fheinecke Oct 28, 2022
d371c1f
Fixed missing awsconfig volref
fheinecke Oct 28, 2022
ee240d7
testing commit
fheinecke Oct 28, 2022
418f1e2
Fix issue with AWS credential read/write contention
fheinecke Oct 28, 2022
0b0ea28
Fixed aws rbac login append
fheinecke Oct 28, 2022
50b0138
Added missing volumeRefAwsConfig
fheinecke Oct 28, 2022
0eee70e
Fixed missing pull repo step
fheinecke Oct 30, 2022
43b3fc8
Updated for another round of testing
fheinecke Oct 30, 2022
2d62063
Fixed dockerfile naming issue
fheinecke Oct 30, 2022
6babd1f
Fixed makefile version
fheinecke Oct 30, 2022
2a7eaec
Updated dockerfile download step to use correct URL
fheinecke Oct 31, 2022
23696ec
Make tag pipeline wait on cleanup pipeline
fheinecke Oct 31, 2022
90cce14
Reverted some testing changes
fheinecke Oct 31, 2022
ea6e1bf
Promotion test 1
fheinecke Oct 31, 2022
0da8b3f
Promote test 2
fheinecke Oct 31, 2022
a958539
Cron job test
fheinecke Oct 31, 2022
bfd966e
Testing fix
fheinecke Oct 31, 2022
52847bf
Trim "v" from retrieved release version on cron
fheinecke Oct 31, 2022
da9d977
"v" fix
fheinecke Oct 31, 2022
c51a63f
Testing fix
fheinecke Oct 31, 2022
d903f82
One more testing fix
fheinecke Oct 31, 2022
9b4032d
empty commit for drone...
fheinecke Oct 31, 2022
0370d68
empty commit for drone...
fheinecke Oct 31, 2022
25b44ef
Disable testing code/safeties
fheinecke Oct 31, 2022
03bd596
Merge branch 'master' into fred/multiarch-teleport-actual-container-i…
fheinecke Oct 31, 2022
e93d61d
Updated dronegen after master merge
fheinecke Oct 31, 2022
184d181
Reverted makefile version
fheinecke Oct 31, 2022
9f9c125
Merge branch 'master' into fred/multiarch-teleport-actual-container-i…
fheinecke Oct 31, 2022
89493c1
Merge branch 'master' into fred/multiarch-teleport-actual-container-i…
fheinecke Oct 31, 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
11,579 changes: 9,405 additions & 2,174 deletions .drone.yml

Large diffs are not rendered by default.

75 changes: 23 additions & 52 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
# Master/dev branch: "1.0.0-dev"
VERSION=12.0.0-dev

DOCKER_IMAGE_QUAY ?= quay.io/gravitational/teleport
DOCKER_IMAGE_ECR ?= public.ecr.aws/gravitational/teleport
DOCKER_IMAGE_STAGING ?= 146628656107.dkr.ecr.us-west-2.amazonaws.com/gravitational/teleport

DOCKER_IMAGE ?= teleport

GOPATH ?= $(shell go env GOPATH)

Expand Down Expand Up @@ -408,11 +405,10 @@ release-arm64:
$(MAKE) release ARCH=arm64

#
# make release-unix - Produces a binary release tarball containing teleport,
# tctl, and tsh.
# make build-archive - Packages the results of a build into a release tarball
#
.PHONY:
release-unix: clean full
.PHONY: build-archive
build-archive:
@echo "---> Creating OSS release archive."
mkdir teleport
cp -rf $(BUILDDIR)/* \
Expand All @@ -425,6 +421,13 @@ release-unix: clean full
tar $(TAR_FLAGS) -c teleport | gzip -n > $(RELEASE).tar.gz
rm -rf teleport
@echo "---> Created $(RELEASE).tar.gz."

#
# make release-unix - Produces a binary release tarball containing teleport,
# tctl, and tsh.
#
.PHONY:
release-unix: clean full build-archive
@if [ -f e/Makefile ]; then $(MAKE) -C e release; fi

#
Expand Down Expand Up @@ -998,53 +1001,17 @@ install: build
cp -f $(BUILDDIR)/teleport $(BINDIR)/
mkdir -p $(DATADIR)


# Docker image build. Always build the binaries themselves within docker (see
# the "docker" rule) to avoid dependencies on the host libc version.
.PHONY: image
image: clean docker-binaries
image: OS=linux
image: TARBALL_PATH_SECTION:=-s "$(shell pwd)"
image: clean docker-binaries build-archive oss-deb
cp ./build.assets/charts/Dockerfile $(BUILDDIR)/
cd $(BUILDDIR) && docker build --no-cache . -t $(DOCKER_IMAGE_QUAY):$(VERSION)
cd $(BUILDDIR) && docker build --no-cache . -t $(DOCKER_IMAGE):$(VERSION)-$(ARCH) --target teleport \
--build-arg DEB_PATH="./teleport_$(VERSION)_$(ARCH).deb"
if [ -f e/Makefile ]; then $(MAKE) -C e image; fi

.PHONY: publish
publish: image
docker push $(DOCKER_IMAGE_QUAY):$(VERSION)
if [ -f e/Makefile ]; then $(MAKE) -C e publish; fi

.PHONY: publish-ecr
publish-ecr: image
docker tag $(DOCKER_IMAGE_QUAY) $(DOCKER_IMAGE_ECR)
docker push $(DOCKER_IMAGE_ECR):$(VERSION)
if [ -f e/Makefile ]; then $(MAKE) -C e publish-ecr; fi

# Docker image build in CI.
# This is run to build and push Docker images to a private repository as part of the build process.
# When we are ready to make the images public after testing (i.e. when publishing a release), we pull these
# images down, retag them and push them up to the production repo so they're available for use.
# This job can be removed/consolidated after we switch over completely from using Jenkins to using Drone.
.PHONY: image-ci
image-ci: clean docker-binaries
cp ./build.assets/charts/Dockerfile $(BUILDDIR)/
cd $(BUILDDIR) && docker build --no-cache . -t $(DOCKER_IMAGE_STAGING):$(VERSION)
if [ -f e/Makefile ]; then $(MAKE) -C e image-ci; fi


# DOCKER_CLI_EXPERIMENTAL=enabled is set to allow inspecting the manifest for present images.
# https://docs.docker.com/engine/reference/commandline/cli/#experimental-features
# The internal staging images use amazon ECR's immutable repository settings. This makes overwrites impossible currently.
# This can cause issues when drone tagging pipelines must be re-run due to failures.
# Currently the work around for this is to not attempt to push to the image when it already exists.
.PHONY: publish-ci
publish-ci: image-ci
@if DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect "$(DOCKER_IMAGE_STAGING):$(VERSION)" >/dev/null 2>&1; then\
echo "$(DOCKER_IMAGE_STAGING):$(VERSION) already exists. "; \
else \
docker push "$(DOCKER_IMAGE_STAGING):$(VERSION)"; \
fi
if [ -f e/Makefile ]; then $(MAKE) -C e publish-ci; fi


.PHONY: print-version
print-version:
@echo $(VERSION)
Expand Down Expand Up @@ -1097,13 +1064,17 @@ rpm:
rpm-unsigned:
$(MAKE) UNSIGNED_RPM=true rpm

# build .deb
.PHONY: deb
deb:
# build open source .deb only
.PHONY: oss-deb
oss-deb:
mkdir -p $(BUILDDIR)/
cp ./build.assets/build-package.sh ./build.assets/build-common.sh $(BUILDDIR)/
chmod +x $(BUILDDIR)/build-package.sh
cd $(BUILDDIR) && ./build-package.sh -t oss -v $(VERSION) -p deb -a $(ARCH) $(RUNTIME_SECTION) $(TARBALL_PATH_SECTION)

# build .deb
.PHONY: deb
deb: oss-deb
if [ -f e/Makefile ]; then $(MAKE) -C e deb; fi

# check binary compatibility with different OSes
Expand Down
45 changes: 0 additions & 45 deletions build.assets/Dockerfile-cron

This file was deleted.

44 changes: 0 additions & 44 deletions build.assets/Dockerfile-cron-v8

This file was deleted.

25 changes: 17 additions & 8 deletions build.assets/charts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
FROM ubuntu:20.04
# Stage to build the image, without FIPS entrypoint argument
FROM ubuntu:20.04 AS teleport

# Copy the deb archive
ARG DEB_PATH
COPY ${DEB_PATH?} /tmp/teleport.deb

# Install dumb-init and ca-certificates. The dumb-init package is to ensure
# signals and orphaned processes are are handled correctly. The ca-certificate
Expand Down Expand Up @@ -39,18 +44,22 @@ FROM ubuntu:20.04
# "apt-get update" to reduce the size of the image.
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
# Install dependencies
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y ca-certificates dumb-init libelf1 && \
# Install tools
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y net-tools iputils-ping inetutils-telnet netcat tcpdump busybox && \
busybox --install -s && \
update-ca-certificates && \
# Install Teleport
dpkg -i /tmp/teleport.deb && \
# Cleanup
apt-get -y clean && \
rm -rf /var/lib/apt/lists/*

# Bundle "teleport", "tctl", "tbot", and "tsh" binaries into image.
COPY teleport /usr/local/bin/teleport
COPY tctl /usr/local/bin/tctl
COPY tsh /usr/local/bin/tsh
COPY tbot /usr/local/bin/tbot
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/*

# By setting this entry point, we expose make target as command.
ENTRYPOINT ["/usr/bin/dumb-init", "teleport", "start", "-c", "/etc/teleport/teleport.yaml"]

# Stage to launch Teleport with the fips argument
FROM teleport AS teleport-fips
ENTRYPOINT ["/usr/bin/dumb-init", "teleport", "start", "-c", "/etc/teleport/teleport.yaml", "--fips"]
56 changes: 0 additions & 56 deletions build.assets/charts/Dockerfile-fips

This file was deleted.

13 changes: 13 additions & 0 deletions dronegen/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,3 +345,16 @@ func verifyNotPrereleaseStep() step {
Commands: commands,
}
}

func sliceSelect[T, V any](slice []T, selector func(T) V) []V {
selectedValues := make([]V, len(slice))
for i, entry := range slice {
selectedValues[i] = selector(entry)
}

return selectedValues
}

func getStepNames(steps []step) []string {
return sliceSelect(steps, func(s step) string { return s.Name })
}
Loading