Skip to content

Commit

Permalink
Merge branch '116-frontend-add-unit-testing-for-frontend' into help-page
Browse files Browse the repository at this point in the history
  • Loading branch information
kristo-baricevic authored Apr 12, 2024
2 parents ed6eddb + 72c1c69 commit b6ea4cc
Show file tree
Hide file tree
Showing 9,192 changed files with 1,686,589 additions and 1,001 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
125 changes: 0 additions & 125 deletions .github/workflows/containers-publish.yml
Original file line number Diff line number Diff line change
@@ -1,125 +0,0 @@
<<<<<<< HEAD
name: 'Containers: Publish'

on:
push:
tags: [ 'v*' ]
=======
name: "Containers: Publish"

on:
push:
tags: ["v*"]
>>>>>>> 5d9968afe8f5ab373ab0379485cea79ba3253193

permissions:
packages: write

jobs:
release-containers:
name: Build and Push
runs-on: ubuntu-latest
steps:
<<<<<<< HEAD

- uses: actions/checkout@v3

- name: Login to ghcr.io Docker registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Compute Docker container image addresses
run: |
DOCKER_REPOSITORY="ghcr.io/${GITHUB_REPOSITORY,,}"
DOCKER_TAG="${GITHUB_REF:11}"
echo "DOCKER_REPOSITORY=${DOCKER_REPOSITORY}" >> $GITHUB_ENV
echo "DOCKER_TAG=${DOCKER_TAG}" >> $GITHUB_ENV
echo "Using: ${DOCKER_REPOSITORY}/*:${DOCKER_TAG}"
# - name: 'Pull previous Docker container image: :latest'
# run: docker pull "${DOCKER_REPOSITORY}:latest" || true

- name: 'Pull previous Docker container image: frontend-static:latest'
run: docker pull "${DOCKER_REPOSITORY}/frontend-static:latest" || true

- name: 'Build Docker container image: frontend-static:latest'
run: |
docker build \
--cache-from "${DOCKER_REPOSITORY}/frontend-static:latest" \
--file frontend/Dockerfile.demo \
--build-arg SERVER_NAME=localhost \
--tag "${DOCKER_REPOSITORY}/frontend-static:latest" \
--tag "${DOCKER_REPOSITORY}/frontend-static:${DOCKER_TAG}" \
frontend
- name: 'Push Docker container image frontend-static:latest'
run: docker push "${DOCKER_REPOSITORY}/frontend-static:latest"

- name: 'Push Docker container image frontend-static:v*'
run: docker push "${DOCKER_REPOSITORY}/frontend-static:${DOCKER_TAG}"
=======
- uses: actions/checkout@v3

- name: Login to ghcr.io Docker registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Compute Docker container image addresses
run: |
DOCKER_REPOSITORY="ghcr.io/${GITHUB_REPOSITORY,,}"
DOCKER_TAG="${GITHUB_REF:11}"
echo "DOCKER_REPOSITORY=${DOCKER_REPOSITORY}" >> $GITHUB_ENV
echo "DOCKER_TAG=${DOCKER_TAG}" >> $GITHUB_ENV
echo "Using: ${DOCKER_REPOSITORY}/*:${DOCKER_TAG}"
# - name: 'Pull previous Docker container image: :latest'
# run: docker pull "${DOCKER_REPOSITORY}:latest" || true

- name: "Pull previous Docker container image: frontend-static:latest"
run: docker pull "${DOCKER_REPOSITORY}/frontend-static:latest" || true

- name: "Build Docker container image: frontend-static:latest"
run: |
docker build \
--cache-from "${DOCKER_REPOSITORY}/frontend-static:latest" \
--file frontend/Dockerfile.demo \
--build-arg SERVER_NAME=localhost \
--tag "${DOCKER_REPOSITORY}/frontend-static:latest" \
--tag "${DOCKER_REPOSITORY}/frontend-static:${DOCKER_TAG}" \
frontend
- name: "Push Docker container image frontend-static:latest"
run: docker push "${DOCKER_REPOSITORY}/frontend-static:latest"

