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

[Fix] Add postgresql client to app service #10781

Merged
merged 3 commits into from
Jun 26, 2024

Conversation

petertgiles
Copy link
Contributor

🤖 Resolves #10777

👋 Introduction

This branch adds the postgresql to the app service setup to ensure that a fresh setup is possible. It also adds it to the local webserver docker container to mirror the setup.

🕵️ Details

I created a custom Dockerfile for the webserver image. Before, we were pretty strict about using a pristine image but this is a convenient way to mimic some of the customization we perform on the image during post-deploy.

🧪 Testing

🏠 Locally

  1. Rebuild the webserver image docker-compose build webserver
  2. Composer install by whatever method you normally use
  • Can perform a database reset in the webserver container docker-compose exec webserver sh -c "php /home/site/wwwroot/api/artisan migrate:fresh"

☁️ Azure

  1. Deploy this branch to the dev vertical
  2. SSH in
  • Can perform a database reset php /home/site/wwwroot/api/artisan migrate:fresh

📸 Screenshot

image

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.89%. Comparing base (1ed0a49) to head (a7c438c).
Report is 2 commits behind head on main.

Additional details and impacted files
@@              Coverage Diff              @@
##               main   #10781       +/-   ##
=============================================
+ Coverage     38.27%   67.89%   +29.61%     
  Complexity     1652     1652               
=============================================
  Files          1021      234      -787     
  Lines         31191     6052    -25139     
  Branches       6509        0     -6509     
=============================================
- Hits          11939     4109     -7830     
+ Misses        19075     1943    -17132     
+ Partials        177        0      -177     
Flag Coverage Δ
integrationtests 67.89% <ø> (ø)
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tristan-orourke tristan-orourke self-requested a review June 25, 2024 19:30
@tristan-orourke
Copy link
Member

I believe I've followed all the steps, but I'm getting an error locally 😕 . I'm using docker + WSL.

image

@petertgiles
Copy link
Contributor Author

I believe I've followed all the steps, but I'm getting an error locally 😕 . I'm using docker + WSL.

Perhaps you missed the step to rebuild the webserver container?
docker-compose build webserver

Or if you did, maybe it didn't do it and you can try the --force-recreate flag?

@tristan-orourke
Copy link
Member

Okay, I ran through the steps again and it worked. 😅
php artisan migrate:fresh now works both in the webserver and maintenance containers. This kind of makes #10773 redundant, but I don't think there's a downside either.

Copy link
Member

@tristan-orourke tristan-orourke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, looks good

@petertgiles
Copy link
Contributor Author

This kind of makes #10773 redundant, but I don't think there's a downside either.

Yeah, true. I asked Eric if he wanted me to roll back those changes in this PR but he said the way it is now is fine.

@petertgiles petertgiles added this pull request to the merge queue Jun 26, 2024
Merged via the queue into main with commit b9c15a3 Jun 26, 2024
6 checks passed
@petertgiles petertgiles deleted the 10777-add-postgresql-client branch June 26, 2024 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Can't run fresh setup in Azure app service
3 participants