Skip to content

Commit

Permalink
Merge pull request #1127 from gettakaro/main-promotion
Browse files Browse the repository at this point in the history
  • Loading branch information
niekcandaele authored Aug 18, 2024
2 parents 061387c + a965ede commit 4673e18
Show file tree
Hide file tree
Showing 16 changed files with 923 additions and 439 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Docker
on:
push:
branches:
- 'main'
- 'development'
- '*'
tags:
- '*'
merge_group:
Expand Down Expand Up @@ -100,7 +99,15 @@ jobs:
node-version: [18.18]

steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.TAKARO_CI_APP_ID }}
private_key: ${{ secrets.TAKARO_CI_APP_PRIV_KEY }}
- uses: actions/checkout@v3
with:
token: ${{ steps.generate_token.outputs.token }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand All @@ -123,6 +130,18 @@ jobs:
GRAFANA_CLOUD_API_USER: ${{ secrets.GRAFANA_CLOUD_API_USER }}
GRAFANA_CLOUD_API_KEY: ${{ secrets.GRAFANA_CLOUD_API_KEY }}

- name: Commit and push if changed
if: github.event_name == 'push' && !contains(github.ref, 'refs/heads/main') && !contains(github.ref, 'refs/heads/development')
run: |
if git diff --quiet; then
echo "No changes to commit."
else
git config --global user.name 'takaro-ci-bot[bot]'
git config --global user.email '138661031+takaro-ci-bot[bot]@users.noreply.github.com'
git commit -am "chore: generate api client"
git push
fi
- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
3 changes: 3 additions & 0 deletions containers/generic-app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ ENV NODE_ENV=production
ARG TAKARO_VERSION=unset
ARG TAKARO_COMMIT=unset
ARG TAKARO_BUILD_DATE=unset
ENV TAKARO_VERSION=${TAKARO_VERSION}
ENV TAKARO_COMMIT=${TAKARO_COMMIT}
ENV TAKARO_BUILD_DATE=${TAKARO_BUILD_DATE}
ENV TAKARO_FULL_VERSION=${TAKARO_VERSION}-${TAKARO_COMMIT}-${TAKARO_BUILD_DATE}

WORKDIR /app
Expand Down
3 changes: 3 additions & 0 deletions containers/generic-web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ RUN chmod +x ./entrypoint.sh
ARG TAKARO_VERSION=unset
ARG TAKARO_COMMIT=unset
ARG TAKARO_BUILD_DATE=unset
ENV TAKARO_VERSION=${TAKARO_VERSION}
ENV TAKARO_COMMIT=${TAKARO_COMMIT}
ENV TAKARO_BUILD_DATE=${TAKARO_BUILD_DATE}
ENV TAKARO_FULL_VERSION=${TAKARO_VERSION}-${TAKARO_COMMIT}-${TAKARO_BUILD_DATE}
ENV VITE_TAKARO_VERSION=${TAKARO_FULL_VERSION}

Expand Down
5 changes: 4 additions & 1 deletion containers/takaro/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ WORKDIR /app

RUN npm ci

ARG TAKARO_VERSION=localdev
ARG TAKARO_VERSION=unset
ARG TAKARO_COMMIT=unset
ARG TAKARO_BUILD_DATE=unset
ENV TAKARO_VERSION=${TAKARO_VERSION}
ENV TAKARO_COMMIT=${TAKARO_COMMIT}
ENV TAKARO_BUILD_DATE=${TAKARO_BUILD_DATE}
ENV TAKARO_FULL_VERSION=${TAKARO_VERSION}-${TAKARO_COMMIT}-${TAKARO_BUILD_DATE}

CMD ["npm", "run", "start:dev"]
5 changes: 5 additions & 0 deletions packages/app-api/src/service/CommandService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { GameServerService } from './GameServerService.js';
import { PlayerService } from './PlayerService.js';
import { PlayerOnGameServerService } from './PlayerOnGameserverService.js';
import { ModuleService } from './ModuleService.js';
import { UserService } from './UserService.js';

export class CommandOutputDTO extends TakaroModelDTO<CommandOutputDTO> {
@IsString()
Expand Down Expand Up @@ -285,8 +286,11 @@ export class CommandService extends TakaroService<CommandModel, CommandOutputDTO
this.log.debug(`Found ${triggeredCommands.length} commands that match the event`);

const gameServerService = new GameServerService(this.domainId);
const userService = new UserService(this.domainId);

const { player, pog } = await this.playerService.resolveRef(chatMessage.player, gameServerId);
const userRes = await userService.find({ filters: { playerId: [player.id] } });
const user = userRes.results[0];

const parsedCommands = await Promise.all(
triggeredCommands.map(async (c) => {
Expand Down Expand Up @@ -348,6 +352,7 @@ export class CommandService extends TakaroService<CommandModel, CommandOutputDTO
module: data.module,
gameServerId,
player,
user,
chatMessage,
trigger: commandName,
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.2.0
7.7.0
Loading

0 comments on commit 4673e18

Please sign in to comment.