-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Changed "Spot CLI" to "SpotCLI" everywhere - Added install script - Configure Poetry to only build wheel
- Loading branch information
Dmítry Kovalenko
authored
Nov 4, 2020
1 parent
b4f5fa5
commit 9b97441
Showing
5 changed files
with
63 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ jobs: | |
- name: Setup Poetry | ||
uses: abatilo/[email protected] | ||
- name: Build wheel | ||
run: poetry build | ||
run: poetry build -f wheel | ||
- name: Get tag name | ||
id: tag_name | ||
run: echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
set -eu | ||
trap "" SIGINT | ||
|
||
DOWNLOAD_URL=$(curl -fsSL https://api.github.com/repos/SupersonicAds/spotcli/releases/latest \ | ||
| grep browser_download_url \ | ||
| cut -d '"' -f 4) | ||
WHEEL_FILE="$(mktemp -d)/${DOWNLOAD_URL##*/}" | ||
trap "rm -f $WHEEL_FILE || true && echo 'ERROR: SpotCLI wasn\\'t installed' && exit 1" ERR | ||
|
||
echo -en "Downloading latest wheel from GitHub..." | ||
curl -fsSL -o $WHEEL_FILE "$DOWNLOAD_URL" | ||
echo -en "done\n" | ||
|
||
echo -en "Detecting Python..." | ||
if pyenv versions >/dev/null 2>&1 && [[ $(python -V 2>/dev/null) == *"Python 3"* ]] | ||
then | ||
echo -en "$(python -V | sed 's/Python //g') (pyenv)\n" | ||
PIP="$(which pip)" | ||
elif HOMEBREW_PIP=$(brew list python3 -q 2>/dev/null | grep "pip3$") | ||
then | ||
echo -en "$($HOMEBREW_PIP -V | grep -Eo 'python [0-9.]+' | sed 's/python //g') (homebrew)\n" | ||
PIP=$HOMEBREW_PIP | ||
elif [[ $(python3 -V 2>/dev/null) == *"Python 3"* ]] | ||
then | ||
echo -en "$(python3 -V | sed 's/Python //g') (system)\n" | ||
echo -en "You may need to enter sudo password" | ||
PIP="sudo $(which pip3)" | ||
else | ||
echo -en "ERROR: Python 3 not found\n" | ||
exit 1 | ||
fi | ||
|
||
echo -en "Installing SpotCLI..." | ||
PIP_STDOUT=$(mktemp) | ||
$PIP install "$WHEEL_FILE" >/dev/null | ||
rm -f $WHEEL_FILE | ||
rm -f $PIP_STDOUT | ||
mkdir -p $HOME/.spot | ||
touch $HOME/.spot/config.yaml | ||
echo -en "done\n" | ||
|
||
echo -en "Verifying installation..." | ||
[[ $(spotcli version) == *"SpotCLI version"* ]] | ||
echo -en "ok\n" | ||
|
||
trap - EXIT | ||
trap - SIGINT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[tool.poetry] | ||
name = "spotcli" | ||
version = "1.0.3" | ||
description = "Spot CLI" | ||
description = "CLI for Spot Elastigroups management" | ||
authors = ["Dmitry Kovalenko <[email protected]>"] | ||
license = "MIT" | ||
readme = "README.md" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters