Skip to content

Commit 285b675

Browse files
committed
Release yml and removed requirements.txt
1 parent da2909b commit 285b675

File tree

5 files changed

+89
-93
lines changed

5 files changed

+89
-93
lines changed

.github/workflows/release.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release Bugout Spire API package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-python@v2
13+
with:
14+
python-version: '3.8'
15+
- name: Install dependencies
16+
run: |
17+
python -m pip install --upgrade pip
18+
pip install -e .[distribute]
19+
- name: Build and publish
20+
env:
21+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
22+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
23+
run: |
24+
python setup.py sdist bdist_wheel
25+
twine upload dist/*

deploy/deploy.bash

+18-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
# Deployment script - intended to run on Spire servers
44

5+
# Colors
6+
C_RESET='\033[0m'
7+
C_RED='\033[1;31m'
8+
C_GREEN='\033[1;32m'
9+
C_YELLOW='\033[1;33m'
10+
11+
# Logs
12+
PREFIX_INFO="${C_GREEN}[INFO]${C_RESET} [$(date +%d-%m\ %T)]"
13+
PREFIX_WARN="${C_YELLOW}[WARN]${C_RESET} [$(date +%d-%m\ %T)]"
14+
PREFIX_CRIT="${C_RED}[CRIT]${C_RESET} [$(date +%d-%m\ %T)]"
15+
516
# Main
617
APP_DIR="${APP_DIR:-/home/ubuntu/app}"
718
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}"
@@ -33,9 +44,13 @@ set -eu
3344

3445
echo
3546
echo
36-
echo "Updating Python dependencies"
37-
"${PIP}" install --upgrade pip
38-
"${PIP}" install -r "${APP_DIR}/requirements.txt"
47+
echo -e "${PREFIX_INFO} Upgrading Python pip and setuptools"
48+
"${PIP}" install --upgrade pip setuptools
49+
50+
echo
51+
echo
52+
echo -e "${PREFIX_INFO} Installing Python dependencies"
53+
"${PIP}" install -e "${APP_DIR}/"
3954

4055
echo
4156
echo

deploy/deploy.monolith.bash

+23-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
#!/usr/bin/env bash
22

3-
# Deployment script - intended to run on Spire servers
3+
# Deployment script - intended to run on Spire API server
4+
5+
# Colors
6+
C_RESET='\033[0m'
7+
C_RED='\033[1;31m'
8+
C_GREEN='\033[1;32m'
9+
C_YELLOW='\033[1;33m'
10+
11+
# Logs
12+
PREFIX_INFO="${C_GREEN}[INFO]${C_RESET} [$(date +%d-%m\ %T)]"
13+
PREFIX_WARN="${C_YELLOW}[WARN]${C_RESET} [$(date +%d-%m\ %T)]"
14+
PREFIX_CRIT="${C_RED}[CRIT]${C_RESET} [$(date +%d-%m\ %T)]"
415

516
# Main
617
APP_DIR="${APP_DIR:-/home/ubuntu/spire}"
@@ -27,19 +38,23 @@ set -eu
2738

2839
echo
2940
echo
30-
echo "Updating Python dependencies"
31-
"${PIP}" install --upgrade pip
32-
"${PIP}" install --exists-action i -r "${APP_DIR}/requirements.txt"
41+
echo -e "${PREFIX_INFO} Upgrading Python pip and setuptools"
42+
"${PIP}" install --upgrade pip setuptools
43+
44+
echo
45+
echo
46+
echo -e "${PREFIX_INFO} Installing Python dependencies"
47+
"${PIP}" install -e "${APP_DIR}/"
3348

3449
echo
3550
echo
36-
echo "Retrieving deployment parameters"
51+
echo -e "${PREFIX_INFO} Retrieving deployment parameters"
3752
mkdir -p "${SECRETS_DIR}"
3853
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" "${PYTHON}" "${PARAMETERS_SCRIPT}" "${AWS_SSM_PARAMETER_PATH}" -o "${PARAMETERS_ENV_PATH}"
3954

4055
echo
4156
echo
42-
echo "Replacing existing Spire service definition with ${SERVICE_FILE}"
57+
echo -e "${PREFIX_INFO} Replacing existing Spire service definition with ${SERVICE_FILE}"
4358
chmod 644 "${SERVICE_FILE}"
4459
cp "${SERVICE_FILE}" /etc/systemd/system/spire.service
4560
systemctl daemon-reload
@@ -49,7 +64,7 @@ systemctl status spire.service
4964

5065
echo
5166
echo
52-
echo "Replacing existing Spire GitHub service and timer definitions with: ${TOKEN_SERVICE_FILE}, ${TOKEN_TIMER_FILE}"
67+
echo -e "${PREFIX_INFO} Replacing existing Spire GitHub service and timer definitions with: ${TOKEN_SERVICE_FILE}, ${TOKEN_TIMER_FILE}"
5368
chmod 644 "${TOKEN_SERVICE_FILE}" "${TOKEN_TIMER_FILE}"
5469
cp "${TOKEN_SERVICE_FILE}" /etc/systemd/system/spiregithubtoken.service
5570
cp "${TOKEN_TIMER_FILE}" /etc/systemd/system/spiregithubtoken.timer
@@ -60,7 +75,7 @@ systemctl start spiregithubtoken.timer
6075

6176
echo
6277
echo
63-
echo "Replacing existing Spire Humbug tokens synchronization service and timer definitions with: ${HUMBUG_TOKENS_SERVICE_FILE}, ${HUMBUG_TOKENS_TIMER_FILE}"
78+
echo -e "${PREFIX_INFO} Replacing existing Spire Humbug tokens synchronization service and timer definitions with: ${HUMBUG_TOKENS_SERVICE_FILE}, ${HUMBUG_TOKENS_TIMER_FILE}"
6479
chmod 644 "${HUMBUG_TOKENS_SERVICE_FILE}" "${HUMBUG_TOKENS_TIMER_FILE}"
6580
cp "${HUMBUG_TOKENS_SERVICE_FILE}" /etc/systemd/system/spirehumbugtokens.service
6681
cp "${HUMBUG_TOKENS_TIMER_FILE}" /etc/systemd/system/spirehumbugtokens.timer

requirements.txt

-64
This file was deleted.

setup.py

+23-18
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
from spire.version import SPIRE_VERSION
44

5-
MODULE_NAME = "spire"
6-
75
long_description = ""
86
with open("README.md") as ifp:
97
long_description = ifp.read()
108

119
setup(
12-
name=MODULE_NAME,
10+
name="bugout-spire",
1311
version=SPIRE_VERSION,
1412
author="Bugout.dev",
1513
author_email="[email protected]",
@@ -19,34 +17,41 @@
1917
url="https://github.com/bugout-dev/spire",
2018
platforms="all",
2119
classifiers=[
22-
"Development Status :: 2 - Pre-Alpha",
20+
"Development Status :: 3 - Alpha",
2321
"Intended Audience :: Developers",
2422
"Natural Language :: English",
2523
"Programming Language :: Python",
26-
"Programming Language :: Python :: 3",
27-
"Programming Language :: Python :: 3.8",
28-
"Programming Language :: Python :: Implementation :: CPython",
24+
"License :: OSI Approved :: Apache Software License",
2925
"Topic :: Software Development :: Libraries",
30-
"Topic :: Software Development :: Libraries :: Python Modules",
3126
],
3227
python_requires=">=3.6",
3328
packages=find_packages(),
3429
package_data={"bugout": ["py.typed"]},
3530
zip_safe=False,
3631
install_requires=[
37-
"alembic",
38-
"boto3",
39-
"brood @ git+https://[email protected]/bugout-dev/brood.git@d33bb91a8108d02d7509ef25541ff07e31e41680#egg=brood",
40-
"bugout",
41-
"bugout-locust",
32+
"appdirs",
33+
"boto3>=1.20.2",
34+
"bugout>=0.1.18",
35+
"bugout-brood>=0.2.0",
36+
"bugout-locust>=0.2.8",
37+
"cached-property",
38+
"chardet",
4239
"elasticsearch",
43-
"fastapi",
40+
"fastapi>=0.70.0",
4441
"jwt",
45-
"psycopg2-binary",
42+
"httptools",
43+
"multidict",
44+
"psycopg2-binary>=2.9.1",
4645
"pydantic",
46+
"pyjwt",
47+
"redis",
4748
"requests",
48-
"SQLAlchemy",
49-
"uvicorn",
49+
"sqlalchemy>=1.4.26",
50+
"typed-ast",
51+
"uvicorn>=0.15.0",
5052
],
51-
extras_require={"dev": ["black", "mypy"]},
53+
extras_require={
54+
"dev": ["alembic", "black", "isort", "mypy", "types-requests"],
55+
"distribute": ["setuptools", "twine", "wheel"],
56+
},
5257
)

0 commit comments

Comments
 (0)