Skip to content

Test install script #1318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,24 @@ jobs:

- name: Publish AOT
run: dotnet run --project build -c release -- publishbinaries

install-script:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} - ${{ matrix.command }}
env:
INSTALL_SCRIPT: https://github.com/raw/elastic/docs-builder/${{ github.sha }}/install.sh
INSTALL_SCRIPT_PWSH: https://github.com/raw/elastic/docs-builder/${{ github.sha }}/install.ps1
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
command: curl -sL https://github.com/raw/elastic/docs-builder/${{ github.sha }}/install.sh | sh
- os: macos-latest
command: curl -sL https://github.com/raw/elastic/docs-builder/${{ github.sha }}/install.sh | sh
- os: windows-latest
command: iex (New-Object System.Net.WebClient).DownloadString('https://github.com/raw/elastic/docs-builder/${{ github.sha }}/install.ps1')
steps:
- uses: actions/checkout@v4
- run: ${{ matrix.command }}
- run: docs-builder --help
10 changes: 5 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/sh
set -euo pipefail
#!/usr/bin/env bash
set -eu

# Determine OS type and architecture
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)

# Map architecture naming
if [ "$ARCH" = "x86_64" ]; then
ARCH="amd64"
ARCH="x64"
elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then
ARCH="arm64"
fi
Expand Down Expand Up @@ -36,7 +36,7 @@ fi
# Check if docs-builder already exists, but handle non-interactive shells
if [ -f "$INSTALL_DIR/docs-builder" ]; then
echo "docs-builder is already installed."

# Check if script is running interactively (has a TTY)
if [ -t 0 ]; then
# Running interactively, can prompt for input
Expand Down Expand Up @@ -88,4 +88,4 @@ fi
rm -f "$BINARY"

echo "docs-builder has been installed successfully and is available in your PATH."
echo "You can run 'docs-builder --help' to see available commands."
echo "You can run 'docs-builder --help' to see available commands."
Loading