Skip to content

Commit

Permalink
Merge pull request #1182 from p2pu/master
Browse files Browse the repository at this point in the history
Release 2024-08-20
  • Loading branch information
dirkcuys authored Aug 20, 2024
2 parents ca1c2e0 + 659fdf5 commit 42fc731
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,29 @@ docker-compose exec -T learning-circles pg_restore -c -f - < db.dump | docker-co

We maintain a set of ansible roles to deploy learning circles in a repo called [marvin](https://github.com/p2pu/marvin). If you wish to deploy your own version, that will serve as a good guide to set up your own deployment.

You will need some 3rd party accounts for services like messaging, recapcha, etc to work:
- Mailgun - currently we're integrating using SMTP, so it should be easy to use another service
- Mailchip - when users sign up, they can join a mailing list
- Twilio - for text notifications
- Typeform - for surveying users
- AWS
- S3 access to store backups
- S3 access to temporarily store data exports


To setup S3 access for temporary export:
- create a S3 bucket and make sure to disable any public access
- add a lifecycle policy to the bucket to ensure that exports are deleted
- create a IAM user with access scoped to a single bucket

To do a release:

- Create a PR from master into release
- Call the PR Release YYYY-MM-DD
- Put the list of changes in the PR description
- Wait for tests to pass (docker image won't be uploaded for PR)
- Merge the PR
- Wait for TravisCI to build the release docker image
- Wait for the GitHub action to finish building the docker image
- Follow steps described [here](https://github.com/p2pu/marvin) to deploy latest release docker image

To deploy the latest code to staging:
Expand All @@ -61,8 +76,8 @@ To deploy the latest code to staging:
## Quick guide to the code

- Django, Postgres, Celery+RabbitMQ for async tasks.
- Front-end functionality is a mix of old-school Django views and React + API backend.
- An API is provided for use by https://www.p2pu.org and team sites.
- Front-end functionality is a mix of Django template views and React + API backend.
- An API is provided for use by https://www.p2pu.org, team sites and other rich interaction in the UI.
- Site provides identity for Discourse SSO hosted at https://community.p2pu.org
- Most code resides in the studygroups app.
- Translation is done using [Transifex](https://www.transifex.com/p2pu/learning-circles/). Updated translation files are manually pulled from transifex.
Expand Down
6 changes: 5 additions & 1 deletion studygroups/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ def export_users():
last_learning_circle_name=Subquery(learning_circles.values('name')[:1]),
last_learning_circle_course=Subquery(learning_circles.values('course__title')[:1]),
last_learning_circle_venue=Subquery(learning_circles.values('venue_name')[:1])
)
).filter(profile__email_confirmed_at__isnull=False)

temp_file = io.BytesIO()
writer = csv.writer(io.TextIOWrapper(temp_file))
Expand All @@ -736,6 +736,7 @@ def export_users():
'last learning cirlce name',
'last learning circle course',
'last learning circle venue',
'team',
]
writer.writerow(field_names)
for user in users:
Expand All @@ -751,6 +752,9 @@ def export_users():
user.last_learning_circle_course,
user.last_learning_circle_venue,
]
team_membership = user.teammembership_set.active().first()
if team_membership:
data += [team_membership.team.page_slug]
writer.writerow(data)

temp_file.seek(0)
Expand Down

0 comments on commit 42fc731

Please sign in to comment.