Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #188

Merged
merged 5 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,40 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: gatewayservice
docker-push-prometheus:
name: Push Prometheus 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_es2c/gatewayservice/monitoring/prometheus
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: gatewayservice/monitoring/prometheus
docker-push-grafana:
name: Push Grafana 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_es2c/gatewayservice/monitoring/grafana
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: gatewayservice/monitoring/grafana
deploy:
name: Deploy over SSH
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ services:
prometheus:
image: prom/prometheus
container_name: prometheus-${teamname:-defaultASW}
profiles: ["dev"]
profiles: ["dev","prod"]
networks:
- mynetwork
volumes:
Expand All @@ -115,7 +115,7 @@ services:
grafana:
image: grafana/grafana
container_name: grafana-${teamname:-defaultASW}
profiles: ["dev"]
profiles: ["dev","prod"]
networks:
- mynetwork
volumes:
Expand Down
3 changes: 3 additions & 0 deletions gatewayservice/monitoring/grafana/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM grafana/grafana

COPY . .
3 changes: 3 additions & 0 deletions gatewayservice/monitoring/prometheus/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM prom/prometheus

COPY . .
133 changes: 73 additions & 60 deletions gatewayservice/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,68 +255,81 @@ paths:
description: Score achieved by the player.
example: 100

/createquestion:
get:
summary: Create a new question.
operationId: createQuestion
responses:
'200':
description: Question created successfully.
content:
application/json:
schema:
type: object
properties:
question:
type: string
description: The created question.
example: What is the capital of France?
answer:
type: string
description: The answer to the question.
example: Paris
/createquestion:
get:
summary: Get question from Wikidata
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
responseQuestionObject:
type: object
description: Question object
responseCorrectOption:
type: string
description: Correct option
responseAnswerOptions:
type: array
items:
type: string
description: Asnwer options
'500':
description: Error
content:
application/json:
schema:
type: object
properties:
error:
type: string
description: |
Gets an random question from Wikidata and returns the question object, correct option and answer options.


/getquestionshistory:
get:
summary: Get the history of generated questions.
operationId: getQuestionsHistory
responses:
'200':
description: Questions history retrieved successfully.
content:
application/json:
schema:
type: array
items:
type: object
properties:
question:
type: string
description: The question.
example: What is 2 + 2?
answer:
type: integer
description: The correct answer to the question.
example: 4
/getquestionshistory:
get:
summary: Get the history of generated questions.
operationId: getQuestionsHistory
responses:
'200':
description: Questions history retrieved successfully.
content:
application/json:
schema:
type: array
items:
type: object
properties:
question:
type: string
description: The question.
example: What is 2 + 2?
answer:
type: integer
description: The correct answer to the question.
example: 4



/getregisteredusers:
get:
summary: Get the list of registered users.
operationId: getRegisteredUsers
responses:
'200':
description: List of registered users retrieved successfully.
content:
application/json:
schema:
type: array
items:
type: object
properties:
username:
type: string
description: Username of the registered user.
example: user1
/getregisteredusers:
get:
summary: Get the list of registered users.
operationId: getRegisteredUsers
responses:
'200':
description: List of registered users retrieved successfully.
content:
application/json:
schema:
type: array
items:
type: object
properties:
username:
type: string
description: Username of the registered user.
example: user1