Skip to content

Commit

Permalink
run pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-nork committed Jul 12, 2023
1 parent 26b4f27 commit a126515
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 49 deletions.
31 changes: 15 additions & 16 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
{
"name": "Python 3",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"features": {
"ghcr.io/devcontainers-contrib/features/rabbitmq-asdf:1": {
"version": "latest",
"erlangVersion": "latest"
},
"ghcr.io/devcontainers-contrib/features/vault-asdf:2": {
"version": "latest"
}
{
"name": "Python 3",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"features": {
"ghcr.io/devcontainers-contrib/features/rabbitmq-asdf:1": {
"version": "latest",
"erlangVersion": "latest"
},
"ghcr.io/devcontainers-contrib/features/vault-asdf:2": {
"version": "latest"
}
},
"postCreateCommand": "sudo curl -L 'https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)' -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose"
// "remoteUser": "vscode"
}
}
48 changes: 24 additions & 24 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
version: '3.8'
services:
app:
image: mcr.microsoft.com/devcontainers/python:0-3.11
volumes:
- ..:/workspace:cached
command: sleep infinity
networks:
default:
aliases:
- localhost
redis:
image: redis/redis-stack:latest
ports:
- 6379:6379
networks:
default:
aliases:
- localhost
networks:
default:
version: '3.8'

services:
app:
image: mcr.microsoft.com/devcontainers/python:0-3.11
volumes:
- ..:/workspace:cached
command: sleep infinity
networks:
default:
aliases:
- localhost

redis:
image: redis/redis-stack:latest
ports:
- 6379:6379
networks:
default:
aliases:
- localhost

networks:
default:
17 changes: 8 additions & 9 deletions chirps/base_app/management/commands/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ def add_arguments(self, parser):
parser.add_argument('--stop', action='store_true', help='Stop redis server')
parser.add_argument('--status', action='store_true', help='Check redis server status')

def handle(self, *args, **options):
"""Handle redis command"""
if options['start']:
os.system('docker-compose -f /workspace/.devcontainer/docker-compose.yml up -d redis')
elif options['stop']:
os.system('docker-compose -f /workspace/.devcontainer/docker-compose.yml down')
elif options['status']:
os.system('docker-compose -f /workspace/.devcontainer/docker-compose.yml ps')

def handle(self, *args, **options):
"""Handle redis command"""
if options['start']:
os.system('docker-compose -f /workspace/.devcontainer/docker-compose.yml up -d redis')
elif options['stop']:
os.system('docker-compose -f /workspace/.devcontainer/docker-compose.yml down')
elif options['status']:
os.system('docker-compose -f /workspace/.devcontainer/docker-compose.yml ps')

0 comments on commit a126515

Please sign in to comment.