Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
gzukel committed Apr 29, 2024
1 parent be70d73 commit 215b2e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions contrib/docker-scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 215b2e9

Please sign in to comment.