aquaproj / aqua

Declarative CLI Version manager written in Go. Support Lazy Install, Registry, and continuous update with Renovate. CLI version is switched seamlessly
https://aquaproj.github.io
824 stars 34 forks source link

aqua-installer, update-checksum: Support Azure Repos #1856

Open suzuki-shunsuke opened 1 year ago

suzuki-shunsuke commented 1 year ago

Feature Overview

Support installing aqua and updating aqua-checksums.json in Azure. I haven't used Azure and I'm not familiar with Azure, so I'm not sure this is possible.

Why is the feature needed?

Please explain the problem you want to solve.

To enable non GitHub users to use aqua comfortably.

Does the feature include Breaking Changes?

No.

⚠️ The priority is low

The priority of this issue is low because we think GitHub is a most important platform and other platforms aren't so important. To utilize the resource efficiently, we should focus on the resource to GitHub mainly. We will take a look this issue when we have a time.

Example Code

command and configuration

$ 
suzuki-shunsuke commented 1 year ago

Azure Pipelines

task


sheldonhull commented 1 year ago

@suzuki-shunsuke Do you need help here? Point me to the equivalent/quick summary of what you need. I'm pretty versed in azure devops pipelines and might be able to jump start/help out.

suzuki-shunsuke commented 1 year ago

Thanks. I'm not familiar with Azure, so I really appreciate your help. aqua-installer and update-checksum-action are simple, so maybe you can port them to Azure Pipelines (Azure Pipelines task?) easily. Today I started trying Azure.

suzuki-shunsuke commented 1 year ago

Doesn't Azure Pipelines support the feature like GITHUB_ENV?

https://stackoverflow.com/questions/75131590/azure-pipeline-equivalent-variable-of-github-env

https://github.com/aquaproj/aqua-installer/blob/b657aceb026546ad414cb2521a6c32eab1feb48e/action.yaml#L33-L36

suzuki-shunsuke commented 1 year ago
sheldonhull commented 1 year ago

Sure! I'll do my best to help out here. I use this approach for my mage tasks.

https://github.com/sheldonhull/magetools/blob/4f053c36d89043728180498108ea254956a96a2a/ci/ci.go#L20

suzuki-shunsuke commented 1 year ago

Thanks!

I'd like to add ${AQUA_ROOT_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/aquaproj-aqua}/bin to PATH.

The following code worked!

https://github.com/suzuki-shunsuke/test-azure-pipelines/blob/fca91997a9ef37e2c0845ed83edfc99fcb2c7586/azure-pipelines.yml#L18

echo "##vso[task.setvariable variable=path;]${AQUA_ROOT_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/aquaproj-aqua}/bin:$PATH"
steps:
- bash: |
    curl -sSfL -O https://raw.githubusercontent.com/aquaproj/aqua-installer/v2.1.1/aqua-installer
    echo "c2af02bdd15da6794f9c98db40332c804224930212f553a805425441f8331665  aqua-installer" | sha256sum -c
    chmod +x aqua-installer
    ./aqua-installer
    echo "##vso[task.setvariable variable=path;]${AQUA_ROOT_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/aquaproj-aqua}/bin:$PATH"
  displayName: Install aqua
sheldonhull commented 1 year ago

That's creative. I have a cross platform option I'll try and share soon. Pwsh (powershell) in azure pipelines works on windows and bash so I've created tasks to use this and control the target directory to allow caching too. Leave this issue opened and assign me as well to it and I'll add something for you when I can.

suzuki-shunsuke commented 1 year ago

There are two options.

  1. Share the snippet like https://github.com/aquaproj/aqua/issues/1856#issuecomment-1517092591
  2. Create Azure Pipelines task extension

2. Create Azure Pipelines task extension

In my understanding, we have to write not PowerShell but TypeScript for task extension. GitHub Actions supports some types of action such as javascript, docker, and composite action, but Azure Pipelines task supports only TypeScript.

The other day I tried to create Azure Pipelines task extension, but I stopped it at that time because I'm not so familiar with TypeScript and it's bothersome to develop Azure Pipelines task extension compared with GitHub Actions.

I really appreciate your help.