mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-17 12:33:06 +00:00
fix: fail build if no application found.
This commit is contained in:
@@ -69,7 +69,15 @@ import * as buildpacks from '../lib/buildPacks';
|
||||
teams: true
|
||||
}
|
||||
});
|
||||
|
||||
if (!application) {
|
||||
await prisma.build.update({
|
||||
where: { id: queueBuild.id },
|
||||
data: {
|
||||
status: 'failed'
|
||||
}
|
||||
});
|
||||
throw new Error('Application not found');
|
||||
}
|
||||
let {
|
||||
id: buildId,
|
||||
type,
|
||||
@@ -111,7 +119,7 @@ import * as buildpacks from '../lib/buildPacks';
|
||||
.replace('-app', '')}:${storage.path}`;
|
||||
}
|
||||
if (storage.hostPath) {
|
||||
return `${storage.hostPath}:${storage.path}`
|
||||
return `${storage.hostPath}:${storage.path}`;
|
||||
}
|
||||
return `${applicationId}${storage.path.replace(/\//gi, '-')}:${storage.path}`;
|
||||
}) || [];
|
||||
@@ -163,11 +171,18 @@ import * as buildpacks from '../lib/buildPacks';
|
||||
port: exposePort ? `${exposePort}:${port}` : port
|
||||
});
|
||||
try {
|
||||
const composeVolumes = volumes.filter(v => {
|
||||
if (!v.startsWith('.') && !v.startsWith('..') && !v.startsWith('/') && !v.startsWith('~')) {
|
||||
const composeVolumes = volumes
|
||||
.filter((v) => {
|
||||
if (
|
||||
!v.startsWith('.') &&
|
||||
!v.startsWith('..') &&
|
||||
!v.startsWith('/') &&
|
||||
!v.startsWith('~')
|
||||
) {
|
||||
return v;
|
||||
}
|
||||
}).map((volume) => {
|
||||
})
|
||||
.map((volume) => {
|
||||
return {
|
||||
[`${volume.split(':')[0]}`]: {
|
||||
name: volume.split(':')[0]
|
||||
@@ -389,7 +404,7 @@ import * as buildpacks from '../lib/buildPacks';
|
||||
.replace('-app', '')}:${storage.path}`;
|
||||
}
|
||||
if (storage.hostPath) {
|
||||
return `${storage.hostPath}:${storage.path}`
|
||||
return `${storage.hostPath}:${storage.path}`;
|
||||
}
|
||||
return `${applicationId}${storage.path.replace(/\//gi, '-')}:${storage.path}`;
|
||||
}) || [];
|
||||
@@ -504,7 +519,8 @@ import * as buildpacks from '../lib/buildPacks';
|
||||
try {
|
||||
await executeCommand({
|
||||
dockerId: destinationDocker.id,
|
||||
command: `docker ${location ? `--config ${location}` : ''
|
||||
command: `docker ${
|
||||
location ? `--config ${location}` : ''
|
||||
} pull ${imageName}:${customTag}`
|
||||
});
|
||||
imageFoundRemotely = true;
|
||||
@@ -668,7 +684,8 @@ import * as buildpacks from '../lib/buildPacks';
|
||||
try {
|
||||
const { stdout: containers } = await executeCommand({
|
||||
dockerId: destinationDockerId,
|
||||
command: `docker ps -a --filter 'label=com.docker.compose.service=${pullmergeRequestId ? imageId : applicationId
|
||||
command: `docker ps -a --filter 'label=com.docker.compose.service=${
|
||||
pullmergeRequestId ? imageId : applicationId
|
||||
}' --format {{.ID}}`
|
||||
});
|
||||
if (containers) {
|
||||
@@ -701,11 +718,18 @@ import * as buildpacks from '../lib/buildPacks';
|
||||
await saveDockerRegistryCredentials({ url, username, password, workdir });
|
||||
}
|
||||
try {
|
||||
const composeVolumes = volumes.filter(v => {
|
||||
if (!v.startsWith('.') && !v.startsWith('..') && !v.startsWith('/') && !v.startsWith('~')) {
|
||||
const composeVolumes = volumes
|
||||
.filter((v) => {
|
||||
if (
|
||||
!v.startsWith('.') &&
|
||||
!v.startsWith('..') &&
|
||||
!v.startsWith('/') &&
|
||||
!v.startsWith('~')
|
||||
) {
|
||||
return v;
|
||||
}
|
||||
}).map((volume) => {
|
||||
})
|
||||
.map((volume) => {
|
||||
return {
|
||||
[`${volume.split(':')[0]}`]: {
|
||||
name: volume.split(':')[0]
|
||||
|
||||
Reference in New Issue
Block a user