Skip to content

Commit

Permalink
sed fixes for update.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
cheran-senthil authored Jan 15, 2025
1 parent a063267 commit 14d26d1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions content-node/docker-compose/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@ if [ -n "$1" ]; then

# Update docker-compose.yml with new image tag
log "Updating docker-compose.yml with new image tag..."
sed -i "s|earthfast/content-node:.*|earthfast/content-node:${COMMIT_HASH}|g" docker-compose.yml
sed -i "s|earthfast/content-node:.*|earthfast/content-node:${COMMIT_HASH}|" docker-compose.yml
check_status "Update image tag in docker-compose.yml"
else
# Extract current hash from docker-compose.yml
CURRENT_HASH=$(grep "earthfast/content-node:" docker-compose.yml | sed 's/.*earthfast\/content-node:\(.*\)"/\1/')
log "Using existing commit hash from docker-compose.yml: $CURRENT_HASH"
CURRENT_HASH=$(grep -A1 "image: earthfast/content-node:" docker-compose.yml | tail -n1 | awk '{print $NF}')
log "Using existing commit hash: $CURRENT_HASH"
fi

# Verify the image tag
HASH_TO_USE=${COMMIT_HASH:-$CURRENT_HASH}
log "Verifying image tag..."
grep "earthfast/content-node:${HASH_TO_USE}" docker-compose.yml > /dev/null
check_status "Verify image tag in docker-compose.yml"

Expand Down

0 comments on commit 14d26d1

Please sign in to comment.