Moving maps to their own container
24
.github/workflows/build-and-deploy.yml
vendored
@ -79,6 +79,30 @@ jobs:
|
|||||||
tags: ${{ env.GITHUB_REF_SLUG }}
|
tags: ${{ env.GITHUB_REF_SLUG }}
|
||||||
add_git_labels: true
|
add_git_labels: true
|
||||||
|
|
||||||
|
build-maps:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
|
||||||
|
# Create a slugified value of the branch
|
||||||
|
- uses: rlespinasse/github-slug-action@master
|
||||||
|
|
||||||
|
- name: "Build and push front image"
|
||||||
|
uses: docker/build-push-action@v1
|
||||||
|
with:
|
||||||
|
dockerfile: maps/Dockerfile
|
||||||
|
path: maps/
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
repository: thecodingmachine/workadventure-maps
|
||||||
|
tags: ${{ env.GITHUB_REF_SLUG }}
|
||||||
|
add_git_labels: true
|
||||||
|
|
||||||
deeploy:
|
deeploy:
|
||||||
needs:
|
needs:
|
||||||
- build-front
|
- build-front
|
||||||
|
@ -19,8 +19,9 @@ export class MapController {
|
|||||||
// Returns a map mapping map name to file name of the map
|
// Returns a map mapping map name to file name of the map
|
||||||
getStartMap() {
|
getStartMap() {
|
||||||
this.App.get("/start-map", (req: Request, res: Response) => {
|
this.App.get("/start-map", (req: Request, res: Response) => {
|
||||||
|
let url = req.headers.host?.replace('api.', 'maps.') + URL_ROOM_STARTED;
|
||||||
res.status(OK).send({
|
res.status(OK).send({
|
||||||
mapUrlStart: req.headers.host + "/map/files" + URL_ROOM_STARTED,
|
mapUrlStart: url,
|
||||||
startInstance: "global"
|
startInstance: "global"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -28,6 +28,14 @@
|
|||||||
"API_URL": "api."+url
|
"API_URL": "api."+url
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"maps": {
|
||||||
|
"image": "thecodingmachine/workadventure-maps:"+tag,
|
||||||
|
"host": {
|
||||||
|
"url": "maps."+url,
|
||||||
|
"https": "enable"
|
||||||
|
},
|
||||||
|
"ports": [80]
|
||||||
|
},
|
||||||
"website": {
|
"website": {
|
||||||
"image": "thecodingmachine/workadventure-website:"+tag,
|
"image": "thecodingmachine/workadventure-website:"+tag,
|
||||||
"host": {
|
"host": {
|
||||||
|
@ -44,7 +44,7 @@ services:
|
|||||||
DEBUG_MODE: "$DEBUG_MODE"
|
DEBUG_MODE: "$DEBUG_MODE"
|
||||||
HOST: "0.0.0.0"
|
HOST: "0.0.0.0"
|
||||||
NODE_ENV: development
|
NODE_ENV: development
|
||||||
APACHE_DOCUMENT_ROOT: dist/
|
#APACHE_DOCUMENT_ROOT: dist/
|
||||||
#APACHE_EXTENSIONS: headers
|
#APACHE_EXTENSIONS: headers
|
||||||
#APACHE_EXTENSION_HEADERS: 1
|
#APACHE_EXTENSION_HEADERS: 1
|
||||||
STARTUP_COMMAND_0: sudo a2enmod headers
|
STARTUP_COMMAND_0: sudo a2enmod headers
|
||||||
|
BIN
front/dist/resources/items/computer/computer.png
vendored
Normal file
After Width: | Height: | Size: 577 B |
47
front/dist/resources/items/computer/computer_atlas.json
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"frames": [
|
||||||
|
{
|
||||||
|
"filename": "computer_off",
|
||||||
|
"frame": {
|
||||||
|
"w": 42,
|
||||||
|
"h": 40,
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"anchor": {
|
||||||
|
"x": 0.5,
|
||||||
|
"y": 0.5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "computer_on1",
|
||||||
|
"frame": {
|
||||||
|
"w": 42,
|
||||||
|
"h": 40,
|
||||||
|
"x": 0,
|
||||||
|
"y": 40
|
||||||
|
},
|
||||||
|
"anchor": {
|
||||||
|
"x": 0.5,
|
||||||
|
"y": 0.5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "computer_on2",
|
||||||
|
"frame": {
|
||||||
|
"w": 42,
|
||||||
|
"h": 40,
|
||||||
|
"x": 42,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"anchor": {
|
||||||
|
"x": 0.5,
|
||||||
|
"y": 0.5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"meta": {
|
||||||
|
"description": "Atlas generado con Atlas Packer Gamma V2",
|
||||||
|
"web": "https://gammafp.github.io/atlas-packer-phaser/"
|
||||||
|
}
|
||||||
|
}
|
BIN
front/dist/resources/items/computer/original/computer.png
vendored
Normal file
After Width: | Height: | Size: 577 B |
47
front/dist/resources/items/computer/original/computer_atlas.json
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"frames": [
|
||||||
|
{
|
||||||
|
"filename": "computer_off",
|
||||||
|
"frame": {
|
||||||
|
"w": 42,
|
||||||
|
"h": 40,
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"anchor": {
|
||||||
|
"x": 0.5,
|
||||||
|
"y": 0.5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "computer_on1",
|
||||||
|
"frame": {
|
||||||
|
"w": 42,
|
||||||
|
"h": 40,
|
||||||
|
"x": 0,
|
||||||
|
"y": 40
|
||||||
|
},
|
||||||
|
"anchor": {
|
||||||
|
"x": 0.5,
|
||||||
|
"y": 0.5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "computer_on2",
|
||||||
|
"frame": {
|
||||||
|
"w": 42,
|
||||||
|
"h": 40,
|
||||||
|
"x": 42,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"anchor": {
|
||||||
|
"x": 0.5,
|
||||||
|
"y": 0.5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"meta": {
|
||||||
|
"description": "Atlas generado con Atlas Packer Gamma V2",
|
||||||
|
"web": "https://gammafp.github.io/atlas-packer-phaser/"
|
||||||
|
}
|
||||||
|
}
|
BIN
front/dist/resources/items/computer/unpack/computer_off.png
vendored
Normal file
After Width: | Height: | Size: 379 B |
BIN
front/dist/resources/items/computer/unpack/computer_on1.png
vendored
Normal file
After Width: | Height: | Size: 492 B |
BIN
front/dist/resources/items/computer/unpack/computer_on2.png
vendored
Normal file
After Width: | Height: | Size: 452 B |
@ -8,7 +8,7 @@ import {ActionableItem} from "../ActionableItem";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
preload: (loader: Phaser.Loader.LoaderPlugin): void => {
|
preload: (loader: Phaser.Loader.LoaderPlugin): void => {
|
||||||
loader.atlas('computer', 'http://maps.workadventure.localhost/computer/computer.png', 'http://maps.workadventure.localhost/computer/computer_atlas.json');
|
loader.atlas('computer', '/resources/items/computer/computer.png', '/resources/items/computer/computer_atlas.json');
|
||||||
},
|
},
|
||||||
create: (scene: GameScene): void => {
|
create: (scene: GameScene): void => {
|
||||||
|
|
||||||
|
9
maps/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# we are rebuilding on each deploy to cope with the API_URL environment URL
|
||||||
|
FROM thecodingmachine/nodejs:12-apache
|
||||||
|
|
||||||
|
COPY --chown=docker:docker . .
|
||||||
|
#RUN yarn install
|
||||||
|
|
||||||
|
#ENV NODE_ENV=production
|
||||||
|
#ENV STARTUP_COMMAND_1="yarn run build"
|
||||||
|
#ENV APACHE_DOCUMENT_ROOT=dist/
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 671 KiB After Width: | Height: | Size: 671 KiB |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
@ -42,7 +42,7 @@ class MySprite extends Sprite {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
preload: (loader: Phaser.Loader.LoaderPlugin) => {
|
preload: (loader: Phaser.Loader.LoaderPlugin) => {
|
||||||
loader.atlas('computer', 'http://maps.workadventure.localhost/computer/computer.png', 'http://maps.workadventure.localhost/computer/computer_atlas.json');
|
loader.atlas('computer', '/resources/items/computer/computer.png', '/resources/items/computer/computer_atlas.json');
|
||||||
},
|
},
|
||||||
create: (scene: Scene) => {
|
create: (scene: Scene) => {
|
||||||
|
|
||||||
|