Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Deployment Backend #157

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions .github/workflows/backend-tests-database-blob.yml

This file was deleted.

This file was deleted.

66 changes: 66 additions & 0 deletions .github/workflows/deployment-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Docker Deployment Test

on:
pull_request:
branches:
- 'master'
- 'master-*'

jobs:
build:
runs-on: ubuntu-22.04

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Docker prerequisites
run: |
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release

- name: Install Docker dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
software-properties-common

- name: Add Docker GPG key
run: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

- name: Set up Docker repository
run: |
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

- name: Install Docker
run: |
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo systemctl enable docker

- name: Build Docker image
working-directory: Backend/
run: |
docker build -t spotify_electron_backend_image .
docker run -d --name spotify_electron_backend -e MONGO_URI=mongodb://root:root@localhost:27017/ -e SECRET_KEY_SIGN=f24e2f3ac557d487b6d879fb2d86f2b2 -e SERVERLESS_FUNCTION_URL=url -e ARCH=BLOB -e ENV_VALUE=c -p 8000:8000 spotify_electron_backend_image

- name: Wait for container to start
run: sleep 20s

- name: Check container health
run: |
status=$(curl -o /dev/null -s -w '%{http_code}' http://127.0.0.1:8000/health)
if [[ $status -eq 200 ]]; then
echo "Health check successful"
else
echo "Health check failed with status code $status"
exit 1
fi
26 changes: 0 additions & 26 deletions .github/workflows/eslintrc-check.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/frontend-style-prettier.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/frontend-tests.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/generate-docs.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/ruff-format-check.yml

This file was deleted.

12 changes: 0 additions & 12 deletions .github/workflows/ruff-lint-check.yml

This file was deleted.

1 change: 1 addition & 0 deletions Backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ COPY ./app /code/app

WORKDIR /code/
CMD ["python", "-m", "app"]
EXPOSE 8000
#CMD ["tail", "-f", "/dev/null"]

#docker build -t spotify_electron_backend_image .
Expand Down
Loading