Skip to content

Commit

Permalink
Merge pull request #176 from cuappdev/migrate-dev-server
Browse files Browse the repository at this point in the history
Moved migration execution to dev server
  • Loading branch information
JoshD94 authored Nov 20, 2024
2 parents 521c580 + 1a62c98 commit 18ee9d9
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 130 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ jobs:
file: ./Dockerfile
push: true
tags: cornellappdev/uplift-dev:${{ steps.vars.outputs.sha_short }}
build-args: |
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
DB_HOST=postgres
DB_NAME=${{ secrets.DB_NAME }}
DB_USERNAME=${{ secrets.DB_USERNAME }}
DB_PORT=${{ secrets.DB_PORT }}
FLASK_ENV=development
- name: Remote SSH and Deploy
uses: appleboy/ssh-action@master
env:
Expand All @@ -52,4 +45,6 @@ jobs:
sudo systemctl stop nginx
sudo systemctl restart nginx
docker stack deploy -c docker-compose.yml the-stack --with-registry-auth
sleep 30s
docker exec $(docker ps -q -f name=the-stack_web) flask db upgrade
yes | docker system prune -a
18 changes: 0 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,4 @@ COPY . .
ENV MAX_CONCURRENT_PIP=4
RUN pip3 install --upgrade pip
RUN pip3 install --exists-action w -r requirements.txt

# to receive build arguments
ARG DB_PASSWORD
ARG DB_HOST
ARG DB_NAME
ARG DB_USERNAME
ARG DB_PORT
ARG FLASK_ENV

# set env variables for build
ENV DB_PASSWORD=${DB_PASSWORD}
ENV DB_HOST=${DB_HOST}
ENV DB_NAME=${DB_NAME}
ENV DB_USERNAME=${DB_USERNAME}
ENV DB_PORT=${DB_PORT}
ENV FLASK_ENV=${FLASK_ENV}

RUN flask db upgrade
CMD python3 app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""update equipment table with muscle groups
Revision ID: 24684343da0f
Revises:
Create Date: 2024-11-20 17:40:32.344965
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '24684343da0f'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('gear', 'cost',
existing_type=postgresql.DOUBLE_PRECISION(precision=53),
nullable=0)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('gear', 'cost',
existing_type=postgresql.DOUBLE_PRECISION(precision=53),
nullable=False)
# ### end Alembic commands ###

This file was deleted.

0 comments on commit 18ee9d9

Please sign in to comment.