-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #508 from adlnet/python3-xapi-2.0
xAPI 2.0 Update
- Loading branch information
Showing
46 changed files
with
1,343 additions
and
632 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 |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Deploy ADL LRS Application (Python) | ||
'on': | ||
push: | ||
branches: | ||
- python3-xapi-2.0 | ||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.7"] | ||
#python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# - name: Install dependencies | ||
# run: | | ||
# python -m pip install --upgrade pip | ||
# pip install ruff pytest | ||
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
|
||
# - name: Lint with ruff | ||
# run: | | ||
# # stop the build if there are Python syntax errors or undefined names | ||
# ruff --format=github --select=E9,F63,F7,F82 --target-version=py37 . | ||
# # default set of ruff rules with GitHub Annotations | ||
# ruff --format=github --target-version=py37 . | ||
|
||
# - name: Test with pytest | ||
# run: | | ||
# pytest | ||
|
||
- name: Build and test | ||
run: | | ||
pip3 install -r requirements.txt | ||
./test-lrs.sh | ||
# deploy-dev: | ||
# runs-on: ubuntu-latest | ||
# environment: dev | ||
# needs: build-and-test | ||
# steps: | ||
# - name: Configure SSH | ||
# run: | | ||
# mkdir -p ~/.ssh | ||
# echo "${{ secrets.ADLNET_DEV_SSH_KEY }}" > ~/.ssh/id_rsa | ||
# chmod 600 ~/.ssh/id_rsa | ||
# ssh-keyscan "${{ secrets.ADLNET_DEV_HOST }} >> ~/.ssh/known_hosts | ||
|
||
# - name: Deploy code on Dev | ||
# run: | | ||
# ssh ${{ secrets.ADLNET_DEV_HOST_USER }}@${{ secrets.ADLNET_DEV_HOST }} "cd ${{ secrets.ADLNET_DEV_PROJECT_DIR }} && git pull origin ${GITHUB_REF#refs/heads/} && sudo docker-compose up -d --build" | ||
|
||
deploy-staging: | ||
runs-on: ubuntu-latest | ||
environment: staging | ||
needs: | ||
- build-and-test | ||
#- deploy-dev | ||
steps: | ||
- name: Configure SSH | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo "${{ secrets.ADLNET_STAGING_SSH_KEY }}" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
ssh-keyscan "${{ secrets.ADLNET_STAGING_HOST }}" >> ~/.ssh/known_hosts | ||
- name: Deploy code on Staging | ||
run: | | ||
ssh ${{ secrets.ADLNET_STAGING_HOST_USER }}@${{ secrets.ADLNET_STAGING_HOST }} " | ||
cd ${{ secrets.ADLNET_STAGING_PROJECT_DIR }} && \ | ||
echo 'Pulling Latest Code from Repository...' && \ | ||
git pull origin ${GITHUB_REF#refs/heads/} && \ | ||
echo 'Copying Required Config files...' && \ | ||
sudo cp /home/ubuntu/workflow/settings.ini /home/ubuntu/ADL_LRS/settings.ini && \ | ||
#sudo cp /home/ubuntu/workflow/docker/settings.ini /home/ubuntu/ADL_LRS/docker/lrs/settings.ini && \ | ||
sudo cp /home/ubuntu/workflow/.env /home/ubuntu/ADL_LRS/.env && \ | ||
echo 'Copying installing ssl certificate...' && \ | ||
sudo ./init-ssl.sh localhost && \ | ||
echo 'Rebuilding Docker Containers..' && \ | ||
sudo docker-compose stop && \ | ||
sudo docker-compose build --no-cache && \ | ||
sudo docker-compose up -d && \ | ||
echo 'deployed successfully on server'" |
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
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,6 +1,6 @@ | ||
#!/bin/bash | ||
|
||
rm -rf ./certbot/etc | ||
rm -rf ./docker/certbot/etc | ||
|
||
docker-compose run certbot \ | ||
certonly --webroot \ | ||
|
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,8 +1,6 @@ | ||
FROM nginx:alpine | ||
|
||
ARG LRS_ROOT | ||
ARG HOSTNAME | ||
ARG PORT | ||
|
||
# Move our configuration into place | ||
# | ||
|
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
Oops, something went wrong.