Skip to content

Commit

Permalink
Merge pull request #199 from matematikk-mooc/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
madsenandreas authored Apr 23, 2024
2 parents f13d4b0 + 5079a6f commit f014422
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
run: |
if [ "$GITHUB_REF" = "refs/heads/staging" ]
then
docker build --build-arg WEBSITES_PORT=$WEBSITES_PORT . -f Dockerfile -t $AZURE_CONTAINER_REGISTRY/statistics-api-staging
docker build --build-arg WEBSITES_PORT=$WEBSITES_PORT . -f Dockerfile -t $AZURE_CONTAINER_REGISTRY/statistics-api-staging:$GITHUB_SHA -t $AZURE_CONTAINER_REGISTRY/statistics-api-staging:latest
az webapp config appsettings set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }} -g $AZURE_RESOURCE_GROUP -n $AZURE_APP_NAME --slot staging --settings \
"CANVAS_ACCESS_KEY=${{ secrets.CANVAS_ACCESS_KEY }}" \
"DB_PASSWORD=${{ secrets.STAGING_DB_PASSWORD }}" \
Expand All @@ -94,10 +94,11 @@ jobs:
"DOCKER_REGISTRY_SERVER_URL=https://$AZURE_CONTAINER_REGISTRY" \
"GIT_COMMIT=${GITHUB_SHA}" \
@"${GITHUB_WORKSPACE}/.github/app_service_config/staging_app_service_config.json"
docker push $AZURE_CONTAINER_REGISTRY/statistics-api-staging
docker push $AZURE_CONTAINER_REGISTRY/statistics-api-staging:$GITHUB_SHA
docker push $AZURE_CONTAINER_REGISTRY/statistics-api-staging:latest
elif [ "$GITHUB_REF" = "refs/heads/master" ]
then
docker build --build-arg WEBSITES_PORT=$WEBSITES_PORT . -f Dockerfile -t $AZURE_CONTAINER_REGISTRY/statistics-api
docker build --build-arg WEBSITES_PORT=$WEBSITES_PORT . -f Dockerfile -t $AZURE_CONTAINER_REGISTRY/statistics-api:$GITHUB_SHA -t $AZURE_CONTAINER_REGISTRY/statistics-api:latest
az webapp config appsettings set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }} -g $AZURE_RESOURCE_GROUP -n $AZURE_APP_NAME --settings \
"CANVAS_ACCESS_KEY=${{ secrets.CANVAS_ACCESS_KEY }}" \
"DB_PASSWORD=${{ secrets.DB_PASSWORD }}" \
Expand All @@ -109,5 +110,6 @@ jobs:
"DOCKER_REGISTRY_SERVER_URL=https://$AZURE_CONTAINER_REGISTRY" \
"GIT_COMMIT=${GITHUB_SHA}" \
@"${GITHUB_WORKSPACE}/.github/app_service_config/app_service_config.json"
docker push $AZURE_CONTAINER_REGISTRY/statistics-api
docker push $AZURE_CONTAINER_REGISTRY/statistics-api:$GITHUB_SHA
docker push $AZURE_CONTAINER_REGISTRY/statistics-api:latest
fi
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ requests==2.31.0
SQLAlchemy-Utils==0.41.1
APScheduler==3.10.4
django~=3.2
gunicorn~=21.2.0
gunicorn~=22.0.0
mysqlclient==2.1.1
arrow~=1.3.0
python-graphql-client~=0.4.3
Expand Down

0 comments on commit f014422

Please sign in to comment.