-
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.
Merge pull request #95 from serlo/development
Staging deployment
- Loading branch information
Showing
45 changed files
with
11,718 additions
and
1,578 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
# Template - Copy content to `.env` file and add missing (secret) values | ||
|
||
# Set this to 'local' in local development. | ||
# - sets origin to localhost | ||
# - configures cookie handling | ||
ENVIRONMENT=local | ||
|
||
EDITOR_URL=http://localhost:3000/ | ||
|
||
# Secret to enable media upload | ||
SERLO_EDITOR_TESTING_SECRET= | ||
|
||
# Symmetric HS256 key used by ltijs to sign ltik and database entries & to sign the jwt access token | ||
LTIJS_KEY=DONOTUSETHISKEYINPRODUCTION | ||
|
||
MYSQL_URI=mysql://root:secret@mariadb:3306/serlo | ||
|
||
# https://www.mongodb.com/docs/drivers/go/current/fundamentals/connections/connection-guide/#connection-uri | ||
MONGODB_URI=mongodb://mongo:27017/ | ||
|
||
# LTI platform: https://saltire.lti.app/platform | ||
ALLOW_SALTIRE=true | ||
|
||
# LTI platform: edu-sharing mock | ||
ALLOW_EDUSHARING_MOCK=true | ||
|
||
# Keep an empty line at the end |
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,31 @@ | ||
# Template - Copy content to `.env` file and add missing (secret) values | ||
|
||
EDITOR_URL=https://edtr.uber.space/ | ||
|
||
# Secret to enable media upload | ||
SERLO_EDITOR_TESTING_SECRET= | ||
|
||
# Symmetric HS256 key used by ltijs to sign ltik and database entries & to sign the jwt access token | ||
LTIJS_KEY= | ||
|
||
# LTI platform: itslearning | ||
ITSLEARNING_URL= | ||
ITSLEARNING_NAME= | ||
SERLO_EDITOR_CLIENT_ID_ON_ITSLEARNING= | ||
ITSLEARNING_AUTHENTICATION_ENDPOINT= | ||
ITSLEARNING_ACCESS_TOKEN_ENDPOINT= | ||
ITSLEARNING_KEYSET_ENDPOINT= | ||
|
||
# LTI platform: edu-sharing (RLP) | ||
EDUSHARING_RLP_URL= | ||
EDUSHARING_RLP_NAME= | ||
SERLO_EDITOR_CLIENT_ID_ON_EDUSHARING_RLP= | ||
EDUSHARING_RLP_AUTHENTICATION_ENDPOINT= | ||
EDUSHARING_RLP_ACCESS_TOKEN_ENDPOINT= | ||
EDUSHARING_RLP_KEYSET_ENDPOINT= | ||
|
||
# LTI tool: edu-sharing (RLP) | ||
EDUSHARING_RLP_LOGIN_ENDPOINT= | ||
EDUSHARING_RLP_LAUNCH_ENDPOINT= | ||
EDUSHARING_RLP_CLIENT_ID_ON_SERLO_EDITOR= | ||
EDUSHARING_RLP_DETAILS_ENDPOINT= |
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,12 @@ | ||
# Template - Copy content to `.env` file and add missing (secret) values | ||
|
||
EDITOR_URL=https://edtrdev.uber.space/ | ||
|
||
# Secret to enable media upload | ||
SERLO_EDITOR_TESTING_SECRET= | ||
|
||
# Symmetric HS256 key used by ltijs to sign ltik and database entries & to sign the jwt access token | ||
LTIJS_KEY=DONOTUSETHISKEYINPRODUCTION | ||
|
||
# LTI platform: https://saltire.lti.app/platform | ||
ALLOW_SALTIRE=true |
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,34 @@ | ||
# Template - Copy content to `.env` file and add missing (secret) values | ||
|
||
EDITOR_URL=https://edtrstag.uber.space/ | ||
|
||
# Secret to enable media upload | ||
SERLO_EDITOR_TESTING_SECRET= | ||
|
||
# Symmetric HS256 key used by ltijs to sign ltik and database entries & to sign the jwt access token | ||
LTIJS_KEY=DONOTUSETHISKEYINPRODUCTION | ||
|
||
# LTI platform: https://saltire.lti.app/platform | ||
ALLOW_SALTIRE=true | ||
|
||
# LTI platform: itslearning (staging) | ||
ITSLEARNING_URL= | ||
ITSLEARNING_NAME= | ||
SERLO_EDITOR_CLIENT_ID_ON_ITSLEARNING= | ||
ITSLEARNING_AUTHENTICATION_ENDPOINT= | ||
ITSLEARNING_ACCESS_TOKEN_ENDPOINT= | ||
ITSLEARNING_KEYSET_ENDPOINT= | ||
|
||
# LTI platform: edu-sharing (RLP) (staging) | ||
EDUSHARING_RLP_URL= | ||
EDUSHARING_RLP_NAME= | ||
SERLO_EDITOR_CLIENT_ID_ON_EDUSHARING_RLP= | ||
EDUSHARING_RLP_AUTHENTICATION_ENDPOINT= | ||
EDUSHARING_RLP_ACCESS_TOKEN_ENDPOINT= | ||
EDUSHARING_RLP_KEYSET_ENDPOINT= | ||
|
||
# LTI tool: edu-sharing (RLP) (staging) | ||
EDUSHARING_RLP_LOGIN_ENDPOINT= | ||
EDUSHARING_RLP_LAUNCH_ENDPOINT= | ||
EDUSHARING_RLP_CLIENT_ID_ON_SERLO_EDITOR= | ||
EDUSHARING_RLP_DETAILS_ENDPOINT= |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Deploy to Uberspace | ||
|
||
on: | ||
push: | ||
branches: | ||
- staging | ||
- development | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set environment variables for development | ||
if: ${{ github.ref_name == 'development' }} | ||
run: | | ||
echo "REMOTE_HOST=${{ secrets.REMOTE_HOST_DEV }}" >> $GITHUB_ENV | ||
echo "REMOTE_USER=${{ secrets.REMOTE_USER_DEV }}" >> $GITHUB_ENV | ||
echo "DOMAIN=https://editor.serlo.dev/" >> $GITHUB_ENV | ||
- name: Set environment variables for staging | ||
if: ${{ github.ref_name == 'staging' }} | ||
run: | | ||
echo "REMOTE_HOST=${{ secrets.REMOTE_HOST_STAGING }}" >> $GITHUB_ENV | ||
echo "REMOTE_USER=${{ secrets.REMOTE_USER_STAGING }}" >> $GITHUB_ENV | ||
echo "DOMAIN=https://editor.serlo-staging.dev/" >> $GITHUB_ENV | ||
- name: Deploy to Server | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ env.REMOTE_HOST }} | ||
username: ${{ env.REMOTE_USER }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
script: | | ||
cd /home/${{ env.REMOTE_USER }}/serlo-editor-as-lti-tool/ | ||
git checkout --force ${{ github.ref_name }} | ||
git pull | ||
yarn | ||
yarn build | ||
supervisorctl restart serlo-app | ||
- name: Test deployment successful | ||
run: sleep 2 && curl ${{ env.DOMAIN }} | grep NO_LTIK_OR_IDTOKEN_FOUND |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM node:20.18.0 as build | ||
WORKDIR /usr/src/app | ||
|
||
COPY . . | ||
RUN yarn install --immutable | ||
|
||
RUN yarn build | ||
|
||
FROM node:20.18.0 as production | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY --from=build /usr/src/app/dist dist | ||
|
||
EXPOSE 3000 | ||
|
||
ENTRYPOINT ["node", "dist/backend/index.cjs"] |
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,15 +1,13 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM node:20.17.0 | ||
FROM node:20.18.0 | ||
WORKDIR /usr/src/app | ||
|
||
RUN apt update && apt install neovim nano -y | ||
|
||
COPY . . | ||
RUN yarn install --immutable | ||
|
||
RUN yarn build | ||
|
||
EXPOSE 3000 | ||
|
||
ENTRYPOINT ["yarn", "start:dev"] | ||
ENTRYPOINT ["yarn", "start"] |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { setHeadlessWhen, setCommonPlugins } from '@codeceptjs/configure' | ||
|
||
setHeadlessWhen(process.env.HEADLESS) | ||
|
||
// enable all common plugins https://github.com/codeceptjs/configure#setcommonplugins | ||
setCommonPlugins() | ||
|
||
export const config: CodeceptJS.MainConfig = { | ||
tests: 'e2e/tests/**/*.ts', | ||
output: './output', | ||
helpers: { | ||
Playwright: { | ||
browser: 'chromium', | ||
url: 'http://localhost:3000', | ||
show: true, | ||
}, | ||
}, | ||
include: { | ||
I: './e2e/steps_file', | ||
}, | ||
name: 'serlo-editor-as-lti-tool', | ||
} |
Oops, something went wrong.