- name: "Push Docker container image frontend-static:v*"
run: docker push "${DOCKER_REPOSITORY}/frontend-static:${DOCKER_TAG}"
>>>>>>> 5d9968afe8f5ab373ab0379485cea79ba3253193
#
#
# - name: 'Build Docker container image: backend:latest'
# run: |
# cd backend && \
# make && \
# docker image tag "${DOCKER_REPOSITORY}/backend/local:latest" "${DOCKER_REPOSITORY}/backend:latest"
#
# - name: Push Docker container image backend:latest
# run: docker push "${DOCKER_REPOSITORY}/backend:latest"
#
# - name: Push Docker container image backend:v*
# run: docker push "${DOCKER_REPOSITORY}/backend:${DOCKER_TAG}"

<<<<<<< HEAD
# - name: Push Docker container image :v*"
# run: docker push "${DOCKER_REPOSITORY}:${DOCKER_TAG}"
=======
# - name: Push Docker container image :v*"
# run: docker push "${DOCKER_REPOSITORY}:${DOCKER_TAG}"
>>>>>>> 5d9968afe8f5ab373ab0379485cea79ba3253193
37 changes: 0 additions & 37 deletions .github/workflows/release-prepare.yml
Original file line number Diff line number Diff line change
@@ -1,37 +0,0 @@
<<<<<<< HEAD
name: 'Release: Prepare PR'

on:
push:
branches: [ develop ]
=======
name: "Release: Prepare PR"

on:
push:
branches: [develop]
>>>>>>> 5d9968afe8f5ab373ab0379485cea79ba3253193

permissions:
contents: read
pull-requests: write

jobs:
release-prepare:
<<<<<<< HEAD

runs-on: ubuntu-latest
steps:

- uses: JarvusInnovations/infra-components@channels/github-actions/release-prepare/latest
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
release-branch: main
=======
runs-on: ubuntu-latest
steps:
- uses: JarvusInnovations/infra-components@channels/github-actions/release-prepare/latest
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
release-branch: main
>>>>>>> 5d9968afe8f5ab373ab0379485cea79ba3253193
33 changes: 0 additions & 33 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
@@ -1,33 +0,0 @@
<<<<<<< HEAD
name: 'Release: Publish PR'

on:
pull_request:
branches: [ main ]
types: [ closed ]

jobs:
release-publish:

runs-on: ubuntu-latest
steps:

- uses: JarvusInnovations/infra-components@channels/github-actions/release-publish/latest
with:
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
=======
name: "Release: Publish PR"

on:
pull_request:
branches: [main]
types: [closed]

jobs:
release-publish:
runs-on: ubuntu-latest
steps:
- uses: JarvusInnovations/infra-components@channels/github-actions/release-publish/latest
with:
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
>>>>>>> 5d9968afe8f5ab373ab0379485cea79ba3253193
33 changes: 0 additions & 33 deletions .github/workflows/release-validate.yml
Original file line number Diff line number Diff line change
@@ -1,33 +0,0 @@
<<<<<<< HEAD
name: 'Release: Validate PR'

on:
pull_request:
branches: [ main ]
types: [ opened, edited, reopened, synchronize ]

jobs:
release-validate:

runs-on: ubuntu-latest
steps:

- uses: JarvusInnovations/infra-components@channels/github-actions/release-validate/latest
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
=======
name: "Release: Validate PR"

on:
pull_request:
branches: [main]
types: [opened, edited, reopened, synchronize]

jobs:
release-validate:
runs-on: ubuntu-latest
steps:
- uses: JarvusInnovations/infra-components@channels/github-actions/release-validate/latest
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
>>>>>>> 5d9968afe8f5ab373ab0379485cea79ba3253193
58 changes: 0 additions & 58 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,58 +0,0 @@
<<<<<<< HEAD:Dockerfile.prod
# This image runs the production server, with nginx
###########
# BUILDER #
###########

# pull official base image
FROM python:3.11.4-slim-buster as python_builder
=======
# pull official base image
FROM python:3.11.4-slim-buster

