Skip to content

Commit

Permalink
Merge pull request #346 from ELIXIR-NO/feat/update-lega-readme
Browse files Browse the repository at this point in the history
Add detailed usage explanation for install script options in README
  • Loading branch information
kjellp authored Feb 5, 2025
2 parents 6cc8ef6 + a67d7be commit 6e00c0d
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 14 deletions.
68 changes: 61 additions & 7 deletions cli/lega-commander/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,71 @@

## Installation / Update

### Linux
run the command below on your terminal:
### Manual Installation (Linux/macOS)

1. **Download** the appropriate tarball for your operating system from the [releases page](https://github.com/ELIXIR-NO/FEGA-Norway/releases?q=lega-commander-*-assets).
2. **(Optional) Verify** the file’s checksum using the checksum file provided in the same release.
3. **Extract** the tarball (e.g., `tar -xzf <filename>.tar.gz`).
4. **Move** the extracted binary (`lega-commander`) to a folder in your system’s PATH.

**For example:**

**Option 1:** Install system-wide (requires `sudo`):
```
sudo cp lega-commander /usr/local/bin/
sudo chmod +x /usr/local/bin/lega-commander
```
**Option 2:** Install for the current user (no `sudo` required):
```
mkdir -p ~/.local/bin
cp lega-commander ~/.local/bin/
chmod +x ~/.local/bin/lega-commander
```
**Note:** Ensure ~/.local/bin is in your PATH.

### Windows
Go to the [releases page](https://github.com/ELIXIR-NO/FEGA-Norway/releases?q=lega-commander-*-assets) and manually download the latest binary.
Double-click the .zip (if provided) to extract it, and then place lega-commander.exe in your desired location
(for example, in C:\Program Files\ or another folder included in your PATH).

### Automated Installation
#### Linux
Run the command below on your terminal:
```
curl -fsSL https://raw.githubusercontent.com/ELIXIR-NO/FEGA-Norway/main/cli/lega-commander/install.sh | sudo sh
```

### MacOS
run the command below on your terminal:
#### MacOS
Run the command below on your terminal:
```
curl -fsSL https://raw.githubusercontent.com/ELIXIR-NO/FEGA-Norway/main/cli/lega-commander/install.sh | sh
```

### Windows
Go to the [releases page](https://github.com/ELIXIR-NO/FEGA-Norway/releases?q=lega-commander-*-assets) and download the latest binary manually.


#### This script:
1. Detects your OS and architecture.
2. Fetches the latest (or specified) version of lega-commander from the GitHub releases.
3. Verifies the downloaded binary against a checksum to ensure integrity.
4. Extracts the binary and installs it to a suitable system directory (e.g., /usr/local/bin or $HOME/.local/bin).
5. Removes temporary files and confirms a successful installation.


#### Advanced Installation Options

The installation script (`install.sh`) provides several options to customize the installation process.
```
Usage: $this [-b bindir] [-t tag] [-d] [-h]
-b Sets bindir or installation directory (defaults to /usr/local/bin).
-t Sets a specific tag (e.g., "vX.Y.Z") to install.
-d Turns on debug logging (if available).
-h Displays this help message.
If no tag is specified, the latest release from:
https://github.com/ELIXIR-NO/FEGA-Norway/releases
will be installed.
```


## Configuration
Before using the lega commander, make sure all the environment variables required for authentication are set:
Expand Down Expand Up @@ -89,6 +140,9 @@ that contains c4gh files, we can use this example command:
```
lega-commander upload -f /path/to/a/folder/containing/c4gh/files
```
<!--
### How it works
The flowchart below shows how lega commander connects to the other components of project in order to **UPLOAD** the file/folder:
![Flowchart of upload](flowchart_lega_commander.jpg)
![Flowchart of upload](flowchart_lega_commander.jpg)
-->
16 changes: 9 additions & 7 deletions cli/lega-commander/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ usage() {
cat <<EOF
$this: Download Go binaries for lega-commander from ELIXIR-NO/FEGA-Norway
Usage: $this [-b] bindir [-d] [tag]
-b sets bindir or installation directory, Defaults to /usr/local/bin
-t sets a specific tag (e.g. "vX.Y.Z") to install
-d turns on debug logging
[tag] is a tag from
https://github.com/ELIXIR-NO/FEGA-Norway/releases
If tag is missing, then the latest will be used.
Usage: $this [-b bindir] [-t tag] [-d] [-h]
-b Sets bindir or installation directory (defaults to /usr/local/bin).
-t Sets a specific tag (e.g., "vX.Y.Z") to install.
-d Turns on debug logging.
-h Displays this help message.
If no tag is specified, the latest release from:
https://github.com/ELIXIR-NO/FEGA-Norway/releases
will be installed.
EOF
exit 2
Expand Down

0 comments on commit 6e00c0d

Please sign in to comment.