Skip to content

Commit

Permalink
Merge branch 'releases' into david
Browse files Browse the repository at this point in the history
  • Loading branch information
bidof committed Mar 5, 2024
2 parents 84fcdfc + d29fe80 commit 0915f98
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 189 deletions.
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 Down Expand Up @@ -34,8 +34,8 @@ services:


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 @@ -48,8 +48,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 @@ -62,8 +62,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 @@ -81,7 +81,7 @@ services:


questionservice:
container_name: questionservice-${teamname:-defaultASW}
container_name: questionservice-${teamname:-wiq_0}
build: ./questionservice
depends_on:
- questionservice-mysql
Expand All @@ -91,18 +91,20 @@ services:
- 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 @@ -116,7 +118,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
Loading

0 comments on commit 0915f98

Please sign in to comment.