Skip to main content

aqua-installer

A shell script and GitHub Actions to install aqua

https://github.com/aquaproj/aqua-installer

Shell Script​

You can install aqua by the following one liner.

curl -sSfL https://raw.githubusercontent.com/aquaproj/aqua-installer/v4.0.5/aqua-installer | bash

But the one liner is a bit dangerous because aqua-installer may be tampered. We recommend verifying aqua-installer's checksum before running it.

curl -sSfL -O https://raw.githubusercontent.com/aquaproj/aqua-installer/v4.0.5/aqua-installer
echo "451028d56959cc738564885b1dbebc2691ea038ffde04e2472e4d486a3591146 aqua-installer" | sha256sum -c -
chmod +x aqua-installer
./aqua-installer

aqua-installer installs aqua to the following path.

  • linux, macOS: ${AQUA_ROOT_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/aquaproj-aqua}/bin/aqua
  • windows: ${AQUA_ROOT_DIR:-$HOME/AppData/Local/aquaproj-aqua}/bin/aqua
caution

From aqua-installer v2, aqua-installer doesn't support specifying the install path.

You can pass the following parameters.

  • -v [aqua version]: aqua version

e.g.

curl -sSfL https://raw.githubusercontent.com/aquaproj/aqua-installer/v4.0.5/aqua-installer | bash -s -- -v v2.43.1

If the version isn't specified, the latest version would be installed.

GitHub Actions​

e.g.

- uses: aquaproj/aqua-installer@611554c6f0137ba41c8dd15aca8bee82504ea461 # v4.1.1
with:
aqua_version: v2.43.1
- uses: aquaproj/aqua-installer@611554c6f0137ba41c8dd15aca8bee82504ea461 # v4.1.1
with:
aqua_version: v2.43.1
working_directory: foo
aqua_opts: ""
env:
AQUA_CONFIG: aqua-config.yaml
AQUA_LOG_LEVEL: debug

Install only specific packages​

aqua-installer >= v4.1.0, aqua >= v2.64.0

By default, aqua-installer runs aqua i -l, so packages are installed by Lazy Install when they are run. This has some problems:

  • Without a GitHub access token, Lazy Install can fail because of the GitHub API rate limit
  • Lazy Install logs are mixed into the command output
  • If you pass a GitHub access token to avoid the rate limit, the token is passed to commands that don't need it

Using the packages input, you can install only specific packages in advance. You don't need to pass a GitHub access token when running them.

- uses: aquaproj/aqua-installer@611554c6f0137ba41c8dd15aca8bee82504ea461 # v4.1.1
with:
aqua_version: v2.64.0
packages: |
ghalint # Command names
suzuki-shunsuke/tfcmt # Package names
- run: ghalint run

Names are separated by whitespace or newlines. Empty lines and text after # are ignored. If packages is set and aqua_opts is the default value -l, -l isn't passed to aqua i.

Inputs​

Please see action.yaml too.

Required Inputs​

namedescription
aqua_versionInstalled aqua version

Optional Inputs​

⚠️ From aqua-installer v2, aqua-installer doesn't support specifying the install path.

namedefaultdescription
skip_install_aqua"false"If this true and aqua is already installed, installing aqua is skipped. aqua-installer >= v3.1.0
enable_aqua_install"true"if this is "false", aqua i is skipped
aqua_opts-laqua i's option. If you want to specify global options, please use environment variables. If packages is set and this is -l, this is ignored
packages""aqua-installer >= v4.1.0, aqua >= v2.64.0. Command or package names to be installed. Names are separated by whitespace or newlines. Empty lines and text after # are ignored. Install only specific packages
working_directory""working directory
policy_allow""aqua >= v2.3.0. If this is "true", aqua policy allow command is run. If a Policy file path is set, aqua policy allow "${{inputs.policy_allow}}" is run

Outputs​

Please see action.yaml too.

Nothing.

💡 Caching​

#428

aqua-installer doesn't support caching, but you can cache packages and registries using actions/cache.

e.g.

- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.local/share/aquaproj-aqua
key: v2-aqua-installer-${{runner.os}}-${{runner.arch}}-${{hashFiles('aqua.yaml')}}
restore-keys: |
v2-aqua-installer-${{runner.os}}-${{runner.arch}}-
- uses: aquaproj/aqua-installer@611554c6f0137ba41c8dd15aca8bee82504ea461 # v4.1.1
with:
aqua_version: v2.43.1

Please fix actions/cache's parameters properly. If you split aqua.yaml using import or use local Registries, you may have to add hashes of them to key and restore-keys.

e.g.

- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.local/share/aquaproj-aqua
key: v2-aqua-installer-${{runner.os}}-${{runner.arch}}-${{hashFiles('.aqua/*.yaml')}} # Change key
restore-keys: |
v2-aqua-installer-${{runner.os}}-${{runner.arch}}-

aqua-installer runs aqua with -l option by default, so packages that aren't run in the workflow aren't cached. If you want to cache all packages, please set aqua_opts to unset -l option.

- uses: aquaproj/aqua-installer@611554c6f0137ba41c8dd15aca8bee82504ea461 # v4.1.1
with:
aqua_version: v2.43.1
aqua_opts: "" # Unset `-l` option

But if -l is unset, aqua installs packages that aren't run in the workflow uselessly.

So it is up to you that whether and how you cache packages.