diff --git a/Dockerfile b/Dockerfile index 3414b4a7a7..b4dbcd0693 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,9 +20,9 @@ RUN go mod download # Copy the rest of the source code and build the application COPY . . -RUN EXPECTED_MAJOR_VERSION=$(grep 'const releaseVersion = ' app/setup_handlers.go | awk -F'"' '{print $2}') && \ - make install VERSION="${EXPECTED_MAJOR_VERSION}" && \ - echo -n "${EXPECTED_MAJOR_VERSION}" > /go/delivery/zeta-node/EXPECTED_MAJOR_VERSION +RUN expected_major_version=$(grep 'const releaseVersion = ' app/setup_handlers.go | awk -F'"' '{print $2}') && \ + make install VERSION="${expected_major_version}" && \ + echo -n "${expected_major_version}" > /go/delivery/zeta-node/expected_major_version # Run Stage FROM alpine:3.18 @@ -48,7 +48,7 @@ RUN apk --no-cache add git jq bash curl nano vim tmux python3 libusb-dev linux-h # Copy the binaries from the build stage COPY --from=builder /go/bin/zetaclientd /usr/local/bin/zetaclientd COPY --from=builder /go/bin/zetacored /usr/local/bin/zetacored -COPY --from=builder /go/delivery/zeta-node/EXPECTED_MAJOR_VERSION /scripts/EXPECTED_MAJOR_VERSION +COPY --from=builder /go/delivery/zeta-node/expected_major_version /scripts/expected_major_version # Set the working directory WORKDIR /usr/local/bin diff --git a/contrib/docker-scripts/start.sh b/contrib/docker-scripts/start.sh index 0c2a1a4b0a..0e94a2001a 100644 --- a/contrib/docker-scripts/start.sh +++ b/contrib/docker-scripts/start.sh @@ -239,22 +239,22 @@ function start_network { if [ "${IS_LOCAL_DEVELOPMENT}" == "true" ]; then cp /usr/local/bin/zetacored ${DAEMON_HOME}/cosmovisor/genesis/bin/zetacored fi - EXPECTED_MAJOR_VERSION=$(cat /scripts/EXPECTED_MAJOR_VERSION) + expected_major_version=$(cat /scripts/expected_major_version) VISOR_VERSION=v$(${VISOR_NAME} version | tail -n 1 | tr -d '(devel)' | tr -d '\n') DAEMON_VERSION=$(${DAEMON_NAME} version) VISOR_MAJOR_VERSION=$(echo $VISOR_VERSION | grep -o '^v[0-9]*') DAEMON_MAJOR_VERSION=$(echo $DAEMON_VERSION | grep -o '^v[0-9]*') - logt "EXPECTED_MAJOR_VERSION: ${EXPECTED_MAJOR_VERSION}" + logt "expected_major_version: ${expected_major_version}" logt "VISOR_VERSION: ${VISOR_VERSION}" logt "DAEMON_VERSION: ${DAEMON_VERSION}" logt "VISOR_MAJOR_VERSION: ${VISOR_MAJOR_VERSION}" logt "DAEMON_MAJOR_VERSION: ${DAEMON_MAJOR_VERSION}" - if [ "$VISOR_MAJOR_VERSION" != "$EXPECTED_MAJOR_VERSION" ] || [ "$DAEMON_MAJOR_VERSION" != "$EXPECTED_MAJOR_VERSION" ]; then - logt "One or both versions don't match the expected major release version: $EXPECTED_MAJOR_VERSION" + if [ "$VISOR_MAJOR_VERSION" != "$expected_major_version" ] || [ "$DAEMON_MAJOR_VERSION" != "$expected_major_version" ]; then + logt "One or both versions don't match the expected major release version: $expected_major_version" else - logt "Both versions match the expected major release version: $EXPECTED_MAJOR_VERSION" + logt "Both versions match the expected major release version: $expected_major_version" fi if [ "$VISOR_VERSION" != "$DAEMON_VERSION" ]; then