Skip to content

Commit

Permalink
Add git revision of quickstart to quickstart boot log (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch authored Nov 20, 2023
1 parent f5ffe94 commit 2b237ba
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,19 @@ jobs:
# save can. Once buildx supports it we can update.
# https://github.com/docker/buildx/issues/847
- name: Build Quickstart Image
run: docker build --platform linux/${{ inputs.arch }} -f Dockerfile -t $IMAGE --label org.opencontainers.image.revision="${{ env.HEAD_SHA }}" . --build-arg STELLAR_CORE_IMAGE_REF=stellar-core:${{ inputs.arch }} --build-arg HORIZON_IMAGE_REF=stellar-horizon:${{ inputs.arch }} --build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:${{ inputs.arch }} --build-arg SOROBAN_RPC_IMAGE_REF=stellar-soroban-rpc:${{ inputs.arch }} --build-arg CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=${{ inputs.core_supports_enable_soroban_diagnostic_events }}
run: >
docker build
--platform linux/${{ inputs.arch }}
-f Dockerfile
-t $IMAGE
--label org.opencontainers.image.revision="${{ env.HEAD_SHA }}"
.
--build-arg REVISION="${{ env.HEAD_SHA }}"
--build-arg STELLAR_CORE_IMAGE_REF=stellar-core:${{ inputs.arch }}
--build-arg HORIZON_IMAGE_REF=stellar-horizon:${{ inputs.arch }}
--build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:${{ inputs.arch }}
--build-arg SOROBAN_RPC_IMAGE_REF=stellar-soroban-rpc:${{ inputs.arch }}
--build-arg CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=${{ inputs.core_supports_enable_soroban_diagnostic_events }}
- name: Save Quickstart Image
run: docker save $IMAGE -o /tmp/image
- name: Upload Quickstart Image
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ FROM $SOROBAN_RPC_IMAGE_REF AS soroban-rpc

FROM ubuntu:22.04

ARG REVISION
ENV REVISION $REVISION

EXPOSE 5432
EXPOSE 8000
EXPOSE 6060
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
__PHONY__: run logs build build-deps build-deps-core build-deps-horizon build-deps-friendbot build-deps-soroban-rpc

REVISION=$(shell git -c core.abbrev=no describe --always --exclude='*' --long --dirty)
TAG?=dev
CORE_REPO?=https://github.com/stellar/stellar-core.git
CORE_REF?=master
Expand Down Expand Up @@ -40,7 +41,13 @@ build-soroban-dev:

build:
$(MAKE) -j 4 build-deps
docker build -t stellar/quickstart:$(TAG) -f Dockerfile . --build-arg STELLAR_CORE_IMAGE_REF=stellar-core:$(CORE_REF) --build-arg HORIZON_IMAGE_REF=stellar-horizon:$(HORIZON_REF) --build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:$(FRIENDBOT_REF) --build-arg SOROBAN_RPC_IMAGE_REF=stellar-soroban-rpc:$(SOROBAN_RPC_REF) --build-arg CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=$(CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS)
docker build -t stellar/quickstart:$(TAG) -f Dockerfile . \
--build-arg REVISION=$(REVISION) \
--build-arg STELLAR_CORE_IMAGE_REF=stellar-core:$(CORE_REF) \
--build-arg HORIZON_IMAGE_REF=stellar-horizon:$(HORIZON_REF) \
--build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:$(FRIENDBOT_REF) \
--build-arg SOROBAN_RPC_IMAGE_REF=stellar-soroban-rpc:$(SOROBAN_RPC_REF) \
--build-arg CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=$(CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS)

build-deps: build-deps-core build-deps-horizon build-deps-friendbot build-deps-soroban-rpc

Expand Down
1 change: 1 addition & 0 deletions start
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function start() {
echo "Starting Stellar Quickstart"

echo "versions:"
echo " quickstart: $REVISION"
echo " stellar-core:"
echo "$(stellar-core version 2>/dev/null | sed 's/^/ /')"
echo " horizon:"
Expand Down

0 comments on commit 2b237ba

Please sign in to comment.