This repository has been archived by the owner on Aug 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 422
feat: introduce ansible-free docker image for edx-notes-api #1053
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3d636c6
feat: introduce annsible-free docker image for edx-notes-apo
iamsobanjaved 0362a89
Merge branch 'master' into iamsobanjaved/notes-ansible-free
iamsobanjaved e8a32ff
fix: update image name as per the pushing script
iamsobanjaved f88194f
fix: remove extra commented lines
iamsobanjaved 322667b
Merge branch 'master' into iamsobanjaved/notes-ansible-free
iamsobanjaved 42bbb53
fix: remove env activation command
iamsobanjaved 117ea60
Merge branch 'master' into iamsobanjaved/notes-ansible-free
iamsobanjaved File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,30 @@ set -eu -o pipefail | |
set -x | ||
|
||
# Common provisioning tasks for IDAs, including requirements, migrations, oauth client creation, etc. | ||
./provision-ida.sh edx_notes_api edx-notes 18120 edx_notes_api | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Note for reviewer] Copied the content of the common provisioning script and adjusted paths. |
||
# ./provision-ida.sh edx_notes_api edx-notes 18120 edx_notes_api | ||
|
||
name=edx_notes_api | ||
port=18734 | ||
client_name=edx-notes # The name of the Oauth client stored in the edxapp DB. | ||
|
||
docker-compose up -d $name | ||
|
||
echo -e "${GREEN}Installing requirements for ${name}...${NC}" | ||
docker-compose exec -T ${name} bash -e -c 'cd /edx/app/notes && make requirements' -- "$name" | ||
|
||
echo -e "${GREEN}Running migrations for ${name}...${NC}" | ||
docker-compose exec -T ${name} bash -e -c 'cd /edx/app/notes && make migrate' -- "$name" | ||
|
||
echo -e "${GREEN}Creating super-user for ${name}...${NC}" | ||
docker-compose exec -T ${name} bash -e -c 'cho "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser(\"edx\", \"edx@example.com\", \"edx\") if not User.objects.filter(username=\"edx\").exists() else None" | python /edx/app/notes/manage.py shell' -- "$name" | ||
|
||
./provision-ida-user.sh $name $client_name $port | ||
|
||
# Compile static assets last since they are absolutely necessary for all services. This will allow developers to get | ||
# started if they do not care about static assets | ||
echo -e "${GREEN}Compiling static assets for ${name}...${NC}" | ||
docker-compose exec -T ${name} bash -e -c 'cd /edx/app/notes && make static' -- "$name" | ||
|
||
# This will build the elasticsearch index for notes. | ||
echo -e "${GREEN}Creating indexes for edx_notes_api...${NC}" | ||
docker-compose exec -T edx_notes_api bash -e -c 'source /edx/app/$1/$1_env && cd /edx/app/$1/$1/ && python manage.py search_index --rebuild -f' -- edx_notes_api | ||
echo -e "${GREEN}Creating indexes for ${name}...${NC}" | ||
docker-compose exec -T ${name} bash -e -c 'cd /edx/app/notes/ && python manage.py search_index --rebuild -f' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Note for reviewer] I have changed paths here because notes was already deployed on prod with the native Dockerfile, so instead of adjusting paths for prod as per devstack, I have adjusted paths for devstack as of production.