Skip to content

Commit be10247

Browse files
adding download button for realses
1 parent e8fea98 commit be10247

File tree

3 files changed

+65
-9
lines changed

3 files changed

+65
-9
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import React from 'react';
2+
3+
4+
export default function ButtonDownloadVersionedReleaseZip(){
5+
const [selectedVersion, setSelectedVersion] = React.useState("");
6+
const [versions, setVersions] = React.useState([]);
7+
8+
React.useEffect(() => {
9+
const fetchReleases = async () => {
10+
try {
11+
const response = await fetch("https://api.github.com/repos/pioreactor/pioreactor/releases?per_page=30");
12+
if (!response.ok) {
13+
throw new Error("Failed to fetch releases");
14+
}
15+
16+
const data = await response.json();
17+
// Filter out prereleases and drafts
18+
const filteredVersions = data
19+
.filter(release => !release.prerelease && !release.draft)
20+
.map(release => ({ version: release.tag_name }));
21+
22+
setVersions(filteredVersions);
23+
} catch (error) {
24+
console.error("Error fetching releases:", error);
25+
}
26+
};
27+
28+
fetchReleases();
29+
}, []);
30+
31+
const handleDownload = () => {
32+
if (selectedVersion) {
33+
const downloadUrl = `https://github.com/Pioreactor/pioreactor/releases/download/${selectedVersion}/release_${selectedVersion}.zip`;
34+
window.open(downloadUrl, '_blank');
35+
}
36+
};
37+
38+
return (
39+
<div>
40+
<span> Select version to update to: </span>
41+
<select name="version" onChange={e => setSelectedVersion(e.target.value)} style={{ width: "100px" }}>
42+
<option value="">version</option>
43+
{versions.map((blob, index) => (
44+
<option key={index} value={blob.version}>{blob.version}{index === 0 ? " (latest)" : ""}</option>
45+
))}
46+
</select>
47+
<button onClick={handleDownload} disabled={selectedVersion === ''} style={{"marginLeft": "10px"}}>
48+
Download release
49+
</button>
50+
</div>
51+
);
52+
}

user-guide/03-Extending your Pioreactor/01-cluster-management/02-power-cluster.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ Each Pioreactor requires a Raspberry Pi, so you'll need to provide power to each
1010

1111
### Powering 2 to ~6 Pioreactors
1212

13-
Individual PSUs don't scale very well, so below are some other options for powering many Pioreactors with a single PSU.
14-
15-
You can purchase USB hubs from sites like Amazon. They may look something like below:
13+
Individual PSUs don't scale very well, so below are some other options for powering many Pioreactors with a single PSU. You can purchase USB hubs from sites like Amazon.
1614

1715

1816

user-guide/03-Extending your Pioreactor/20-updating-software.md renamed to user-guide/03-Extending your Pioreactor/20-updating-software.mdx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ title: Updating the Pioreactor software
33
slug: /updating-software
44
---
55

6+
import ButtonDownloadVersionedReleaseZip from '@site/src/components/ButtonDownloadVersionedReleaseZip';
7+
8+
69
We publish new software occasionally that fixes bugs, adds new features, and improves performance. You can update your Pioreactor(s) to the latest software from the UI, or from the command line. **We highly recommend keeping your Pioreactor software up to date!**
710

811

@@ -37,10 +40,6 @@ The updating process will update to the _next_ release, after your current versi
3740

3841
You can install the bleeding-edge software from this page as well. Just select the development build in the drop down. Warning: this version may be unstable (and fun!)
3942

40-
41-
![highlight of the webpage showing what to select to update to the development branch](/img/user-guide/click_update_develop.png)
42-
43-
4443
Similarly, from the [command line](https://docs.pioreactor.com/user-guide/accessing-raspberry-pi), you can install specific versions. See `pio update app --help` for more.
4544

4645

@@ -50,7 +49,13 @@ Similarly, from the [command line](https://docs.pioreactor.com/user-guide/access
5049

5150
Each time we release a new Pioreactor version, we create a bundle of the required files as a zip file. This zip file can be uploaded to your Pioreactor cluster via the UI.
5251

53-
1. On the [Releases page](https://github.com/Pioreactor/pioreactor/releases?q=prerelease%3Afalse&expanded=true), download the `release_xx.xx.xx.zip` file for the version you want onto a computer with access to the Pioreactor web UI.
52+
:::info
53+
54+
We highly recommend updating incrementally. That is, update to the _next_ version, and continue only if it succeeds.
55+
56+
:::
57+
58+
1. Download the release you wish to update to: <ButtonDownloadVersionedReleaseZip/>
5459

5560
2. In the web UI, visit _Updates_. In the drop down in the top right, select "Update from zip file".
5661

@@ -69,7 +74,8 @@ Each time we release a new Pioreactor version, we create a bundle of the require
6974
### Method 3: Update using a zip file over scp or sftp
7075

7176

72-
1. On the [Releases page](https://github.com/Pioreactor/pioreactor/releases?q=prerelease%3Afalse&expanded=true), download the `release_xx.xx.xx.zip` file for the version you want.
77+
1. Download the release you wish to update to: <ButtonDownloadVersionedReleaseZip/>
78+
7379
2. We need a software tool up upload this release to the Pioreactor.
7480

7581
1. You can use `scp` on the command line:

0 commit comments

Comments
 (0)