mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
feat: update CI/CD work, compose, and README
This commit is contained in:
1 parent
cd22988a49
commit
c438756bde
8 files changed
+31
-25
No files matched your search
@@ -33,8 +33,8 @@ jobs:
|
||||
- name: Build Test Environment, Stage 1
|
||||
run: docker-compose -f docker-compose.testing.yml build base backend app-test
|
||||
|
||||
- name: Build Test Environment, Stage 2
|
||||
run: docker-compose -f docker-compose.testing.yml build helloworld
|
||||
- name: Build Test Quests
|
||||
run: docker-compose -f docker-compose.testing.yml run --rm backend yarn build:quests
|
||||
|
||||
- name: Run Cypress Tests
|
||||
env:
|
||||
@@ -99,14 +99,6 @@ jobs:
|
||||
push: true
|
||||
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:
|
||||
needs: build-and-push
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -9,7 +9,6 @@ lerna-debug.log*
|
||||
.bash_history
|
||||
.viminfo
|
||||
*.swp
|
||||
home
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
@@ -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
|
||||
|
||||
### 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
|
||||
|
||||
Run Cypress locally, using the current development containers:
|
||||
|
||||
@@ -81,12 +81,6 @@ services:
|
||||
context: .
|
||||
dockerfile: ./quests/Dockerfile
|
||||
|
||||
helloworld:
|
||||
image: lancatlin/linux-odyssey:helloworld
|
||||
build:
|
||||
context: .
|
||||
dockerfile: quests/helloworld/Dockerfile
|
||||
|
||||
networks:
|
||||
internal:
|
||||
players:
|
||||
|
||||
@@ -69,12 +69,6 @@ services:
|
||||
context: .
|
||||
dockerfile: ./quests/Dockerfile
|
||||
|
||||
helloworld:
|
||||
image: lancatlin/linux-odyssey:helloworld
|
||||
build:
|
||||
context: .
|
||||
dockerfile: quests/helloworld/Dockerfile
|
||||
|
||||
networks:
|
||||
internal:
|
||||
players:
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
"analytics": "yarn workspace analytics dev",
|
||||
"setup": "yarn workspace server setup",
|
||||
"clean": "yarn workspace server clean",
|
||||
"build:image": "yarn workspace server build"
|
||||
"build:quests": "yarn workspace server build:quests"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/eslint-config-prettier": "^7.1.0",
|
||||
|
||||
Whitespace-only changes.
+1
-1
@@ -9,7 +9,7 @@
|
||||
"test": "yarn node --experimental-vm-modules $(yarn bin jest)",
|
||||
"setup": "node src/cli/setup.js",
|
||||
"clean": "node src/cli/clean.js",
|
||||
"build": "node src/cli/build.js"
|
||||
"build:quests": "node src/cli/build.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@linux-odyssey/constants": "*",
|
||||
|
||||
Reference in new issue
Block a user