Skip to content

Commit

Permalink
Merge pull request #2050 from coronasafe/develop
Browse files Browse the repository at this point in the history
Staging release 2 for v24.15.0
  • Loading branch information
gigincg authored Apr 3, 2024
2 parents c249692 + ef53bec commit 03bef57
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 19 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Create Release on Branch Push

on:
push:
branches:
- production

permissions:
contents: write

jobs:
release:
name: Release on Push
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Necessary to fetch all tags

- name: Calculate next tag
id: calc_tag
run: |
YEAR=$(date +"%y")
WEEK=$(date +"%V")
LAST_TAG=$(git tag -l "v$YEAR.$WEEK.*" | sort -V | tail -n1)
LAST_TAG=$(echo "$LAST_TAG" | tr -d '\r' | sed 's/[[:space:]]*$//')
echo "Last Tag: $LAST_TAG"
if [[ $LAST_TAG == "" ]]; then
MINOR=0
else
MINOR=$(echo $LAST_TAG | awk -F '.' '{print $NF}')
echo "Minor Version: $MINOR"
MINOR=$((MINOR + 1))
fi
TAG="v$YEAR.$WEEK.$MINOR"
echo "TAG=$TAG" >> $GITHUB_ENV
echo "Next Tag: $TAG"
- name: Configure git
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Create and push tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git tag -a "$TAG" -m "Release $TAG"
git push origin "$TAG"
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "$TAG" \
--repo="$GITHUB_REPOSITORY" \
--title="$TAG" \
--generate-notes \
--draft
15 changes: 15 additions & 0 deletions care/facility/migrations/0425_merge_20240403_2055.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generated by Django 4.2.10 on 2024-04-03 15:25

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("facility", "0422_alter_facilityinventorylog_quantity_and_more"),
(
"facility",
"0424_remove_patientregistration_age_and_add_patientregistration_death_datetime",
),
]

operations = []
10 changes: 8 additions & 2 deletions docker-compose.local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,21 @@ services:
ports:
- "9000:9000"
- "9876:9876" #debugpy
restart: unless-stopped
depends_on:
- db
- redis
db:
condition: service_started
redis:
condition: service_started
celery:
condition: service_healthy

celery:
image: care_local
env_file:
- ./docker/.local.env
entrypoint: [ "bash", "scripts/celery-dev.sh" ]
restart: unless-stopped
depends_on:
- db
- redis
Expand Down
19 changes: 15 additions & 4 deletions docker-compose.pre-built.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ services:
env_file:
- ./docker/.prebuilt.env
entrypoint: [ "bash", "start-ecs.sh" ]
restart: unless-stopped
depends_on:
- db
- redis
db:
condition: service_started
redis:
condition: service_started
celery-beat:
condition: service_healthy
ports:
- "9000:9000"

Expand All @@ -17,15 +22,21 @@ services:
env_file:
- ./docker/.prebuilt.env
entrypoint: [ "bash", "celery_worker-ecs.sh" ]
restart: unless-stopped
depends_on:
- db
- redis
db:
condition: service_started
redis:
condition: service_started
celery-beat:
condition: service_healthy

celery-beat:
image: "ghcr.io/coronasafe/care:latest"
env_file:
- ./docker/.prebuilt.env
entrypoint: [ "bash", "celery_beat-ecs.sh" ]
restart: unless-stopped
depends_on:
- db
- redis
9 changes: 5 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ networks:
services:
db:
image: postgres:alpine
restart: always
restart: unless-stopped
env_file:
- ./docker/.prebuilt.env
volumes:
- postgres-data:/var/lib/postgresql/data

redis:
image: redis/redis-stack-server:6.2.6-v10
restart: always
restart: unless-stopped
volumes:
- redis-data:/data

localstack:
image: localstack/localstack:latest
restart: unless-stopped
environment:
- AWS_DEFAULT_REGION=ap-south-1
- EDGE_PORT=4566
Expand All @@ -34,8 +35,8 @@ services:
- "4566:4566"

fidelius:
image: khavinshankar/fidelius:v1.0
restart: always
image: khavinshankar/fidelius:latest
restart: unless-stopped

volumes:
postgres-data:
Expand Down
2 changes: 1 addition & 1 deletion docker/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ HEALTHCHECK \
--interval=10s \
--timeout=5s \
--start-period=10s \
--retries=12 \
--retries=24 \
CMD ["/app/scripts/healthcheck.sh"]

WORKDIR /app
2 changes: 1 addition & 1 deletion scripts/celery-dev.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

printf "celery" >> /tmp/container-role
printf "celery" > /tmp/container-role

if [ -z "${DATABASE_URL}" ]; then
export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/celery_beat-ecs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
printf "celery-beat" >> /tmp/container-role
printf "celery-beat" > /tmp/container-role

if [ -z "${DATABASE_URL}" ]; then
export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/celery_beat.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
printf "celery-beat" >> /tmp/container-role
printf "celery-beat" > /tmp/container-role

if [ -z "${DATABASE_URL}" ]; then
export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/celery_worker-ecs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
printf "celery-worker" >> /tmp/container-role
printf "celery-worker" > /tmp/container-role

if [ -z "${DATABASE_URL}" ]; then
export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/celery_worker.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
printf "celery-worker" >> /tmp/container-role
printf "celery-worker" > /tmp/container-role

if [ -z "${DATABASE_URL}" ]; then
export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/start-dev.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

printf "api" >> /tmp/container-role
printf "api" > /tmp/container-role

cd /app

Expand Down
2 changes: 1 addition & 1 deletion scripts/start-ecs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -o errexit
set -o pipefail
set -o nounset

printf "api" >> /tmp/container-role
printf "api" > /tmp/container-role

if [ -z "${DATABASE_URL}" ]; then
export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
Expand Down
2 changes: 1 addition & 1 deletion scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -o errexit
set -o pipefail
set -o nounset

printf "api" >> /tmp/container-role
printf "api" > /tmp/container-role

if [ -z "${DATABASE_URL}" ]; then
export DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
Expand Down

0 comments on commit 03bef57

Please sign in to comment.