mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-23 20:28:47 +00:00
fix: simplify getServiceImageDigest command for improved reliability
- Refactored the getServiceImageDigest function to streamline the command used for retrieving the Docker service image digest, enhancing reliability. - Removed unnecessary console logging for the current digest.
This commit is contained in:
@@ -42,14 +42,10 @@ export const pullLatestRelease = async () => {
|
|||||||
/** Returns Dokploy docker service image digest */
|
/** Returns Dokploy docker service image digest */
|
||||||
export const getServiceImageDigest = async () => {
|
export const getServiceImageDigest = async () => {
|
||||||
const { stdout } = await execAsync(
|
const { stdout } = await execAsync(
|
||||||
`docker image ls --digests --format '{{.Repository}}:{{.Tag}} {{.Digest}}' | \
|
"docker service inspect dokploy --format '{{.Spec.TaskTemplate.ContainerSpec.Image}}'",
|
||||||
grep "$(docker service inspect dokploy --format '{{.Spec.TaskTemplate.ContainerSpec.Image}}')" | \
|
|
||||||
awk '{print $2}' | \
|
|
||||||
awk -F':' '{print $2}'`,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const currentDigest = stdout.trim().split("@")[1];
|
const currentDigest = stdout.trim().split("@")[1];
|
||||||
console.log("currentDigest: ", currentDigest);
|
|
||||||
|
|
||||||
if (!currentDigest) {
|
if (!currentDigest) {
|
||||||
throw new Error("Could not get current service image digest");
|
throw new Error("Could not get current service image digest");
|
||||||
|
|||||||
Reference in New Issue
Block a user