Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build in subdir #615

Open
wants to merge 1 commit into
base: release/v2.4.7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions server/src/kubero.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,6 @@ export class Kubero {
if (contextName) {
await this.kubectl.createApp(app, contextName);

if (app.deploymentstrategy == 'git' && (app.buildstrategy == 'dockerfile' || app.buildstrategy == 'nixpacks' || app.buildstrategy == 'buildpacks')){
this.triggerImageBuild(app.pipeline, app.phase, app.name);
}
this.appStateList.push(app);

const m = {
Expand All @@ -369,6 +366,13 @@ export class Kubero {
}
} as INotification;
this.notification.send(m, this._io);

if (app.deploymentstrategy == 'git' && (app.buildstrategy == 'dockerfile' || app.buildstrategy == 'nixpacks' || app.buildstrategy == 'buildpacks')){

// Wait 2 seconds to make sure the app is created
await new Promise(resolve => setTimeout(resolve, 2000));
this.triggerImageBuild(app.pipeline, app.phase, app.name);
}
}

}
Expand Down
12 changes: 10 additions & 2 deletions server/src/modules/templates/nixpacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ spec:
command:
- sh
- -c
- nixpacks build . -o .
- |-
cd $BUILD_BASE_DIR
nixpacks build . -o .
env:
- name: BUILD_BASE_DIR
value: /app
image: "ghcr.io/kubero-dev/build:latest"
imagePullPolicy: Always
resources: {}
Expand All @@ -98,6 +103,7 @@ spec:
- sh
- -c
- |-
cd $BUILD_BASE_DIR
buildah build -f $BUILDAH_DOCKERFILE_PATH --isolation chroot -t $BUILD_IMAGE .
buildah push --tls-verify=false $BUILD_IMAGE
env:
Expand All @@ -106,7 +112,9 @@ spec:
- name: BUILD_IMAGE
value: registry-kubero.yourdomain.com/optionalrepositoryowner/pipeline/app:123456
- name: BUILDAH_DOCKERFILE_PATH
value: /app/Dockerfile
value: Dockerfile
- name: BUILD_BASE_DIR
value: /app
image: "quay.io/containers/buildah:v1.35"
imagePullPolicy: IfNotPresent
resources: {}
Expand Down
Loading