Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

feat: init heroku buildpacks

Andras Bacsai3f7cd317d623
diff --git a/apps/api/src/jobs/deployApplication.ts b/apps/api/src/jobs/deployApplication.ts
index e31ccf1498..c780595f9c 100644
--- a/apps/api/src/jobs/deployApplication.ts
+++ b/apps/api/src/jobs/deployApplication.ts
@@ -192,8 +192,8 @@ import * as buildpacks from '../lib/buildPacks';
} catch (error) {
//
}
- // if (!imageFound || deployNeeded) {
- if (true) {
+ if (!imageFound || deployNeeded) {
+ // if (true) {
await copyBaseConfigurationFiles(buildPack, workdir, buildId, applicationId, baseImage);
if (buildpacks[buildPack])
await buildpacks[buildPack]({
@@ -303,6 +303,7 @@ import * as buildpacks from '../lib/buildPacks';
labels,
depends_on: [],
restart: 'always',
+ expose: [port],
...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
// logging: {
// driver: 'fluentd',
diff --git a/apps/api/src/lib/buildPacks/heroku.ts b/apps/api/src/lib/buildPacks/heroku.ts
index 5bf1e47962..1b382547ca 100644
--- a/apps/api/src/lib/buildPacks/heroku.ts
+++ b/apps/api/src/lib/buildPacks/heroku.ts
@@ -1,15 +1,29 @@
import { executeDockerCmd, prisma } from "../common"
+import { saveBuildLog } from "./common";
export default async function (data: any): Promise<void> {
- // console.log(data)
- const {applicationId, tag, dockerId} = data
-// try {
- await executeDockerCmd({
- dockerId,
- command: `pack build ${applicationId}:${tag} --builder heroku/buildpacks:20`
- })
+ try {
+ const { buildId, applicationId, tag, dockerId, debug, workdir } = data
+ await saveBuildLog({ line: `Building image started.`, buildId, applicationId });
+ const { stdout } = await executeDockerCmd({
+ dockerId,
+ command: `pack build -p ${workdir} ${applicationId}:${tag} --builder heroku/buildpacks:20`
+ })
-// } catch (error) {
-// throw error;
-// }
+ if (debug) {
+ const array = stdout.split('\n')
+ for (const line of array) {
+ if (line !== '\n') {
+ await saveBuildLog({
+ line: `${line.replace('\n', '')}`,
+ buildId,
+ applicationId
+ });
+ }
+ }
+ }
+ await saveBuildLog({ line: `Building image successful.`, buildId, applicationId });
+ } catch (error) {
+ throw error;
+ }
}
diff --git a/apps/ui/src/lib/templates.ts b/apps/ui/src/lib/templates.ts
index d99995b35b..69757a18c2 100644
--- a/apps/ui/src/lib/templates.ts
+++ b/apps/ui/src/lib/templates.ts
@@ -292,13 +292,13 @@ export const buildPacks = [
fancyName: 'Deno',
hoverColor: 'hover:bg-green-700',
color: 'bg-green-700'
- },
- {
- name: 'heroku',
- fancyName: 'Heroku Buildpack',
- hoverColor: 'hover:bg-indigo-700',
- color: 'bg-indigo-700'
- }
+ // },
+ // {
+ // name: 'heroku',
+ // fancyName: 'Heroku Buildpack',
+ // hoverColor: 'hover:bg-indigo-700',
+ // color: 'bg-indigo-700'
+ // }
];
export const scanningTemplates = {
'@sveltejs/kit': {