Skip to content
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

0install CI examples #19

Open
bastianeicher opened this issue Aug 30, 2021 · 0 comments
Open

0install CI examples #19

bastianeicher opened this issue Aug 30, 2021 · 0 comments
Assignees

Comments

@bastianeicher
Copy link
Member

Provide examples how to use 0install in CI scripts.

For example, placing a helper script named 0install.sh in your Git repo with:

#!/bin/sh
set -e

download() {
    zeroinstall_release=0install-$(uname | tr '[:upper:]' '[:lower:]')-$(uname -m)-${ZEROINSTALL_VERSION:-latest}
    download_dir=~/.cache/0install.net/$zeroinstall_release

    if [ ! -f $download_dir/files/0install ]; then
        echo "Downloading 0install..." >&2
        rm -rf $download_dir
        mkdir -p $download_dir
        curl -sSL https://get.0install.net/$zeroinstall_release.tar.bz2 | tar xj --strip-components 1 --directory $download_dir
    fi
}

if command -v 0install > /dev/null 2> /dev/null; then
    0install "$@"
else
    download
    $download_dir/files/0install "$@"
fi
@bastianeicher bastianeicher self-assigned this Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant