chore(build): deploy version 0.2.1
This commit is contained in:
@@ -10,15 +10,15 @@ COPY ./s6 /etc/s6
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN wget -q https://github.com/sqlpage/SQLPage/releases/download/v0.36.1/sqlpage-aws-lambda.zip \
|
||||
&& unzip sqlpage-aws-lambda.zip bootstrap \
|
||||
&& rm sqlpage-aws-lambda.zip
|
||||
|
||||
COPY scripts scripts
|
||||
COPY src src
|
||||
COPY sqlpage sqlpage
|
||||
COPY webroot webroot
|
||||
|
||||
RUN wget -q https://github.com/sqlpage/SQLPage/releases/download/v0.35.2/sqlpage-aws-lambda.zip \
|
||||
&& unzip sqlpage-aws-lambda.zip bootstrap \
|
||||
&& rm sqlpage-aws-lambda.zip
|
||||
|
||||
ENTRYPOINT [ "/usr/bin/s6-svscan", "/etc/s6" ]
|
||||
|
||||
EXPOSE 8080
|
||||
|
2
cmd.txt
2
cmd.txt
@@ -1,6 +1,6 @@
|
||||
. .venv/bin/activate
|
||||
|
||||
export VERSION=0.2.0
|
||||
export VERSION=0.2.1
|
||||
|
||||
docker build -t mobilizon-instances:${VERSION} .
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
services:
|
||||
web:
|
||||
restart: unless-stopped
|
||||
image: mobilizon-instances:0.1.0
|
||||
image: mobilizon-instances:0.2.1
|
||||
environment:
|
||||
SQLPAGE_ENVIRONMENT: production
|
||||
SQLPAGE_WEB_ROOT: /app/webroot
|
||||
|
@@ -12,12 +12,14 @@ logger = logging.getLogger(__name__)
|
||||
UA = 'Mozilla/5.0 (X11; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0'
|
||||
|
||||
def yield_from_joinmbz():
|
||||
# IMPROVE split into Scrapy.Request and callback function
|
||||
# load from jmbz api
|
||||
import requests
|
||||
url = 'https://instances.joinmobilizon.org/api/v1/instances?start=0&count=1000'
|
||||
joinres = requests.get(url, headers={'user-agent': UA}).json().get('data')
|
||||
# load from db
|
||||
with sqlite3.connect(f'{os.environ.get("DATADIR")}/sqlpage.db', timeout=15.0, isolation_level='IMMEDIATE') as db:
|
||||
# IMPROVE do it purely in SQL using conflict clause or where clause
|
||||
rows = db.execute('select rowid, domain from instances').fetchall()
|
||||
max_rowid = max(row[0] for row in rows)
|
||||
domains = {row[1] for row in rows}
|
||||
|
Reference in New Issue
Block a user