Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add target to forgo re-compiling proto for release pipeline. #56

Merged
merged 5 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
FROM amd64/golang:latest

ARG TAMAGO_VERSION
ARG PROTOC_VERSION
ARG PROTOC_GEN_GO_VERSION

# Install dependencies.
RUN apt-get update && apt-get install -y make
Expand All @@ -27,4 +25,4 @@ WORKDIR /build

COPY . .

RUN make trusted_os
RUN make trusted_os_release
24 changes: 15 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ GOFLAGS = -tags ${BUILD_TAGS} -trimpath -ldflags "-s -w -T ${TEXT_START} -E ${EN

#### primary targets ####

all: trusted_os_embedded_applet witnessctl
all: trusted_os_embedded_applet_signed witnessctl

elf: $(APP).elf

# This target builds the Trusted OS without signing it as it is intended to be
# used by the GCP build process and signed there.
# This target is only used for dev builds, since the proto definitions may
# change in development and require re-compilation of protos.
trusted_os: APP=trusted_os
trusted_os: DIR=$(CURDIR)/trusted_os
trusted_os: create_dummy_applet elf
trusted_os: create_dummy_applet proto elf

trusted_os_signed: trusted_os
echo "signing Trusted OS"
Expand All @@ -74,10 +74,10 @@ trusted_os_signed: trusted_os
${SIGN} -S -s ${OS_PRIVATE_KEY2} -m ${CURDIR}/bin/trusted_os.elf -x ${CURDIR}/bin/trusted_os.sig2; \
fi

trusted_os_embedded_applet: APP=trusted_os
trusted_os_embedded_applet: DIR=$(CURDIR)/trusted_os
trusted_os_embedded_applet: check_os_env copy_applet elf imx
trusted_os_embedded_applet:
trusted_os_embedded_applet_signed: APP=trusted_os
trusted_os_embedded_applet_signed: DIR=$(CURDIR)/trusted_os
trusted_os_embedded_applet_signed: check_os_env copy_applet proto elf imx
trusted_os_embedded_applet_signed:
echo "signing Trusted OS"
@if [ "${SIGN_PWD}" != "" ]; then \
echo -e "${SIGN_PWD}\n" | ${SIGN} -S -s ${OS_PRIVATE_KEY1} -m ${CURDIR}/bin/trusted_os.elf -x ${CURDIR}/bin/trusted_os.sig1; \
Expand All @@ -93,6 +93,12 @@ witnessctl: check_tamago
-ldflags "-s -w -X 'main.Build=${BUILD}' -X 'main.Revision=${REV}'" \
-o $(CURDIR)/bin/witnessctl

# This target builds the Trusted OS without signing it as it is intended to be
# used by the GCP build process and signed there.
trusted_os_release: APP=trusted_os
trusted_os_release: DIR=$(CURDIR)/trusted_os
trusted_os_release: create_dummy_applet elf

#### ARM targets ####

imx: $(APP).imx
Expand Down Expand Up @@ -173,5 +179,5 @@ qemu-gdb:

#### application target ####

$(APP).elf: check_tamago proto
$(APP).elf: check_tamago
cd $(DIR) && $(GOENV) $(TAMAGO) build -tags ${BUILD_TAGS} $(GOFLAGS) -o $(CURDIR)/bin/$(APP).elf
6 changes: 0 additions & 6 deletions release/cloudbuild_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ steps:
- build
- --build-arg
- TAMAGO_VERSION=${_TAMAGO_VERSION}
- --build-arg
- PROTOC_VERSION=${_PROTOC_VERSION}
- --build-arg
- PROTOC_GEN_GO_VERSION=${_PROTOC_GEN_GO_VERSION}
- -t
- builder-image
# Path is relative to the root of the repo.
Expand Down Expand Up @@ -75,8 +71,6 @@ substitutions:
# Build-related.
_TRUSTED_OS_BUCKET: trusted-os-artifacts-ci
_TAMAGO_VERSION: '1.20.6'
_PROTOC_VERSION: '24.2'
_PROTOC_GEN_GO_VERSION: '1.28.1'
_TEST_TAG_NAME: '0.1.2'
# Signing-related.
_REGION: europe-west2
Expand Down