Skip to content

Commit

Permalink
Update java to 17, signal-cli to v0.11.7 (#91)
Browse files Browse the repository at this point in the history
* Update java to 17, signal-cli to v0.11.7

* Add some new just recipes, update python version in actions

* Update pre-commit version

* Bump isort version
  • Loading branch information
AetherUnbound authored Apr 3, 2023
1 parent 310dcd7 commit 1beb165
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.11
- name: Install Dependencies
run: pip install pre-commit
- name: Run static checks
Expand All @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.11
- name: Install Dependencies
run: pip install pytest pytest-cov
- name: Test with pytest
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ repos:
- id: python-no-log-warn

- repo: https://github.com/PyCQA/isort
rev: 5.9.1
rev: 5.12.0
hooks:
- id: isort
name: Run isort to sort imports
Expand Down
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
FROM python:3.8-slim
FROM python:3.11-slim

ENV JDK_VERSION=17 \
SIGNAL_CLI_VERSION=0.11.7

ENV PIP_NO_CACHE_DIR=1 \
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/ \
PYTHONPATH=/app \
SIGNAL_CLI_VERSION=0.9.1
JAVA_HOME=/usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/

# Install OpenJDK-8
RUN apt-get update && \
mkdir -p /usr/share/man/man1 && \
apt-get install -y \
default-jre \
openjdk-${JDK_VERSION}-jdk \
openjdk-${JDK_VERSION}-jre \
wget \
ca-certificates-java \
dos2unix && \
Expand All @@ -18,8 +21,8 @@ RUN apt-get update && \

# Install signal-cli
WORKDIR /tmp
RUN wget -q https://github.com/AsamK/signal-cli/releases/download/v${SIGNAL_CLI_VERSION}/signal-cli-${SIGNAL_CLI_VERSION}.tar.gz && \
tar xf /tmp/signal-cli-${SIGNAL_CLI_VERSION}.tar.gz -C /opt && \
RUN wget -q https://github.com/AsamK/signal-cli/releases/download/v${SIGNAL_CLI_VERSION}/signal-cli-${SIGNAL_CLI_VERSION}-Linux.tar.gz && \
tar xf /tmp/signal-cli-${SIGNAL_CLI_VERSION}-Linux.tar.gz -C /opt && \
ln -sf /opt/signal-cli-${SIGNAL_CLI_VERSION}/bin/signal-cli /usr/local/bin/

WORKDIR /app
Expand Down
13 changes: 12 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ COMPOSE_FILE := "--file=docker-compose.yml" + (
)
DC := "docker-compose " + COMPOSE_FILE
RUN := "run --rm cli"
# Force just to hand down positional arguments so quoted arguments with spaces are
# handled appropriately
set positional-arguments


# Show all available recipes
Expand All @@ -27,6 +30,14 @@ down:
pull:
{{ DC }} pull

# Attach logs to all (or the specified) services
logs *args:
{{ DC }} logs -f {{ args }}

# Run a command on a provided service
run *args:
{{ DC }} {{ RUN }} "$@"

# Verify all numbers
verify:
{{ DC }} {{ RUN }} signal-scanner-bot-verify
Expand All @@ -36,5 +47,5 @@ register:
{{ DC }} {{ RUN }} ./register-number.sh

# Static checks
static:
lint:
pre-commit run --all-files
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ aiohttp>=3.7.4
backoff>=1.11.1
Click==7.1.2
peony-twitter==2.0.2
pre-commit==2.9.0
pre-commit==3.2.1
python-dotenv==0.19.2
pytz>=2021.3
requests==2.26.0
tweepy==3.9.0
ujson==3.1.0
ujson==5.7.0
urllib3==1.26.5

0 comments on commit 1beb165

Please sign in to comment.