-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
61 additions
and
68 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,64 @@ | ||
name: Tutor Setup with Plugin Verification | ||
name: Tutor Open edX CI | ||
|
||
on: [push] | ||
on: | ||
push: # This will trigger the workflow on push to any branch | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
setup-tutor: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# - name: Set up Python 3.11 | ||
# uses: actions/setup-python@v2 | ||
# with: | ||
# python-version: '3.11' | ||
|
||
- name: Check open ports | ||
run: | | ||
sudo netstat -tuln # Or use ss if netstat is not available | ||
- name: Check for web proxy services | ||
run: | | ||
ps aux | grep -E 'nginx|apache|caddy' | ||
- name: Check for proxy environment variables | ||
run: | | ||
env | grep -i proxy | ||
- name: Install Tutor | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install tutor | ||
# - name: Add extra LMS requirements | ||
# run: | | ||
# # Create a custom Tutor configuration to add extra pip requirements for the LMS | ||
# tutor config save --set OPENEDX_EXTRA_PIP_REQUIREMENTS="eox-core\neox-tenant" | ||
|
||
# - name: Rebuild the LMS image to include the extra requirements | ||
# run: | | ||
# tutor images build openedx | ||
|
||
# - name: Configure LMS to be externally accessible | ||
# run: | | ||
# tutor config save --set LMS_HOST=0.0.0.0 | ||
|
||
- name: Start Tutor | ||
run: | | ||
tutor local launch -I | ||
- name: Install additional LMS requirements | ||
run: | | ||
tutor local run lms pip install eox-core eox-tenant | ||
tutor local restart lms | ||
# - name: Wait for services to be up | ||
# run: | | ||
# sleep 600 # Adjust the sleep time as necessary for services to be fully ready | ||
|
||
- name: Get LMS_HOST value | ||
id: lms_host | ||
run: | | ||
echo "LMS_HOST=$(tutor config printvalue LMS_HOST)" >> $GITHUB_ENV | ||
- name: Check LMS logs | ||
run: | | ||
tutor local logs lms --tail=200 # Retrieve the last 100 lines of LMS logs | ||
- name: Check LMS heartbeat endpoint | ||
run: | | ||
curl -f http://LMS:8000/heartbeat | ||
setup-tutor: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y python3 python3-pip curl | ||
pip3 install tutor | ||
- name: Configure Tutor plugin | ||
run: | | ||
tutor plugins create patches <<EOF | ||
name: patches | ||
patches: | ||
caddyfile: | | ||
{$default_site_port} { | ||
@favicon_matcher { | ||
path_regexp ^/favicon.ico$ | ||
} | ||
rewrite @favicon_matcher /theming/asset/images/favicon.ico | ||
{{ patch("caddyfile-mfe-by-path") }} | ||
# Limit profile image upload size | ||
request_body /api/profile_images/*/*/upload { | ||
max_size 1MB | ||
} | ||
request_body { | ||
max_size 4MB | ||
} | ||
import proxy "lms:8000" | ||
} | ||
openedx-cms-production-settings: | | ||
ALLOWED_HOSTS = ["*"] | ||
openedx-lms-production-settings: | | ||
ALLOWED_HOSTS = ["*"] | ||
EOF | ||
tutor plugins enable patches | ||
- name: Launch Tutor | ||
run: | | ||
tutor config save | ||
tutor local launch | ||
- name: Check Open edX LMS heartbeat | ||
run: | | ||
until curl -sSf http://localhost:8000/heartbeat; do | ||
echo "Waiting for LMS to be ready..." | ||
sleep 5 | ||
done | ||
echo "LMS is up and running!" |