Skip to content

Commit

Permalink
specific configurations for osmit-tm4
Browse files Browse the repository at this point in the history
add osmit build
  • Loading branch information
nicokant committed May 11, 2023
1 parent f415dd9 commit ed6626e
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 4 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/osmit-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches:
- osm-ita
tags:
- v*

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Set output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: 'Build Backend Image'
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
docker build . -f ./scripts/docker/Dockerfile.backend --tag ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-backend:$GITHUB_SHA --tag ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-backend:$RELEASE_VERSION
docker push ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-backend:$GITHUB_SHA
docker push ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-backend:$RELEASE_VERSION
- name: 'Build Frontend Image'
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
FRONTEND_ENV: ${{ vars.FRONTEND_ENV }}
run: |
echo "$FRONTEND_ENV" > tasking-manager.env
docker build . -f ./scripts/docker/Dockerfile.frontend --tag ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-frontend:$GITHUB_SHA --tag ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-frontend:$RELEASE_VERSION
docker push ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-frontend:$GITHUB_SHA
docker push ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-frontend:$RELEASE_VERSION
3 changes: 3 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ services:
<<: *backend
volumes:
- .:/usr/src/app
labels:
- traefik.http.routers.backend.rule=Host(`localhost`) && PathPrefix(`/api/`)
- traefik.http.services.backend.loadbalancer.server.port=5000

# Migration service
migration:
Expand Down
10 changes: 6 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
version: "3.4"

x-backend-config: &backend
image: hotosm-tasking-manager:backend
image: ghcr.io/osmitalia/osmit-tm-backend:v4.5.4-osmit
env_file: ${ENV_FILE:-tasking-manager.env}
depends_on:
- postgresql
Expand All @@ -18,7 +18,7 @@ services:
container_name: backend
restart: always
labels:
- traefik.http.routers.backend.rule=Host(`localhost`) && PathPrefix(`/api/`)
- traefik.http.routers.backend.rule=Host(`osmit-tm4.wmcloud.org`) && PathPrefix(`/api/`)
- traefik.http.services.backend.loadbalancer.server.port=5000

migration:
Expand All @@ -28,12 +28,12 @@ services:
command: python manage.py db upgrade

frontend:
image: hotosm-tasking-manager:frontend
image: ghcr.io/osmitalia/osmit-tm-frontend:v4.5.4-osmit
restart: always
networks:
- tm-web
labels:
- traefik.http.routers.frontend.rule=Host(`localhost`)
- traefik.http.routers.frontend.rule=Host(`osmit-tm4.wmcloud.org`)
- traefik.http.services.frontend.loadbalancer.server.port=80

postgresql:
Expand All @@ -43,6 +43,8 @@ services:
env_file: ${ENV_FILE:-tasking-manager.env}
networks:
- tm-web
volumes:
- /srv/postgresql:/var/lib/postgresql/data

traefik:
image: traefik:v2.3
Expand Down

0 comments on commit ed6626e

Please sign in to comment.