fix: Do not pull latest image
This commit is contained in:
parent
3e8a8364dc
commit
dd83e86bc3
@ -114,13 +114,7 @@ export const post: RequestHandler = async (event) => {
|
|||||||
};
|
};
|
||||||
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
||||||
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (version === 'latest') {
|
|
||||||
await asyncExecShell(
|
|
||||||
`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
||||||
return {
|
return {
|
||||||
status: 200
|
status: 200
|
||||||
|
@ -59,13 +59,7 @@ export const post: RequestHandler = async (event) => {
|
|||||||
};
|
};
|
||||||
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
||||||
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (version === 'latest') {
|
|
||||||
await asyncExecShell(
|
|
||||||
`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
||||||
return {
|
return {
|
||||||
status: 200
|
status: 200
|
||||||
|
@ -64,13 +64,7 @@ export const post: RequestHandler = async (event) => {
|
|||||||
};
|
};
|
||||||
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
||||||
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (version === 'latest') {
|
|
||||||
await asyncExecShell(
|
|
||||||
`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
||||||
return {
|
return {
|
||||||
status: 200
|
status: 200
|
||||||
|
@ -60,13 +60,7 @@ export const post: RequestHandler = async (event) => {
|
|||||||
};
|
};
|
||||||
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
||||||
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (version === 'latest') {
|
|
||||||
await asyncExecShell(
|
|
||||||
`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
||||||
return {
|
return {
|
||||||
status: 200
|
status: 200
|
||||||
|
@ -51,13 +51,7 @@ export const post: RequestHandler = async (event) => {
|
|||||||
};
|
};
|
||||||
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
||||||
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (version === 'latest') {
|
|
||||||
await asyncExecShell(
|
|
||||||
`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
||||||
return {
|
return {
|
||||||
status: 200
|
status: 200
|
||||||
|
@ -168,16 +168,15 @@ COPY ./init-db.sh /docker-entrypoint-initdb.d/init-db.sh`;
|
|||||||
};
|
};
|
||||||
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
||||||
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
||||||
if (version === 'latest') {
|
try {
|
||||||
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
|
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
||||||
}
|
|
||||||
await asyncExecShell(
|
|
||||||
`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up --build -d`
|
|
||||||
);
|
|
||||||
return {
|
return {
|
||||||
status: 200
|
status: 200
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return ErrorHandler(error);
|
return ErrorHandler(error);
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
return ErrorHandler(error);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
@ -58,13 +58,7 @@ export const post: RequestHandler = async (event) => {
|
|||||||
};
|
};
|
||||||
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
||||||
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (version === 'latest') {
|
|
||||||
await asyncExecShell(
|
|
||||||
`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
||||||
return {
|
return {
|
||||||
status: 200
|
status: 200
|
||||||
|
@ -60,11 +60,6 @@ export const post: RequestHandler = async (event) => {
|
|||||||
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
||||||
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
||||||
try {
|
try {
|
||||||
if (version === 'latest') {
|
|
||||||
await asyncExecShell(
|
|
||||||
`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
||||||
return {
|
return {
|
||||||
status: 200
|
status: 200
|
||||||
|
@ -68,10 +68,7 @@ export const post: RequestHandler = async (event) => {
|
|||||||
};
|
};
|
||||||
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
||||||
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
||||||
|
try {
|
||||||
if (version === 'latest') {
|
|
||||||
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`);
|
|
||||||
}
|
|
||||||
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
||||||
return {
|
return {
|
||||||
status: 200
|
status: 200
|
||||||
@ -79,4 +76,7 @@ export const post: RequestHandler = async (event) => {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
return ErrorHandler(error);
|
return ErrorHandler(error);
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
return ErrorHandler(error);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
@ -105,11 +105,6 @@ export const post: RequestHandler = async (event) => {
|
|||||||
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
||||||
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
||||||
try {
|
try {
|
||||||
if (version === 'latest') {
|
|
||||||
await asyncExecShell(
|
|
||||||
`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} up -d`);
|
||||||
return {
|
return {
|
||||||
status: 200
|
status: 200
|
||||||
|
Loading…
x
Reference in New Issue
Block a user