Skip to content

Commit

Permalink
Migrate from make to just
Browse files Browse the repository at this point in the history
  • Loading branch information
relud committed Nov 13, 2024
1 parent 9b92f64 commit 3a387ec
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 185 deletions.
8 changes: 0 additions & 8 deletions .env

This file was deleted.

11 changes: 6 additions & 5 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,23 @@ jobs:
"$GITHUB_REF_NAME" \
"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" > version.json
- name: Install just
uses: extractions/setup-just@v2
- name: Output version.json
run: cat version.json
- name: Build Docker images
run: |
make build
just build
docker compose images
- name: Verify requirements.txt contains correct dependencies
run: |
docker run --rm local/socorro_app shell ./bin/verify_reqs.sh
just shell ./bin/verify_reqs.sh
- name: Run lint check
run: |
docker run --rm local/socorro_app shell ./bin/lint.sh
just lint
- name: Run tests
run: |
make my.env
docker compose run --rm test-ci shell ./bin/test.sh
just test-ci
- name: Set Docker image tag to "latest" for updates of the main branch
if: github.ref == 'refs/heads/main'
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ symbols/
.devcontainer-build
.cache/
docker-compose.override.yml
my.env
.env

# docs things
docs/_build/
158 changes: 0 additions & 158 deletions Makefile

This file was deleted.

11 changes: 9 additions & 2 deletions bin/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,18 @@ FILES="socorro-cmd docker socorro webapp bin"
PYTHON_VERSION=$(python --version)


if [[ "${1:-}" == "--fix" ]]; then
if [[ "${1:-}" == "--help" ]]; then
echo "Usage: $0 [OPTIONS]"
echo
echo " Lint code"
echo
echo "Options:"
echo " --help Show this message and exit."
echo " --fix Reformat code."
elif [[ "${1:-}" == "--fix" ]]; then
echo ">>> ruff fix (${PYTHON_VERSION})"
ruff format $FILES
ruff check --fix $FILES

else
echo ">>> ruff (${PYTHON_VERSION})"
ruff check $FILES
Expand Down
28 changes: 19 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
---
# Sets the base name for containers and networks for docker-compose to
# "socorro_". This is normally set by the name of this directory, but
# if you clone the repository with a different directory name, then
# you end up with a different project name and then everything is hosed.
# Setting it here fixes that.
name: socorro

services:
# Socorro app image
app:
build:
context: .
dockerfile: docker/Dockerfile
args:
userid: ${USE_UID:-10001}
groupid: ${USE_GID:-10001}
image: local/socorro_app
env_file:
- docker/config/local_dev.env
- my.env
- .env
depends_on:
- fakesentry
- statsd
Expand Down Expand Up @@ -65,7 +75,7 @@ services:
env_file:
- docker/config/local_dev.env
- docker/config/test.env
- my.env
- .env
depends_on:
- fakesentry
- statsd
Expand All @@ -81,7 +91,7 @@ services:
image: local/socorro_app
env_file:
- docker/config/local_dev.env
- my.env
- .env
depends_on:
- fakesentry
- statsd
Expand All @@ -98,7 +108,7 @@ services:
image: local/socorro_app
env_file:
- docker/config/local_dev.env
- my.env
- .env
depends_on:
- fakesentry
- statsd
Expand All @@ -113,7 +123,7 @@ services:
image: local/socorro_app
env_file:
- docker/config/local_dev.env
- my.env
- .env
depends_on:
- fakesentry
- statsd
Expand All @@ -134,7 +144,7 @@ services:
image: local/socorro_app
env_file:
- docker/config/local_dev.env
- my.env
- .env
depends_on:
- fakesentry
- gcs-emulator
Expand Down Expand Up @@ -178,7 +188,7 @@ services:
image: mozilla/socorro_collector:latest
env_file:
- docker/config/local_dev.env
- my.env
- .env
depends_on:
- gcs-emulator
- pubsub
Expand All @@ -194,7 +204,7 @@ services:
image: local/socorro_app
env_file:
- docker/config/local_dev.env
- my.env
- .env
command: ["fakecollector"]
ports:
- "9000:8000"
Expand All @@ -205,7 +215,7 @@ services:
image: local/socorro_app
env_file:
- docker/config/local_dev.env
- my.env
- .env
command: ["symbolsserver"]
stop_signal: SIGINT
ports:
Expand Down
6 changes: 4 additions & 2 deletions docker/config/my.env.dist → docker/config/.env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
# environment. Since these are specific to your local development environment,
# don't check them in.

PYTHONUNBUFFERED=true

# ---------------------------------------------
# Docker settings
# ---------------------------------------------

# If you want to set the uid and gid of the app user that we use in the
# containers, you can do that with these two variables.
# SOCORRO_UID=
# SOCORRO_GID=
# USE_UID=
# USE_GID=

# ---------------------------------------------
# processor settings
Expand Down
Loading

0 comments on commit 3a387ec

Please sign in to comment.