Skip to content

Commit

Permalink
Still working on stats service
Browse files Browse the repository at this point in the history
  • Loading branch information
iyanfdezz committed Mar 3, 2024
1 parent 14e0db2 commit 5fc66a5
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- run: npm --prefix users/userservice ci
- run: npm --prefix gatewayservice ci
- run: npm --prefix webapp ci
- run: npm --prefix questionservice ci
- run: npm --prefix statsservice ci
- run: npm --prefix users/authservice test -- --coverage
- run: npm --prefix users/userservice test -- --coverage
- run: npm --prefix gatewayservice test -- --coverage
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
- run: npm --prefix users/userservice install
- run: npm --prefix gatewayservice install
- run: npm --prefix questionservice install
- run: npm --prefix statsservice install
- run: npm --prefix webapp install
- run: npm --prefix webapp run build
- run: npm --prefix webapp run test:e2e
Expand Down Expand Up @@ -97,8 +98,25 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: users/userservice
docker-push-statsservice:
name: Push stats service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es1a/statsservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: statsservice
docker-push-questionservice:
name: Push user service Docker Image to GitHub Packages
name: Push questions service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -134,7 +152,7 @@ jobs:
deploy:
name: Deploy over SSH
runs-on: ubuntu-latest
needs: [docker-push-userservice,docker-push-authservice,docker-push-gatewayservice,docker-push-webapp,docker-push-questionservice]
needs: [docker-push-userservice,docker-push-authservice,docker-push-gatewayservice,docker-push-webapp,docker-push-questionservice, docker-push-statsservice]
steps:
- name: Deploy over SSH
uses: fifsky/ssh-action@master
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ services:

statsservice:
container_name: statsservice-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_es1a/stats:latest
image: ghcr.io/arquisoft/wiq_es1a/statsservice:latest
profiles: ["dev", "prod"]
build: ./stats
build: ./statsservice
depends_on:
- mongodb
- userservice
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const User = require('../../users/userservice/user-model.js');


class StatsForUser {

async getStatsForUser(username){
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion stats/stats-service.js → statsservice/stats-service.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// user-service.js
const express = require("express");
const bodyParser = require("body-parser");
const StatsForUser = require("./model/stats-getter");
const StatsForUser = require("./model/stats-getter.js");
const User = require("../users/user-model.js");
const cors = require('cors');

Expand Down

0 comments on commit 5fc66a5

Please sign in to comment.