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

Releases #57

Merged
merged 16 commits into from
Mar 5, 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
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
teamname="wiq_es04c"
teamname="wiq_es04c"
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- master
- releases
pull_request:
types: [opened, synchronize, reopened]
jobs:
Expand All @@ -18,8 +19,8 @@ jobs:
- run: npm --prefix users/authservice ci
- run: npm --prefix users/userservice ci
- run: npm --prefix gatewayservice ci
- run: npm --prefix questionsservice ci # Agrega la tarea para questionsservice
- run: npm --prefix webapp ci
- run: npm --prefix questionservice ci
- run: npm --prefix users/authservice test -- --coverage
- run: npm --prefix users/userservice test -- --coverage
- run: npm --prefix gatewayservice test -- --coverage
Expand Down
59 changes: 28 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Deploy on release

on:
push:
branches:
-master
-releases
release:
types: [published]

jobs:
unit-tests:
Expand Down Expand Up @@ -53,16 +51,34 @@ jobs:
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
env:
API_URI: http://${{ secrets.DEPLOY_HOST || 'localhost' }}:8000


API_URI: http://${{ secrets.DEPLOY_HOST }}:8000
with:
name: arquisoft/wiq_es04c/webapp
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: webapp
buildargs: API_URI
docker-push-questionservice:
name: Push question 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_es04c/questionservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: ./questionservice



docker-push-authservice:
name: Push auth service Docker Image to GitHub Packages
runs-on: ubuntu-latest
Expand Down Expand Up @@ -113,29 +129,11 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: ./gatewayservice
docker-push-questionservice:
name: Push question 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_es04c/questionservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: ./questionservice

workdir: gatewayservice
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]
steps:
- name: Deploy over SSH
uses: fifsky/ssh-action@master
Expand All @@ -144,8 +142,7 @@ jobs:
user: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
command: |
wget https://raw.githubusercontent.com/arquisoft/wiq_es04c/releases/docker-compose.yml -O docker-compose.yml
wget https://raw.githubusercontent.com/arquisoft/wiq_es04c/releases/.env -O .env
git clone -b releases https://github.com/Arquisoft/wiq_es04c.git
wget https://raw.githubusercontent.com/arquisoft/wiq_es04c/master/docker-compose.yml -O docker-compose.yml
wget https://raw.githubusercontent.com/arquisoft/wiq_es04c/master/.env -O .env
docker compose --profile prod down
docker compose --profile prod up -d
docker compose --profile prod up -d
26 changes: 14 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
mongodb:
container_name: mongodb-${teamname:-defaultASW}
container_name: mongodb-${teamname:-wiq_0}
image: mongo
profiles: ["dev", "prod"]
volumes:
Expand All @@ -12,8 +12,8 @@ services:
- mynetwork

authservice:
container_name: authservice-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_0/authservice:latest
container_name: authservice-${teamname:-wiq_0}
image: ghcr.io/arquisoft/${teamname:-wiq_0}/authservice:latest
profiles: ["dev", "prod"]
build: ./users/authservice
depends_on:
Expand All @@ -26,8 +26,8 @@ services:
MONGODB_URI: mongodb://mongodb:27017/userdb

userservice:
container_name: userservice-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_0/userservice:latest
container_name: userservice-${teamname:-wiq_0}
image: ghcr.io/arquisoft/${teamname:-wiq_0}/userservice:latest
profiles: ["dev", "prod"]
build: ./users/userservice
depends_on:
Expand All @@ -40,8 +40,8 @@ services:
MONGODB_URI: mongodb://mongodb:27017/userdb

gatewayservice:
container_name: gatewayservice-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_0/gatewayservice:latest
container_name: gatewayservice-${teamname:-wiq_0}
image: ghcr.io/arquisoft/${teamname:-wiq_0}/gatewayservice:latest
profiles: ["dev", "prod"]
build: ./gatewayservice
depends_on:
Expand All @@ -58,26 +58,28 @@ services:
USER_SERVICE_URL: http://userservice:8001

questionservice:
container_name: questionservice-${teamname:-defaultASW}
container_name: questionservice-${teamname:-wiq_0}
build: ./questionservice
ports:
- "8003:8003"
networks:
- mynetwork

webapp:
container_name: webapp-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_0/webapp:latest
container_name: webapp-${teamname:-wiq_0}
image: ghcr.io/arquisoft/${teamname:-wiq_0}/webapp:latest
profiles: ["dev", "prod"]
build: ./webapp
depends_on:
- gatewayservice
ports:
- "3000:3000"
environment:
- API_URI=${API_URI}

prometheus:
image: prom/prometheus
container_name: prometheus-${teamname:-defaultASW}
container_name: prometheus-${teamname:-wiq_0}
profiles: ["dev"]
networks:
- mynetwork
Expand All @@ -91,7 +93,7 @@ services:

grafana:
image: grafana/grafana
container_name: grafana-${teamname:-defaultASW}
container_name: grafana-${teamname:-wiq_0}
profiles: ["dev"]
networks:
- mynetwork
Expand Down
6 changes: 3 additions & 3 deletions gatewayservice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/arquisoft/wiq_0.git"
"url": "git+https://github.com/arquisoft/wiq_es04c.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/arquisoft/wiq_0/issues"
"url": "https://github.com/arquisoft/wiq_es04c/issues"
},
"homepage": "https://github.com/arquisoft/wiq_0#readme",
"homepage": "https://github.com/arquisoft/wiq_es04c#readme",
"dependencies": {
"axios": "^1.6.5",
"cors": "^2.8.5",
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading