Skip to content

Commit

Permalink
chore: Update Dockerfile and configuration files for dev and prod env…
Browse files Browse the repository at this point in the history
…ironments
  • Loading branch information
waveyboym committed Aug 10, 2024
1 parent e757b82 commit 71ae7e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-golang-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
host: ${{ secrets.VM_IP }}
username: ${{ secrets.VM_USERNAME }}
key: ${{ secrets.VM_SSH_KEY }}
source: "occupi-backend/docker-compose.dev.yml,occupi-backend/Dockerfile.dev,occupi-backend/centrifugo.config.json,prometheus.dev.yml"
source: "occupi-backend/docker-compose.dev.yml,occupi-backend/Dockerfile.dev,occupi-backend/centrifugo.config.json,occupi-backend/prometheus.dev.yml"
target: "/home/${{ secrets.VM_USERNAME }}/occupi-backend-dev"

# SSH to VM and run commands
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-golang-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
host: ${{ secrets.VM_IP }}
username: ${{ secrets.VM_USERNAME }}
key: ${{ secrets.VM_SSH_KEY }}
source: "occupi-backend/docker-compose.prod.yml,occupi-backend/Dockerfile.prod,occupi-backend/centrifugo.config.json,prometheus.prod.yml"
source: "occupi-backend/docker-compose.prod.yml,occupi-backend/Dockerfile.prod,occupi-backend/centrifugo.config.json,occupi-backend/prometheus.prod.yml"
target: "/home/${{ secrets.VM_USERNAME }}/occupi-backend-prod"

# SSH to VM and run commands
Expand Down
5 changes: 5 additions & 0 deletions occupi-backend/pkg/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/COS301-SE-2024/occupi/occupi-backend/pkg/models"

"github.com/gin-gonic/gin"
"github.com/prometheus/client_golang/prometheus/promhttp"
)

// creates available endpoints and attaches handlers for each endpoint
Expand Down Expand Up @@ -93,4 +94,8 @@ func OccupiRouter(router *gin.Engine, appsession *models.AppSession) {
rtc.POST("/enter", middleware.ProtectedRoute, func(ctx *gin.Context) { handlers.Enter(ctx, appsession) })
rtc.POST("/exit", middleware.ProtectedRoute, func(ctx *gin.Context) { handlers.Exit(ctx, appsession) })
}
metrics := router.Group("/metrics")
{
metrics.GET("", func(ctx *gin.Context) { promhttp.Handler().ServeHTTP(ctx.Writer, ctx.Request) })
}
}

0 comments on commit 71ae7e4

Please sign in to comment.