Skip to content

Commit

Permalink
Update deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jayhuynh committed May 19, 2024
1 parent 9d99aaa commit 053a380
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
3 changes: 2 additions & 1 deletion app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ RUN chmod 400 /mephisto/mephisto/abstractions/architects/ec2/keypairs/mephisto-s
WORKDIR webapp
RUN ./link_mephisto_task.sh
WORKDIR ..
RUN chmod +x deploy.sh

EXPOSE 3000

CMD ["python3", "deploy.py"]
CMD ["./deploy.sh"]
4 changes: 3 additions & 1 deletion app/init_setup.sh → app/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash

mephisto register "$MTURK_TYPE" name="$MTURK_NAME" access_key_id="$MTURK_ACCESS_KEY_ID" secret_access_key="$MTURK_SECRET_ACCESS_KEY"
mephisto register prolific name=prolific api_key="$PROLIFIC_API_KEY"
mephisto register prolific name=prolific api_key="$PROLIFIC_API_KEY"

python3 deploy.py
10 changes: 1 addition & 9 deletions app/pre_deployment_hook.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
import os

APP_NAME = os.getenv('APP_NAME', 'temp')
APP_ENV = os.getenv('APP_ENV', 'dev')
def handle(*args):
print("Running pre deployment hook")

if APP_NAME == 'test' or APP_ENV == 'prod':
print("Running on remote server. Executing init_setup.sh")
os.system(f"sh {os.path.dirname(os.path.realpath(__file__))}/init_setup.sh")
print("Running pre deployment hook")

0 comments on commit 053a380

Please sign in to comment.