Skip to content

Commit

Permalink
Add distributor URL substitution (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter authored Dec 13, 2023
1 parent d69b358 commit ccd6ea5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARG APPLET_PUBLIC_KEY
ARG OS_PUBLIC_KEY1
ARG OS_PUBLIC_KEY2
ARG GIT_SEMVER_TAG
ARG REST_DISTRIBUTOR_BASE_URL

# Install dependencies.
RUN apt-get update && apt-get install -y git make wget
Expand Down Expand Up @@ -37,6 +38,7 @@ ENV FT_LOG_URL=${FT_LOG_URL} \
APPLET_PUBLIC_KEY="/tmp/applet.pub" \
OS_PUBLIC_KEY1="/tmp/os1.pub" \
OS_PUBLIC_KEY2="/tmp/os2.pub" \
GIT_SEMVER_TAG=${GIT_SEMVER_TAG}
GIT_SEMVER_TAG=${GIT_SEMVER_TAG} \
REST_DISTRIBUTOR_BASE_URL=${REST_DISTRIBUTOR_BASE_URL}

RUN make trusted_applet_nosign
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ BUILD_EPOCH := $(shell /bin/date -u "+%s")
BUILD_TAGS = linkramsize,linkramstart,disable_fr_auth,linkprintk,nostatfs
REV = $(shell git rev-parse --short HEAD 2> /dev/null)
GIT_SEMVER_TAG ?= $(shell (git describe --tags --exact-match --match 'v*.*.*' 2>/dev/null || git describe --match 'v*.*.*' --tags 2>/dev/null || git describe --tags 2>/dev/null || echo -n v0.0.${BUILD_EPOCH}+`git rev-parse HEAD`) | tail -c +2 )
FT_BIN_URL ?= "http://$(shell hostname --fqdn):9944/artefacts/"
FT_LOG_URL ?= "http://$(shell hostname --fqdn):9944/log/"
REST_DISTRIBUTOR_BASE_URL ?= "https://api.transparency.dev"
FT_BIN_URL ?= http://$(shell hostname --fqdn):9944/artefacts/
FT_LOG_URL ?= http://$(shell hostname --fqdn):9944/log/
REST_DISTRIBUTOR_BASE_URL ?= https://api.transparency.dev

TAMAGO_SEMVER = $(shell [ -n "${TAMAGO}" -a -x "${TAMAGO}" ] && ${TAMAGO} version | sed 's/.*go\([0-9]\.[0-9]*\.[0-9]*\).*/\1/')
MINIMUM_TAMAGO_VERSION=1.21.3
Expand Down
2 changes: 2 additions & 0 deletions release/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ steps:
- --build-arg=APPLET_PUBLIC_KEY=${_APPLET_PUBLIC_KEY}
- --build-arg=OS_PUBLIC_KEY1=${_OS_PUBLIC_KEY1}
- --build-arg=OS_PUBLIC_KEY2=${_OS_PUBLIC_KEY2}
- --build-arg=REST_DISTRIBUTOR_BASE_URL=${_REST_DISTRIBUTOR_BASE_URL}
- -t
- builder-image
# Path is relative to the root of the repo.
Expand Down Expand Up @@ -129,3 +130,4 @@ substitutions:
_APPLET_PUBLIC_KEY: transparency.dev-aw-applet-prod+f022187a+AZSnFa8GxH+jHV6ahELk6peqVObbPKrYAdYyMjrzNF35
_OS_PUBLIC_KEY1: transparency.dev-aw-os-prod+03170554+AV7mmRamQp6VC9CutzSXzqtNhYNyNmQQRcLX07F6qlC1
_OS_PUBLIC_KEY2: TODO
_REST_DISTRIBUTOR_BASE_URL: https://api.transparency.dev
2 changes: 2 additions & 0 deletions release/cloudbuild_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ steps:
--build-arg=OS_PUBLIC_KEY1=${_OS_PUBLIC_KEY1} \
--build-arg=OS_PUBLIC_KEY2=${_OS_PUBLIC_KEY2} \
--build-arg=GIT_SEMVER_TAG=$(cat /workspace/fake_tag) \
--build-arg=REST_DISTRIBUTOR_BASE_URL=${_REST_DISTRIBUTOR_BASE_URL} \
-t builder-image \
.
# Prepare a container with a copy of the artifacts.
Expand Down Expand Up @@ -128,3 +129,4 @@ substitutions:
_APPLET_PUBLIC_KEY: transparency.dev-aw-applet-ci+3ff32e2c+AV1fgxtByjXuPjPfi0/7qTbEBlPGGCyxqr6ZlppoLOz3
_OS_PUBLIC_KEY1: transparency.dev-aw-os1-ci+7a0eaef3+AcsqvmrcKIbs21H2Bm2fWb6oFWn/9MmLGNc6NLJty2eQ
_OS_PUBLIC_KEY2: transparency.dev-aw-os2-ci+af8e4114+AbBJk5MgxRB+68KhGojhUdSt1ts5GAdRIT1Eq9zEkgQh
_REST_DISTRIBUTOR_BASE_URL: https://api.transparency.dev

0 comments on commit ccd6ea5

Please sign in to comment.