Skip to content

Commit

Permalink
Merge pull request #1147 from yogeshojha/release/2.1.0
Browse files Browse the repository at this point in the history
Release/2.1.0
  • Loading branch information
yogeshojha authored Jun 22, 2024
2 parents 9b6ccb3 + 39b9bd9 commit 863ac9c
Show file tree
Hide file tree
Showing 169 changed files with 2,008 additions and 5,106 deletions.
7 changes: 7 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ POSTGRES_HOST=db
#
MAX_CONCURRENCY=80
MIN_CONCURRENCY=10

#
# Rengine web interface super user (for non-interactive install)
#
DJANGO_SUPERUSER_USERNAME=rengine
DJANGO_SUPERUSER_EMAIL=rengine@example.com
DJANGO_SUPERUSER_PASSWORD=Sm7IJG.IfHAFw9snSKv
9 changes: 8 additions & 1 deletion .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ name: 🌄 Build Docker image for pull request

on:
pull_request:
branches: [ master, stable, dev ]
branches:
- master
- release/*

jobs:
build:
name: Build Docker image
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: Checkout the git repo
uses: actions/checkout@v4
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ jobs:
build:
name: Build Docker image
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: Checkout the git repo
uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Thanks to these individuals for making reNgine awesome by fixing bugs, resolving
* [Suprita-25](https://github.com/Suprita-25)
* [TheBinitGhimire](https://github.com/TheBinitGhimire)
* [Vinay Leo](https://github.com/vinaynm)
* [Erdem Ozgen](https://github.com/ErdemOzgen)

*If you have created a Pull request, feel free to add your name here, because we know you are awesome and deserve thanks from the community!*

Expand Down
39 changes: 25 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include .env
.DEFAULT_GOAL:=help

# Credits: https://github.com/sherifabdlnaby/elastdocker/
Expand All @@ -6,55 +7,65 @@
COMPOSE_PREFIX_CMD := COMPOSE_DOCKER_CLI_BUILD=1

COMPOSE_ALL_FILES := -f docker-compose.yml
SERVICES := db web proxy redis celery celery-beat
SERVICES := db web proxy redis celery celery-beat ollama

# --------------------------

.PHONY: setup certs up build username pull down stop restart rm logs

certs: ## Generate certificates.
@${COMPOSE_PREFIX_CMD} docker-compose -f docker-compose.setup.yml run --rm certs
@${COMPOSE_PREFIX_CMD} docker compose -f docker-compose.setup.yml run --rm certs

setup: ## Generate certificates.
@make certs

up: ## Build and start all services.
${COMPOSE_PREFIX_CMD} docker-compose ${COMPOSE_ALL_FILES} up -d --build ${SERVICES}
${COMPOSE_PREFIX_CMD} docker compose ${COMPOSE_ALL_FILES} up -d --build ${SERVICES}

build: ## Build all services.
${COMPOSE_PREFIX_CMD} docker-compose ${COMPOSE_ALL_FILES} build ${SERVICES}
${COMPOSE_PREFIX_CMD} docker compose ${COMPOSE_ALL_FILES} build ${SERVICES}

username: ## Generate Username (Use only after make up).
${COMPOSE_PREFIX_CMD} docker-compose ${COMPOSE_ALL_FILES} exec web python3 manage.py createsuperuser
ifeq ($(isNonInteractive), true)
${COMPOSE_PREFIX_CMD} docker compose ${COMPOSE_ALL_FILES} exec web python3 manage.py createsuperuser --username ${DJANGO_SUPERUSER_USERNAME} --email ${DJANGO_SUPERUSER_EMAIL} --noinput
else
${COMPOSE_PREFIX_CMD} docker compose ${COMPOSE_ALL_FILES} exec web python3 manage.py createsuperuser
endif

changepassword: ## Change password for user
${COMPOSE_PREFIX_CMD} docker compose ${COMPOSE_ALL_FILES} exec web python3 manage.py changepassword

migrate: ## Apply migrations
${COMPOSE_PREFIX_CMD} docker compose ${COMPOSE_ALL_FILES} exec web python3 manage.py migrate

pull: ## Pull Docker images.
docker login docker.pkg.github.com
${COMPOSE_PREFIX_CMD} docker-compose ${COMPOSE_ALL_FILES} pull
${COMPOSE_PREFIX_CMD} docker compose ${COMPOSE_ALL_FILES} pull

down: ## Down all services.
${COMPOSE_PREFIX_CMD} docker-compose ${COMPOSE_ALL_FILES} down
${COMPOSE_PREFIX_CMD} docker compose ${COMPOSE_ALL_FILES} down

stop: ## Stop all services.
${COMPOSE_PREFIX_CMD} docker-compose ${COMPOSE_ALL_FILES} stop ${SERVICES}
${COMPOSE_PREFIX_CMD} docker compose ${COMPOSE_ALL_FILES} stop ${SERVICES}

restart: ## Restart all services.
${COMPOSE_PREFIX_CMD} docker-compose ${COMPOSE_ALL_FILES} restart ${SERVICES}
${COMPOSE_PREFIX_CMD} docker compose ${COMPOSE_ALL_FILES} restart ${SERVICES}

rm: ## Remove all services containers.
${COMPOSE_PREFIX_CMD} docker-compose $(COMPOSE_ALL_FILES) rm -f ${SERVICES}
${COMPOSE_PREFIX_CMD} docker compose $(COMPOSE_ALL_FILES) rm -f ${SERVICES}

test:
${COMPOSE_PREFIX_CMD} docker-compose $(COMPOSE_ALL_FILES) exec celery python3 -m unittest tests/test_scan.py
${COMPOSE_PREFIX_CMD} docker compose $(COMPOSE_ALL_FILES) exec celery python3 -m unittest tests/test_scan.py

logs: ## Tail all logs with -n 1000.
${COMPOSE_PREFIX_CMD} docker-compose $(COMPOSE_ALL_FILES) logs --follow --tail=1000 ${SERVICES}
${COMPOSE_PREFIX_CMD} docker compose $(COMPOSE_ALL_FILES) logs --follow --tail=1000 ${SERVICES}

images: ## Show all Docker images.
${COMPOSE_PREFIX_CMD} docker-compose $(COMPOSE_ALL_FILES) images ${SERVICES}
${COMPOSE_PREFIX_CMD} docker compose $(COMPOSE_ALL_FILES) images ${SERVICES}

prune: ## Remove containers and delete volume data.
@make stop && make rm && docker volume prune -f

help: ## Show this help.
@echo "Make application docker images and manage containers using docker-compose files."
@echo "Make application Docker images and manage containers using Docker Compose files."
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m (default: help)\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-12s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
Loading

0 comments on commit 863ac9c

Please sign in to comment.