Skip to content

Commit

Permalink
feat: deploying and building to s3
Browse files Browse the repository at this point in the history
  • Loading branch information
Pulkitxm committed Oct 13, 2024
1 parent 66da753 commit 7820463
Show file tree
Hide file tree
Showing 43 changed files with 4,845 additions and 1,775 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/node_modules
*/test/
test/
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

cd core && npm run format && npx tsc -b && npm run build
cd ../docker-builder npm run format && npm run build
cd ../proxy-server && npm run format && npm run build
cd ../proxy-server && npm run format
4 changes: 3 additions & 1 deletion core/actions/gh/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export async function importProject(importProject: ImportProjectType) {
}

const accessToken = await getAccessTokenByEmail(session.user.email);
const slug = generateSlug();

if (redis) {
console.log({
Expand All @@ -28,6 +29,7 @@ export async function importProject(importProject: ImportProjectType) {
JSON.stringify({
...importProject,
GITHUB_TOKEN: accessToken,
projectSlug: slug,
}),
);
console.log(res);
Expand Down Expand Up @@ -58,7 +60,7 @@ export async function importProject(importProject: ImportProjectType) {
branch: importProject.branch,
buildCommand: importProject.build.buildCommand,
installCommand: importProject.build.installCommand,
slug: generateSlug(),
slug: slug,
createdAt: new Date(),
updatedAt: new Date(),
},
Expand Down
10 changes: 5 additions & 5 deletions docker-builder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CONTAINER_NAME=test-vercel-builder
DOCKERFILE_PATH=Dockerfile
ENV_FILE=.env
DESTINATION_DIR=output
BUILD_FOLDER=build
EXPORTS_FOLDER=export

help:
@echo "Makefile commands:"
Expand Down Expand Up @@ -44,9 +44,9 @@ reset:
-docker rmi $(IMAGE_NAME)
@echo ""

clean: stop
@echo "Removing Docker image..."
rm -rf build dist project DESTINATION_DIR
clean:
@echo "Removing ALL Folers..."
rm -rf $(DESTINATION_DIR)
@echo ""

logs:
Expand All @@ -62,7 +62,7 @@ shell:
copy:
@echo "Copying build artifacts to $(DESTINATION_DIR)..."
rm -rf $(DESTINATION_DIR)
docker cp $(CONTAINER_NAME):'/app/$(BUILD_FOLDER)' '$(DESTINATION_DIR)'
docker cp $(CONTAINER_NAME):'/app/$(EXPORTS_FOLDER)' '$(DESTINATION_DIR)'
@echo ""

serve:
Expand Down
8 changes: 8 additions & 0 deletions docker-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@
"license": "ISC",
"description": "",
"dependencies": {
"@aws-sdk/client-s3": "^3.670.0",
"@types/node": "^22.7.4",
"dotenv": "^16.4.5",
"gitignore-parser": "^0.0.2",
"ignore": "^6.0.2",
"mime-types": "^2.1.35",
"prettier": "^3.3.3",
"simple-git": "^3.27.0",
"ts-node": "^10.9.2"
},
"devDependencies": {
"@types/gitignore-parser": "^0.0.3",
"@types/mime-types": "^2.1.4"
}
}
Loading

0 comments on commit 7820463

Please sign in to comment.