Build and download Airgap bundle by CLI or API

Do we have the equivalent of clicking on “Rebuild” and copy the download URL using CLI or API? We’re working with airgap installation. Thanks

Hi @felix, thank you for posting this question. To get the download URL, you might be able to use the replicated channel inspect command.

I’m not sure if there’s something to trigger Rebuild via the CLI. But a new replicated release promote would do the trick of course.

hey @jdewinne, sadly channel inspect doesn’t give me the url:

ID:             channel id
NAME:           channel name
DESCRIPTION:    
RELEASE:        7
VERSION:        0.01

Looking at the portal it gives me this, how do I make it build without having to go to the portal and clicking?:

image

I already did promote the channel using:

replicated release create --version $VERSION --ensure-channel --promote $REPLICATED_CHANNEL --yaml-dir "$YAMLS"

Does the channel have airgap enabled in the settings?

I think @dmitriy called out that the replicate channel inspect behavior is different if you use channel name vs. the channel ID.

But also I am not aware of a way to get the actual airgap bundle URL for the application version, I think the CLI today only gets you the kURL bundle

I too would like to be able to grab the Airgap bundle to insert into our automated pipeline. The best was would be to allow us to get it through the CLI - I understand you are using AWS presign feature and I could help with that if needed.

guys, after digging into their swagger, here’s what would do it:

URL=$(curl "https://api.replicated.com/vendor/v3/app/$REPLICATED_APP_ID/channel/$REPLICATED_CHANNEL_ID/airgap/download-url?channelSequence=$REPLICATED_CHANNEL_SEQUENCE" \
  --fail-with-body \
  --header "Authorization: $REPLICATED_API_TOKEN" \
  --header 'Content-Type: application/json' | jq -r '.url')

echo $URL
1 Like

Yep total works! Thanks @felix .

Another variation I spun from that is:

curl “https://api.replicated.com/vendor/v3/app/$REPLICATED_APP_ID/channel/$REPLICATED_CHANNEL_ID/airgap/download-url” --header “Authorization: $REPLICATED_API_TOKEN” --header ‘Content-Type: application/json’ | jq -r ‘.url’

This allows you to grab the latest airgap pre-signed URL of the channel, so you don’t have to provide the sequence ID everytime - great for automation of course.

1 Like

@felix Is this still working for you? I’ve noticed mine started failing this afternoon