forked from AFPy/afpy.org
We're no longer using github workflow.
This commit is contained in:
parent
ee450a9e4a
commit
e22f9eecd2
29
.github/workflows/deploy.yml
vendored
29
.github/workflows/deploy.yml
vendored
|
@ -1,29 +0,0 @@
|
||||||
---
|
|
||||||
|
|
||||||
name: Publish
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [master]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- name: Deploy
|
|
||||||
env:
|
|
||||||
deploy_key: ${{secrets.deploy_key}}
|
|
||||||
known_hosts: ${{secrets.known_hosts}}
|
|
||||||
run: |
|
|
||||||
mkdir -p ${HOME}/.ssh
|
|
||||||
printf "%s\n" "$known_hosts" > ${HOME}/.ssh/known_hosts
|
|
||||||
printf "%s\n" "$deploy_key" > ${HOME}/.ssh/id_ed25519
|
|
||||||
chmod 600 ${HOME}/.ssh/id_ed25519
|
|
||||||
eval $(ssh-agent)
|
|
||||||
ssh-add
|
|
||||||
rsync -a ./ afpy-org@deb2.afpy.org:/home/afpy-org/src/
|
|
||||||
ssh afpy-org@deb2.afpy.org /home/afpy-org/venv/bin/python -m pip install --upgrade setuptools wheel pip
|
|
||||||
ssh afpy-org@deb2.afpy.org /home/afpy-org/venv/bin/python -m pip install -r /home/afpy-org/src/requirements.txt
|
|
||||||
ssh afpy-org@deb2.afpy.org /home/afpy-org/venv/bin/python -m pip install sentry-sdk[flask]
|
|
||||||
ssh afpy-org@deb2.afpy.org sudo systemctl restart afpy-org.service
|
|
31
.github/workflows/test.yml
vendored
31
.github/workflows/test.yml
vendored
|
@ -1,31 +0,0 @@
|
||||||
---
|
|
||||||
|
|
||||||
name: Tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build_ubuntu:
|
|
||||||
name: Tests
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: 3.7 # As on deb.afpy.org
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
venv
|
|
||||||
key: ${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
|
|
||||||
- name: Test
|
|
||||||
run: |
|
|
||||||
python --version
|
|
||||||
make install
|
|
||||||
make test
|
|
18
Makefile
18
Makefile
|
@ -5,22 +5,38 @@ FLASK = $(VENV)/bin/flask
|
||||||
ISORT = $(VENV)/bin/isort
|
ISORT = $(VENV)/bin/isort
|
||||||
BLACK = $(VENV)/bin/black
|
BLACK = $(VENV)/bin/black
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
all: install serve
|
all: install serve
|
||||||
|
|
||||||
|
.PHONY: install
|
||||||
install:
|
install:
|
||||||
test -d $(VENV) || python3 -m venv $(VENV)
|
test -d $(VENV) || python3 -m venv $(VENV)
|
||||||
$(PIP) install --upgrade --no-cache pip setuptools -r requirements.txt -r requirements-dev.txt
|
$(PIP) install --upgrade --no-cache pip setuptools -r requirements.txt -r requirements-dev.txt
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -fr $(VENV)
|
rm -fr $(VENV)
|
||||||
|
|
||||||
|
.PHONY: check-outdated
|
||||||
check-outdated:
|
check-outdated:
|
||||||
$(PIP) list --outdated --format=columns
|
$(PIP) list --outdated --format=columns
|
||||||
|
|
||||||
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
$(PYTHON) -m pytest tests.py afpy/ --flake8 --black --cov=afpy --cov=tests --cov-report=term-missing
|
$(PYTHON) -m pytest tests.py afpy/ --flake8 --black --cov=afpy --cov=tests --cov-report=term-missing
|
||||||
|
|
||||||
|
.PHONY: serve
|
||||||
serve:
|
serve:
|
||||||
$(PYTHON) run.py
|
$(PYTHON) run.py
|
||||||
|
|
||||||
.PHONY: all install clean check-outdated test serve
|
.PHONY: publish
|
||||||
|
publish:
|
||||||
|
# To get the right to publish, add your public key in the nginx_public_deploy_key here:
|
||||||
|
# https://git.afpy.org/AFPy/infra/src/branch/main/afpy.org.yml
|
||||||
|
rsync -a ./ afpy-org@deb2.afpy.org:/home/afpy-org/src/
|
||||||
|
ssh afpy-org@deb2.afpy.org '\
|
||||||
|
/home/afpy-org/venv/bin/python -m pip install --upgrade setuptools wheel pip; \
|
||||||
|
/home/afpy-org/venv/bin/python -m pip install -r /home/afpy-org/src/requirements.txt; \
|
||||||
|
/home/afpy-org/venv/bin/python -m pip install sentry-sdk[flask]; \
|
||||||
|
sudo systemctl restart afpy-org.service; \
|
||||||
|
'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user