Skip to content

Commit

Permalink
Merge pull request #70 from spotty-cloud/dev
Browse files Browse the repository at this point in the history
Spotty v1.3.0
  • Loading branch information
apls777 committed Oct 25, 2020
2 parents f45c7bb + 147cb90 commit 2cc2638
Show file tree
Hide file tree
Showing 287 changed files with 6,443 additions and 5,729 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Generate Docs

on:
push:
branches:
- master

jobs:
update-doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.6

- name: generate docs
run: |
cd docs
pip install -r requirements.txt
make html
cd build/html
touch .nojekyll
echo "spotty.cloud" > CNAME
git init
git config --local user.email "github-bot@spotty.cloud"
git config --local user.name "Spotty Dev Bot"
git add .
git commit -m "generated docs" -a
- uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
repository: spotty-cloud/website
force: true
directory: docs/build/html
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ article on Medium for a real-world example.
## Installation

Requirements:
* Python >=3.5
* Python >=3.6
* AWS CLI (see [Installing the AWS Command Line Interface](http://docs.aws.amazon.com/cli/latest/userguide/installing.html))
if you're using AWS
* Google Cloud SDK (see [Installing Google Cloud SDK](https://cloud.google.com/sdk/install))
Expand Down Expand Up @@ -56,12 +56,12 @@ Use [pip](http://www.pip-installer.org/en/latest/) to install or upgrade Spotty:
To connect to the running container via SSH, use the following command:

```bash
$ spotty ssh
$ spotty sh
```

It runs a [tmux](https://github.com/tmux/tmux/wiki) session, so you can always detach this session using
__`Ctrl + b`__, then __`d`__ combination of keys. To be attached to that session later, just use the
`spotty ssh` command again.
`spotty sh` command again.

Also, you can run your custom scripts inside the Docker container using the `spotty run <SCRIPT_NAME>` command. Read more
about custom scripts in the documentation:
Expand Down
47 changes: 15 additions & 32 deletions bin/spotty
Original file line number Diff line number Diff line change
@@ -1,50 +1,33 @@
#!/usr/bin/env python

import sys
import argparse
import logging
import spotty
from spotty.commands.aws import AwsCommand
from spotty.commands.download import DownloadCommand
from spotty.commands.gcp import GcpCommand
from spotty.commands.run import RunCommand
from spotty.commands.ssh import SshCommand
from spotty.commands.status import StatusCommand
from spotty.commands.stop import StopCommand
from spotty.commands.sync import SyncCommand
from spotty.helpers.commands import add_subparsers, get_custom_commands
from spotty.commands.start import StartCommand
from spotty.cli import get_parser
from spotty.commands.writers.output_writrer import OutputWriter


parser = argparse.ArgumentParser()
parser.add_argument('-V', '--version', action='store_true', help='Display the version of the Spotty')
parser = get_parser()

commands = [
StartCommand,
StopCommand,
StatusCommand,
SshCommand,
RunCommand,
SyncCommand,
DownloadCommand,
AwsCommand,
GcpCommand,
] + get_custom_commands()

# add commands to the parser
add_subparsers(parser, commands)

# parse arguments
args = parser.parse_args()
args = sys.argv[1:]
output = OutputWriter()

# display the version
display_version = args.version
if display_version:
if '-V' in args:
output.write(spotty.__version__)
sys.exit(0)

# separate Spotty arguments from custom arguments
custom_args = []
if '--' in args:
dd_idx = args.index('--')
custom_args = args[(dd_idx + 1):]
args = args[:dd_idx]

# parse arguments
args = parser.parse_args(args)
args.custom_args = custom_args

# logging
logging_level = logging.DEBUG if 'debug' in args and args.debug else logging.WARNING
logging.basicConfig(level=logging_level, format='[%(levelname)s] %(message)s')
Expand Down
4 changes: 0 additions & 4 deletions docs/.gitignore

This file was deleted.

25 changes: 0 additions & 25 deletions docs/404.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/CNAME

This file was deleted.

32 changes: 0 additions & 32 deletions docs/Gemfile

This file was deleted.

20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = spotty
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
22 changes: 0 additions & 22 deletions docs/_config.yml

This file was deleted.

15 changes: 0 additions & 15 deletions docs/_includes/head.html

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_includes/head/custom.html

This file was deleted.

44 changes: 0 additions & 44 deletions docs/_includes/nav.html

This file was deleted.

0 comments on commit 2cc2638

Please sign in to comment.