Skip to content

Commit

Permalink
work-in-progress to convert the build to use go/build as opposed to t…
Browse files Browse the repository at this point in the history
…he makefile abstraction.

Signed-off-by: Mark McCormick <[email protected]>
  • Loading branch information
mamccorm committed Nov 26, 2024
1 parent f1cc6c9 commit 1ae28a6
Showing 1 changed file with 46 additions and 13 deletions.
59 changes: 46 additions & 13 deletions teleport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ environment:
- build-base
- busybox
- ca-certificates-bundle
- rust
- cargo-auditable
- corepack
- go
- node-gyp
Expand All @@ -43,21 +45,57 @@ pipeline:
deps: github.com/golang-jwt/jwt/[email protected]

- runs: |
# https://github.com/gravitational/teleport#building-teleport
mkdir -p "${{targets.contextdir}}"/var/lib/teleport
mkdir -p "${{targets.contextdir}}"/usr/local/bin
# This build requires the stable version of rust, managed by rustup, because it requires a few other toolchains too.
rustup install stable
rustup default stable
ARCH=$(uname -m)
export PATH="$HOME/.rustup/toolchains/stable-${ARCH}-unknown-linux-gnu/bin:$PATH"
rustup target add wasm32-unknown-unknown
# This is a bit of a hack, but it's the easiest way to get the right version of rustc and cargo in the path.
export PATH="$HOME/.rustup/toolchains/stable-${{host.triplet.rust}}/bin:$PATH"
make full
pnpm config set package-import-method copy
# Install dependencies and build web assets
make ensure-js-deps
make ensure-webassets
# create me a for loop that iterates over the binaries in build/
# and installs them to "${{targets.contextdir}}"/usr/local/bin
for bin in build/*; do
- uses: go/build
with:
packages: ./tool/teleport
output: teleport
tags: webassets_embed,kustomize_disable_go_plugin_support

- uses: go/build
with:
packages: ./tool/tctl
output: tctl
tags: kustomize_disable_go_plugin_support

- uses: go/build
with:
packages: ./tool/tsh
output: tsh
tags: kustomize_disable_go_plugin_support

- uses: go/build
with:
packages: ./tool/tbot
output: tbot
tags: kustomize_disable_go_plugin_support

- uses: go/build
with:
packages: ./tool/teleport-update
output: teleport-update
tags: kustomize_disable_go_plugin_support

- runs: |
cd tool/fdpass-teleport && cargo build --release --locked
install -Dm755 target/release/fdpass-teleport "${{targets.contextdir}}"/usr/local/bin/
# Install the go binaries
for bin in teleport tctl tsh tbot teleport-update; do
echo "Installing $bin to /usr/local/bin"
install -Dm755 $bin -t "${{targets.contextdir}}"/usr/local/bin
done
Expand All @@ -79,13 +117,8 @@ test:
- runs: |
teleport configure -o file
teleport start -c /etc/teleport.yaml &
# wait for teleport to start :3080
wait-for-it localhost:3080 -t 10
echo "Teleport is running on port 3080!"
# create a user
tctl get roles --format=text
tbot version
tbot --help
Expand Down

0 comments on commit 1ae28a6

Please sign in to comment.