Skip to content

Commit

Permalink
Add custom stacks data and routes, update server version
Browse files Browse the repository at this point in the history
Introduced new JSON files for dry-run and custom stacks data, and added corresponding routes in containers.ts. Updated server version in current-user.json to 0.1.20. Removed version specification from various Docker Compose files.
  • Loading branch information
SquirrelDevelopper committed Oct 11, 2024
1 parent af8c61b commit d6e94c1
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 6 deletions.
1 change: 0 additions & 1 deletion docker-compose.demo.dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
services:
proxy-demo:
restart: unless-stopped
Expand Down
1 change: 0 additions & 1 deletion docker-compose.demo.prod.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
services:
proxy-demo:
restart: unless-stopped
Expand Down
1 change: 0 additions & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
services:
proxy:
restart: unless-stopped
Expand Down
1 change: 0 additions & 1 deletion docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
services:
proxy:
restart: unless-stopped
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
services:
proxy:
restart: unless-stopped
Expand Down
2 changes: 1 addition & 1 deletion server-demo/src/data/current-user.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"considerOffLineAfter": 3
},
"server": {
"version": "0.1.18",
"version": "0.1.20",
"deps": {
"@aws-sdk/client-ecr": "^3.632.0",
"axios": "^1.7.4",
Expand Down
86 changes: 86 additions & 0 deletions server-demo/src/data/custom-stacks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[
{
"_id": "67092de2ce0d195dece4bc31",
"uuid": "0a74c0c1-b7a6-4f69-aae7-6ad94313e3e1",
"createdAt": "2024-10-11T13:53:38.983Z",
"lockJson": true,
"name": "sleepy-brown",
"updatedAt": "2024-10-11T13:53:38.983Z",
"yaml": "services:\n proxy:\n restart: unless-stopped\n build:\n context: ./proxy\n ports:\n - \"8000:8000\"\n depends_on:\n - client\n - mongo\n - server\n - redis\n mongo:\n container_name: mongo-ssm\n image: mongo\n restart: unless-stopped\n volumes:\n - ./.data.prod/db:/data/db\n command: --quiet\n redis:\n container_name: cache-ssm\n image: redis\n restart: unless-stopped\n volumes:\n - ./.data.prod/cache:/data\n command: --save 60 1\n server:\n restart: unless-stopped\n external_links:\n - mongo\n - redis\n depends_on:\n - mongo\n - redis\n volumes:\n - ./.data.prod/playbooks:/playbooks\n - ./.data.prod/config:/ansible-config\n build:\n context: ./server\n additional_contexts:\n - shared-lib=./shared-lib\n target: production\n env_file: .env\n environment:\n NODE_ENV: production\n client:\n restart: unless-stopped\n depends_on:\n - server\n build:\n context: ./client\n additional_contexts:\n - shared-lib=./shared-lib\n target: production\n"
},
{
"_id": "67092ee3ce0d195dece4be88",
"uuid": "9ec86a3b-8632-47f4-8ebe-9575b7c4920d",
"createdAt": "2024-10-11T13:57:55.579Z",
"icon": "file",
"iconBackgroundColor": "#000000",
"iconColor": "#ffffff",
"json": {
"name": "goofy-bartik",
"services": {
"oNFMn1jkvh": {
"name": "redis",
"ports": [
{
"published": 6379,
"target": 6379
}
]
}
}
},
"lockJson": false,
"name": "goofy-bartik",
"rawStackValue": [
{
"id": "services",
"name": "Services",
"children": [
{
"name": "Services",
"id": "services",
"category": "services",
"isTemplate": true,
"children": [
{
"id": "image",
"name": "Image",
"fieldType": "text",
"value": "redis:latest"
},
{
"id": "ports",
"name": "Ports",
"fieldType": "list",
"listItemType": "group",
"fields": [
{
"id": "published",
"name": "Published Port",
"fieldType": "number",
"value": [
6379
]
},
{
"id": "target",
"name": "Target Port",
"fieldType": "number",
"value": [
6379
]
}
]
}
],
"originalId": "redis",
"path": "oNFMn1jkvh",
"index": 0
}
]
}
],
"updatedAt": "2024-10-11T13:57:55.579Z",
"yaml": "services:\n redis:\n ports:\n - '6379:6379'\n"
}
]
4 changes: 4 additions & 0 deletions server-demo/src/data/dry-run.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"validating": false,
"message": "env file /tmp/f81f4b0a-e234-42e5-b6cc-46e981f6af74/.env not found: stat /tmp/f81f4b0a-e234-42e5-b6cc-46e981f6af74/.env: no such file or directory\n"
}
15 changes: 15 additions & 0 deletions server-demo/src/routes/containers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import express from "express";
import containers from "../data/containers.json";
import registries from "../data/registries.json";
import stacks from '../data/custom-stacks.json'
import { SuccessResponse } from "../utils/ApiResponse";
import asyncHandler from "../utils/AsyncHandler";

Expand All @@ -20,6 +21,20 @@ router.get(
}),
);

router.get(
"/containers/custom-stacks/dry-run",
asyncHandler(async (req, res) => {
new SuccessResponse("Got custom stacks", stacks).send(res);
}),
);

router.get(
"/containers/custom-stacks",
asyncHandler(async (req, res) => {
new SuccessResponse("Got custom stacks", stacks).send(res);
}),
);

router.get(
`/containers/stats/count/running`,
asyncHandler(async (req, res) => {
Expand Down

0 comments on commit d6e94c1

Please sign in to comment.