Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
st-vi authored Dec 5, 2023
2 parents 8a0cc4b + 43995a8 commit 15512ff
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/playground_deployment_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
ref: dev
- run: git branch -a
- run: cat ./WebSocketClient/index.html

- name: Set hostname for WebSocketLanguageServer
run: |
sed -i "s/languageServerHostName: .*/languageServerHostName: \"$HOSTNAME\",/" ./WebSocketClient/src/config.ts
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/playground_deployment_prod.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy UVL Playground

env:
HOSTNAME: 55568392-f169-4f7f-b552-57cf451a2d81.ul.bw-cloud-instance.org
HOSTNAME: uvl.uni-ulm.de
USERNAME: ubuntu
WORKDIR: /home/ubuntu
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
Expand Down Expand Up @@ -41,9 +41,9 @@ jobs:
# Make sure to add the following command if dependencies change for the language server. It just takes forever
# scp -r ./WebSocketClient/UVLPlayground/node_modules $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient/UVLPlayground
run: |
scp -r ./WebSocketLanguageServer $USERNAME@$HOSTNAME:$WORKDIR
scp -r ./WebSocketClient $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient
scp -r ./docker-compose.yaml $USERNAME@$HOSTNAME:$WORKDIR
scp -r ./.env $USERNAME@$HOSTNAME:$WORKDIR
rsync -avz --update ./WebSocketLanguageServer $USERNAME@$HOSTNAME:$WORKDIR
rsync -avz --update ./WebSocketClient $USERNAME@$HOSTNAME:$WORKDIR
rsync -avz --update ./docker-compose.yaml $USERNAME@$HOSTNAME:$WORKDIR
rsync -avz --update ./.env $USERNAME@$HOSTNAME:$WORKDIR
- name: Build and run containers
run: ssh -i ~/.ssh/id_rsa $USERNAME@$HOSTNAME 'pwd && docker compose up --build -d'
24 changes: 20 additions & 4 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# UVL Playground

[![Production Website https://55568392-f169-4f7f-b552-57cf451a2d81.ul.bw-cloud-instance.org/](https://img.shields.io/website-up-down-green-red/https/perso.crans.org.svg)](https://55568392-f169-4f7f-b552-57cf451a2d81.ul.bw-cloud-instance.org/)
Production [![Production Website uvl.uni-ulm.de/](https://img.shields.io/website-up-down-green-red/https/perso.crans.org.svg)](https://uvl.uni-ulm.de/)

[![Development Website https://7470a63e-7b47-4833-a06c-1513f4fc534d.ul.bw-cloud-instance.org/](https://img.shields.io/website-up-down-green-red/https/perso.crans.org.svg)](https://7470a63e-7b47-4833-a06c-1513f4fc534d.ul.bw-cloud-instance.org/)
Development [![Development Website https://7470a63e-7b47-4833-a06c-1513f4fc534d.ul.bw-cloud-instance.org/](https://img.shields.io/website-up-down-green-red/https/perso.crans.org.svg)](https://7470a63e-7b47-4833-a06c-1513f4fc534d.ul.bw-cloud-instance.org/)

This project contains the code for the UVL playground, a small website that uses the [UVLS](https://github.com/Universal-Variability-Language/uvl-lsp) to provide syntax highlighting, autocompletion and simple analysis. It consists of static website utilizing the [monaco editor](https://github.com/microsoft/monaco-editor) und communicates via websockets with the language server by using the [monaco-languageclient package](https://github.com/TypeFox/monaco-languageclient).

Expand Down Expand Up @@ -32,10 +32,26 @@ When your changes are added to the master branch, a github action takes care of

## Hosting on a different machine

Currently, the language server as well as the website are hosted on the same server. To change that, you need to follow these steps:
To change the machine on which the playground is hosted, you need to take the following steps:

- set up your new host instance
- - install and configure docker (must run without sudo) (version 20.10.24 has a bug, so make sure to install a newer version)
- install and configure docker (must run without sudo) (version 20.10.24 has a bug, so make sure to install a newer version)
- create ssh key
- change the `SSH_PRIVATE_KEY` github secret to the new private key
- change the variables for hostname, username, email and working directory on the server at the beginning of the workflow files under `.github/workflows`

# Hosting your own uvl playground

- To host your own uvl playground setup a machine with docker
- Clone the repository
- Adapt `./WebSocketClient/src/config.ts`
- Set evn variables for example with a `.env` file with:
- `HOSTNAME=<your hostname>
- `EMAIL=<your email>
(the email is used for letsencrypt)
- run `docker compose up --build -d`
- This will run the uvl playground behind a reverse proxy with letsencrypt certificates

# Hosting your own uvl playground without reverse proxy

- Remove everything treafik related from the docker compose file

0 comments on commit 15512ff

Please sign in to comment.