Repository navigation
feat: one-command Linux installer (install.sh) #199
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
afe5239
feat: one-command Linux installer (install.sh)
spark2ignite 13bd52d
chore: test install.sh against live releases in CI
spark2ignite 2eb50cb
docs: document the one-command Linux install
spark2ignite 21466cb
chore: address review on install.sh
spark2ignite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| name: Install Script | ||
|
|
||
| # Exercises install.sh (the `curl … | sh` Linux installer) against the real | ||
| # GitHub Releases on every change to it, and weekly so a change to the | ||
| # release assets (names, archive layout, checksums.txt) that breaks the | ||
| # installer is caught without waiting for a user report. | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - install.sh | ||
| - .github/workflows/install-script.yml | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - install.sh | ||
| - .github/workflows/install-script.yml | ||
| schedule: | ||
| - cron: "0 6 * * 1" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| shellcheck: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Shellcheck install.sh | ||
| run: shellcheck -s sh install.sh | ||
|
|
||
| install: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| runner: [ubuntu-latest, ubuntu-24.04-arm] | ||
| image: ["ubuntu:24.04", "debian:12", "fedora:41"] | ||
| runs-on: ${{ matrix.runner }} | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Resolve latest release | ||
| id: latest | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: echo "version=$(gh release view --repo "$GITHUB_REPOSITORY" --json tagName -q .tagName | sed 's/^v//')" >> "$GITHUB_OUTPUT" | ||
|
|
||
| # Inside a stock container, as a non-root user: the default install | ||
| # goes to ~/.local/bin with completions, a pinned version is honored, | ||
| # and --system installs the distro package. | ||
| - name: Install in ${{ matrix.image }} | ||
| env: | ||
| IMAGE: ${{ matrix.image }} | ||
| LATEST: ${{ steps.latest.outputs.version }} | ||
| run: | | ||
| docker run --rm -e LATEST -v "$PWD/install.sh:/install.sh:ro" "$IMAGE" sh -euc ' | ||
| if command -v apt-get >/dev/null; then | ||
| apt-get update -qq && apt-get install -y -qq curl ca-certificates >/dev/null | ||
| else | ||
| dnf install -y -q util-linux shadow-utils >/dev/null # su, useradd | ||
| fi | ||
| useradd -m tester | ||
|
|
||
| su tester -c "sh /install.sh" | ||
| su tester -c "~/.local/bin/dci --version" | grep -F "version $LATEST" | ||
| su tester -c "test -f ~/.local/share/bash-completion/completions/dci && test -f ~/.config/fish/completions/dci.fish && test -f ~/.local/share/zsh/site-functions/_dci" | ||
|
|
||
| su tester -c "sh /install.sh --version 2.7.5" | ||
| su tester -c "~/.local/bin/dci --version" | grep -F "version 2.7.5" | ||
|
|
||
| sh /install.sh --system | ||
| /usr/bin/dci --version | grep -F "version $LATEST" | ||
| ' | ||
|
|
||
| edge-systems: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Alpine gets a clear glibc error | ||
| run: | | ||
| set +e | ||
| out=$(docker run --rm -v "$PWD/install.sh:/install.sh:ro" alpine:3.20 sh -c 'apk add -q curl && sh /install.sh' 2>&1) | ||
| status=$? | ||
| set -e | ||
| echo "$out" | ||
| test "$status" -ne 0 | ||
| echo "$out" | grep -F "dci needs glibc" | ||
|
|
||
| # A musl loader on a glibc host (Debian's musl-tools) must not trip the | ||
| # glibc check. | ||
| - name: Debian with musl-tools installs | ||
| run: | | ||
| docker run --rm -v "$PWD/install.sh:/install.sh:ro" debian:12 sh -euc ' | ||
| apt-get update -qq && apt-get install -y -qq curl ca-certificates musl-tools >/dev/null | ||
| ls /lib/ld-musl-* | ||
| sh /install.sh | ||
| ~/.local/bin/dci --version | ||
| ' | ||
|
|
||
| # Too-old glibc: a clear error naming the floor, and an existing dci is | ||
| # left in place rather than replaced by a binary that cannot start. | ||
| - name: Old glibc keeps the existing dci | ||
| run: | | ||
| docker run --rm -v "$PWD/install.sh:/install.sh:ro" ubuntu:20.04 sh -euc ' | ||
| apt-get update -qq && apt-get install -y -qq curl ca-certificates >/dev/null | ||
| mkdir -p ~/.local/bin && printf "#!/bin/sh\necho old dci\n" > ~/.local/bin/dci && chmod +x ~/.local/bin/dci | ||
| if out=$(sh /install.sh 2>&1); then echo "$out"; echo "install unexpectedly succeeded"; exit 1; fi | ||
| echo "$out" | ||
| echo "$out" | grep -F "needs glibc 2.34 or newer" | ||
| test "$(~/.local/bin/dci)" = "old dci" | ||
| test -z "$(ls -A ~/.local/bin | grep -v "^dci$")" | ||
| ' | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.