-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
work-in-progress to convert the build to use go/build as opposed to t…
…he makefile abstraction. Signed-off-by: Mark McCormick <[email protected]>
- Loading branch information
Showing
1 changed file
with
46 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ environment: | |
- build-base | ||
- busybox | ||
- ca-certificates-bundle | ||
- rust | ||
- cargo-auditable | ||
- corepack | ||
- go | ||
- node-gyp | ||
|
@@ -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 | ||
|
@@ -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 | ||
|