feat: update CI/CD work, compose, and README

This commit is contained in:
wancat committed 2023-11-16 21:13:18 +08:00
1 parent cd22988a49
commit c438756bde
8 files changed
+31 -25

No files matched your search

+2 -10
View File
@@ -33,8 +33,8 @@ jobs:
- name: Build Test Environment, Stage 1 - name: Build Test Environment, Stage 1
run: docker-compose -f docker-compose.testing.yml build base backend app-test run: docker-compose -f docker-compose.testing.yml build base backend app-test
- name: Build Test Environment, Stage 2 - name: Build Test Quests
run: docker-compose -f docker-compose.testing.yml build helloworld run: docker-compose -f docker-compose.testing.yml run --rm backend yarn build:quests
- name: Run Cypress Tests - name: Run Cypress Tests
env: env:
@@ -99,14 +99,6 @@ jobs:
push: true push: true
tags: docker.io/${{ secrets.DOCKERHUB_USERNAME }}/linux-odyssey:base tags: docker.io/${{ secrets.DOCKERHUB_USERNAME }}/linux-odyssey:base
- name: Build quest helloworld
uses: docker/build-push-action@v2
with:
context: .
file: ./quests/helloworld/Dockerfile
push: true
tags: docker.io/${{ secrets.DOCKERHUB_USERNAME }}/linux-odyssey:helloworld
deploy: deploy:
needs: build-and-push needs: build-and-push
runs-on: ubuntu-latest runs-on: ubuntu-latest
-1
View File
@@ -9,7 +9,6 @@ lerna-debug.log*
.bash_history .bash_history
.viminfo .viminfo
*.swp *.swp
home
# Diagnostic reports (https://nodejs.org/api/report.html) # Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
+27
View File
@@ -23,6 +23,33 @@ If you want to enable social login, you should have OAuth client token in a `.en
docker compose --env-file .env up -d docker compose --env-file .env up -d
### Build Quest Images
In each quest folder, there is a `game.yml` file, which is the quest definition. And a optional `Dockerfile` to overwrite the base image. If you want to include additional files, put them in a `home` folder. The files in `home` will **not** be copied to the image automatically, you have to copy them in the `Dockerfile`.
quests/
├── Dockerfile # Base image
├── discover
│ └── game.yml
├── helloworld
│ ├── Dockerfile # Overwrite the image
│ ├── game.yml
│ └── home # Include additional files
│ └── forgotten_scroll.txt
├── read
│ └── game.yml
└── spell
├── Dockerfile
├── game.yml
└── home
└── ancient_scroll.txt
To build all quests:
yarn build:quests
The base image is built with docker-compose, so you can use `docker compose build base` to rebuild it. Once you rebuild the base image, you have to rebuild all quests.
## Testing ## Testing
Run Cypress locally, using the current development containers: Run Cypress locally, using the current development containers:
-6
View File
@@ -81,12 +81,6 @@ services:
context: . context: .
dockerfile: ./quests/Dockerfile dockerfile: ./quests/Dockerfile
helloworld:
image: lancatlin/linux-odyssey:helloworld
build:
context: .
dockerfile: quests/helloworld/Dockerfile
networks: networks:
internal: internal:
players: players:
-6
View File
@@ -69,12 +69,6 @@ services:
context: . context: .
dockerfile: ./quests/Dockerfile dockerfile: ./quests/Dockerfile
helloworld:
image: lancatlin/linux-odyssey:helloworld
build:
context: .
dockerfile: quests/helloworld/Dockerfile
networks: networks:
internal: internal:
players: players:
+1 -1
View File
@@ -24,7 +24,7 @@
"analytics": "yarn workspace analytics dev", "analytics": "yarn workspace analytics dev",
"setup": "yarn workspace server setup", "setup": "yarn workspace server setup",
"clean": "yarn workspace server clean", "clean": "yarn workspace server clean",
"build:image": "yarn workspace server build" "build:quests": "yarn workspace server build:quests"
}, },
"devDependencies": { "devDependencies": {
"@vue/eslint-config-prettier": "^7.1.0", "@vue/eslint-config-prettier": "^7.1.0",
Whitespace-only changes.
+1 -1
View File
@@ -9,7 +9,7 @@
"test": "yarn node --experimental-vm-modules $(yarn bin jest)", "test": "yarn node --experimental-vm-modules $(yarn bin jest)",
"setup": "node src/cli/setup.js", "setup": "node src/cli/setup.js",
"clean": "node src/cli/clean.js", "clean": "node src/cli/clean.js",
"build": "node src/cli/build.js" "build:quests": "node src/cli/build.js"
}, },
"dependencies": { "dependencies": {
"@linux-odyssey/constants": "*", "@linux-odyssey/constants": "*",