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

docs: add abctl download buttons with fallback with link to release page #41975

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions docs/using-airbyte/getting-started/oss-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,16 @@ brew upgrade abctl
</TabItem>
<TabItem value="abctl-linux" label="Linux" default>

**1: Download the latest release of `abctl` [here](https://github.com/airbytehq/abctl/releases)**
**1: Download the latest release of `abctl`.**

<a class="abctl-download button button--primary" data-architecture="linux-amd64" href="https://github.com/airbytehq/abctl/releases/latest" target="_blank" style={{ marginRight: '10px' }} download>Latest linux-amd64 Release</a>
<a class="abctl-download button button--primary" data-architecture="linux-arm64" href="https://github.com/airbytehq/abctl/releases/latest" target="_blank" download>Latest linux-arm64 Release</a>
<br/>
<br/>

:::info
Be sure to download the file that is compatible with your machine's processor architecture.
:::
<details>
<summary>Be sure to download the file that is compatible with your machine's processor architecture.</summary>

You'll see two options: `linux-amd64` and `linux-arm64`
If you're unsure which one you need, running the following command will help:
Expand All @@ -63,6 +68,8 @@ uname -m

- If the output is `x86_64`, you have an x86-64 processor.
- If the output is `aarch64` or something similar, you have an ARM-based processor.
</details>
:::

**2: Extract the archive**

Expand Down Expand Up @@ -99,7 +106,11 @@ If this command prints the installed version of the Airbyte Command Line Tool, i
</TabItem>
<TabItem value="abctl-windows" label="Windows" default>

**1: Download the latest release of `abctl` [here](https://github.com/airbytehq/abctl/releases)**
**1: Download the latest release of `abctl`.**

<a class="abctl-download button button--primary" data-architecture="windows-amd64" href="https://github.com/airbytehq/abctl/releases/latest" target="_blank" download>Latest windows-amd64 Release</a>
<br/>
<br/>

**2: Extract the archive**
- Right click the zip file you've downloaded and select `Extract All...`, then choose a destination folder.
Expand Down Expand Up @@ -210,4 +221,6 @@ There are several channels for community support of local setup and deployment.
On Udemy, [The Complete Hands-on Introduction to Airbyte](https://www.udemy.com/course/the-complete-hands-on-introduction-to-airbyte/) is a convenient and hands-on introduction to Airbyte that includes setting up example source and destination configurations. You'll also go on to use it in conjunction with Apache Airflow, Snowflake, dbt, and more.

**Bug Reports:**<br/>If you find an issue with the `abctl` command, please report it as a github
issue [here](https://github.com/airbytehq/airbyte/issues) with the type of `🐛 [abctl] Report an issue with the abctl tool`.
issue [here](https://github.com/airbytehq/airbyte/issues) with the type of `🐛 [abctl] Report an issue with the abctl tool`.

**Releases:**<br/>If you'd like to select which release of abctl to run, you can find the list of releases [here](https://github.com/airbytehq/abctl/releases/).
3 changes: 2 additions & 1 deletion docusaurus/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ const config = {
],

clientModules: [
require.resolve("./src/scripts/fontAwesomeIcons.js"),
require.resolve("./src/scripts/cloudStatus.js"),
require.resolve('./src/scripts/download-abctl-buttons.js'),
require.resolve("./src/scripts/fontAwesomeIcons.js"),
],

presets: [
Expand Down
37 changes: 37 additions & 0 deletions docusaurus/src/scripts/download-abctl-buttons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment";

if (ExecutionEnvironment.canUseDOM) {
// Pre-fetch the urls for the binaries.
const binaries = fetch(
'https://api.github.com/repos/airbytehq/abctl/releases/latest')
.then(response => response.json())
.then(data => data.assets);

// Initialize button by choosing the relevant binary based on the data-architecture tag.
function initializeDownloadButton(button) {
binaries.then(assets => {
const architecture = button.getAttribute('data-architecture');
const binary = assets.find(
b => b.name.toLowerCase().includes(architecture.toLowerCase()));
if (binary) {
button.href = binary.browser_download_url;
button.innerText = `Download ${architecture}`;
}
})
.catch(error => {
console.error('Error fetching latest release:', error);
});
}

// All buttons with this behavior have the class abctl-download.
function initializeAllDownloadButtons() {
const buttons = document.getElementsByClassName('abctl-download');
Array.from(buttons).forEach(initializeDownloadButton);
}

// Document load is a bit weird in docusaurus.
// https://stackoverflow.com/a/74736980/4195169
window.addEventListener('load', () => {
setTimeout(initializeAllDownloadButtons, 1000);
});
}
Loading