>>>>>>> 5d9968afe8f5ab373ab0379485cea79ba3253193:server/Dockerfile.prod

# set work directory
WORKDIR /usr/src/app

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# install system dependencies
RUN apt-get update && apt-get install -y netcat

# install dependencies
<<<<<<< HEAD:Dockerfile.prod
RUN apt-get update && apt-get install -y --no-install-recommends netcat
COPY --from=python_builder /usr/src/app/wheels /wheels
COPY --from=python_builder /usr/src/app/requirements.txt .
=======
>>>>>>> 5d9968afe8f5ab373ab0379485cea79ba3253193:server/Dockerfile.prod
RUN pip install --upgrade pip
COPY ./requirements.txt .
RUN pip install -r requirements.txt

# copy project
COPY . /usr/src/app

# Correct line endings in entrypoint.sh and make it executable
RUN sed -i 's/\r$//' entrypoint.sh && chmod +x entrypoint.sh

# run entrypoint.sh
ENTRYPOINT ["./entrypoint.prod.sh"]

<<<<<<< HEAD:Dockerfile.prod
# run entrypoint.prod.sh
<<<<<<< HEAD:Dockerfile.prod
ENTRYPOINT ["/home/app/web/entrypoint.prod.sh"]


# TODO: gunicorn stuff
=======
ENTRYPOINT ["/home/app/web/entrypoint.prod.sh"]
>>>>>>> ac68347c12ced724206112843623ee8c515bd3ad:server/Dockerfile.prod
=======
# Default command to run on container start
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000", "--noreload"]
>>>>>>> 5d9968afe8f5ab373ab0379485cea79ba3253193:server/Dockerfile.prod
8 changes: 8 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
'@babel/preset-react',
],
};

83 changes: 0 additions & 83 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1 @@
version: '3.8'
services:
db:
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=balancer
- POSTGRES_PASSWORD=balancer
- POSTGRES_DB=balancer_dev
ports:
- "5432:5432"
networks:
app_net:
ipv4_address: 192.168.0.2
# pgadmin:
# container_name: pgadmin4
# image: dpage/pgadmin4
# environment:
# PGADMIN_DEFAULT_EMAIL: [email protected]
# PGADMIN_DEFAULT_PASSWORD: balancer
# # PGADMIN_LISTEN_PORT = 80
# # volumes:
# # - ./pgadmin-data:/var/lib/pgadmin
# # # PGADMIN_LISTEN_PORT = 80
# ports:
# - "5050:80"
# networks:
# app_net:
# ipv4_address: 192.168.0.4
backend:
image: balancer-backend
build: ./server
<<<<<<< HEAD:docker-compose.dev.yml
<<<<<<< HEAD:docker-compose.dev.yml
command: python manage.py runserver 0.0.0.0:8000
volumes:
- ./server:/usr/src/app
=======
>>>>>>> ed1b2e3bc80a77cb1283844d0c153fa1f79d9d76:docker-compose.yml
=======
command: python manage.py runserver 0.0.0.0:8000
>>>>>>> 5d9968afe8f5ab373ab0379485cea79ba3253193:docker-compose.yml
ports:
- "8000:8000"
env_file:
- ./config/env/env.dev
depends_on:
- db
volumes:
- ./server:/usr/src/server
networks:
app_net:
ipv4_address: 192.168.0.3
frontend:
image: balancer-frontend
build:
context: frontend
dockerfile: Dockerfile.dev
args:
- IMAGE_NAME=balancer-frontend
- FRONTEND_VERSION=0.0.1
ports:
- "3000:3000"
environment:
- CHOKIDAR_USEPOLLING=true
# - VITE_API_BASE_URL=https://balancertestsite.com/
volumes:
- "./frontend:/usr/src/app:delegated"
- "/usr/src/app/node_modules/"
depends_on:
- backend
networks:
app_net:
ipv4_address: 192.168.0.5
volumes:
postgres_data:
networks:
app_net:
ipam:
driver: default
config:
- subnet: "192.168.0.0/24"
gateway: 192.168.0.1
Loading

0 comments on commit b6ea4cc

Please sign in to comment.