Skip to content

Commit 861947b

Browse files
authored
Merge pull request #397 from raghavyuva/feat/develop
release: v0.1.0-alpha.28
2 parents f6fa144 + 49fe8e1 commit 861947b

File tree

23 files changed

+432
-233
lines changed

23 files changed

+432
-233
lines changed

CODE_OF_CONDUCT.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Code of Conduct
2+
3+
We are committed to fostering an open and welcoming environment in our community.
4+
Please read our full [Code of Conduct](https://docs.nixopus.com/code-of-conduct/) to understand the standards of behavior expected when interacting in this project.
5+
6+
By participating in Nixopus, you agree to:
7+
- Be respectful and inclusive
8+
- Foster a collaborative environment
9+
- Refrain from harassment or discriminatory behavior
10+
- Follow the guidelines outlined in the linked Code of Conduct
11+
12+
Instances of unacceptable behavior may be reported by contacting the maintainers.
13+
14+
Thank you for helping us build a safe and welcoming community.

CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Contributing to Nixopus
2+
3+
Thank you for your interest in contributing to **Nixopus**! We greatly appreciate your efforts to make this project better.
4+
5+
Before you get started, please take a moment to review our community values and follow the steps below to contribute effectively.
6+
7+
8+
## Contribution Guide
9+
10+
For a comprehensive overview of how to contribute including setting up the development environment, branching strategy, how to run the app, and submission workflows, please refer to our full [Contribution Guide](https://docs.nixopus.com/contributing/).
11+
12+
13+

api/api/versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"version": "v1",
55
"status": "active",
6-
"release_date": "2025-09-10T14:50:58.980242644+05:30",
6+
"release_date": "2025-09-11T20:17:18.854289411+05:30",
77
"end_of_life": "0001-01-01T00:00:00Z",
88
"changes": [
99
"Initial API version"

api/internal/features/deploy/controller/handle_deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (c *DeployController) HandleDeploy(f fuego.ContextWithBody[types.CreateDepl
5151
}
5252
}
5353

54-
c.logger.Log(logger.Info, "attempting to create deployment", "name: "+data.Name+", user_id: "+user.ID.String())
54+
c.logger.Log(logger.Info, "attempting to create deployment", "name: "+data.Name+", user_id: "+user.ID.String())
5555

5656
application, err := c.taskService.CreateDeploymentTask(&data, user.ID, organizationID)
5757
if err != nil {

api/internal/features/deploy/tasks/create.go

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"strconv"
7+
78
"github.com/google/uuid"
89
"github.com/raghavyuva/caddygo"
910
"github.com/raghavyuva/nixopus-api/internal/features/deploy/types"
@@ -23,6 +24,8 @@ func (t *TaskService) CreateDeploymentTask(deployment *types.CreateDeploymentReq
2324
return shared_types.Application{}, err
2425
}
2526

27+
TaskPayload.CorrelationID = uuid.NewString()
28+
2629
err = CreateDeploymentQueue.Add(TaskCreateDeployment.WithArgs(context.Background(), TaskPayload))
2730
if err != nil {
2831
fmt.Printf("error enqueuing create deployment: %v\n", err)
@@ -72,7 +75,7 @@ func (t *TaskService) HandleCreateDockerfileDeployment(ctx context.Context, Task
7275
taskCtx.AddLog("Container updated successfully for application " + TaskPayload.Application.Name + " with container id " + containerResult.ContainerID)
7376
taskCtx.LogAndUpdateStatus("Deployment completed successfully", shared_types.Deployed)
7477

75-
client := caddygo.NewClient("http://localhost:2019")
78+
client := GetCaddyClient()
7679
port, err := strconv.Atoi(containerResult.AvailablePort)
7780
if err != nil {
7881
taskCtx.LogAndUpdateStatus("Failed to convert port to int: "+err.Error(), shared_types.Failed)
@@ -100,28 +103,30 @@ func (t *TaskService) HandleCreateStaticDeployment(ctx context.Context, TaskPayl
100103

101104
// TODOD: Shravan implement types and get back
102105
func (t *TaskService) ReDeployApplication(request *types.ReDeployApplicationRequest, userID uuid.UUID, organizationID uuid.UUID) (shared_types.Application, error) {
103-
application, err := t.Storage.GetApplicationById(request.ID.String(), organizationID)
104-
if err != nil {
105-
return shared_types.Application{}, err
106-
}
107-
108-
contextTask := ContextTask{
109-
TaskService: t,
110-
ContextConfig: request,
111-
UserId: userID,
112-
OrganizationId: organizationID,
113-
Application: &application,
114-
}
115-
116-
TaskPayload, err := contextTask.PrepareReDeploymentContext()
117-
if err != nil {
118-
return shared_types.Application{}, err
119-
}
120-
121-
err = ReDeployQueue.Add(TaskReDeploy.WithArgs(context.Background(), TaskPayload))
122-
if err != nil {
123-
fmt.Printf("error enqueuing redeploy: %v\n", err)
124-
}
125-
126-
return application, nil
106+
application, err := t.Storage.GetApplicationById(request.ID.String(), organizationID)
107+
if err != nil {
108+
return shared_types.Application{}, err
109+
}
110+
111+
contextTask := ContextTask{
112+
TaskService: t,
113+
ContextConfig: request,
114+
UserId: userID,
115+
OrganizationId: organizationID,
116+
Application: &application,
117+
}
118+
119+
TaskPayload, err := contextTask.PrepareReDeploymentContext()
120+
if err != nil {
121+
return shared_types.Application{}, err
122+
}
123+
124+
TaskPayload.CorrelationID = uuid.NewString()
125+
126+
err = ReDeployQueue.Add(TaskReDeploy.WithArgs(context.Background(), TaskPayload))
127+
if err != nil {
128+
fmt.Printf("error enqueuing redeploy: %v\n", err)
129+
}
130+
131+
return application, nil
127132
}

api/internal/features/deploy/tasks/delete.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/docker/docker/api/types/container"
99
"github.com/docker/docker/api/types/image"
1010
"github.com/google/uuid"
11-
"github.com/raghavyuva/caddygo"
1211
"github.com/raghavyuva/nixopus-api/internal/features/deploy/types"
1312
"github.com/raghavyuva/nixopus-api/internal/features/logger"
1413
)
@@ -58,13 +57,12 @@ func (s *TaskService) DeleteDeployment(deployment *types.DeleteDeploymentRequest
5857
s.Logger.Log(logger.Error, "Failed to remove repository", err.Error())
5958
}
6059

61-
client := caddygo.NewClient("http://localhost:2019")
60+
client := GetCaddyClient()
6261
err = client.DeleteDomain(domain)
6362
if err != nil {
6463
s.Logger.Log(logger.Error, "Failed to remove domain", err.Error())
6564
}
6665
client.Reload()
67-
6866

6967
return s.Storage.DeleteDeployment(deployment, userID)
70-
}
68+
}

0 commit comments

Comments
 (0)