From 0c4f4d6f59c1f755135b88d49f3301ccefd2d890 Mon Sep 17 00:00:00 2001 From: Gianluca Arbezzano Date: Mon, 14 Sep 2020 11:27:20 +0200 Subject: [PATCH] Single place for all the tink stack version Tinkerbell is made of different components as we all know at this point. Sandbox had those versions all over the places. This PR moves them as part of the `envrc` file. Signed-off-by: Gianluca Arbezzano --- deploy/docker-compose.yml | 8 ++++---- deploy/vagrant/scripts/tinkerbell.sh | 6 +++--- generate-envrc.sh | 13 ++++++++++--- setup.sh | 6 +++--- test/_vagrant/vagrant_test.go | 2 +- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 4207992..06d54f8 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -1,7 +1,7 @@ version: "2.1" services: tink-server: - image: quay.io/tinkerbell/tink:sha-adb49da + image: ${TINKERBELL_TINK_SERVER_IMAGE} restart: unless-stopped environment: FACILITY: ${FACILITY:-onprem} @@ -52,7 +52,7 @@ services: retries: 30 tink-cli: - image: quay.io/tinkerbell/tink-cli:sha-adb49da + image: ${TINKERBELL_TINK_CLI_IMAGE} restart: unless-stopped environment: TINKERBELL_GRPC_AUTHORITY: 127.0.0.1:42113 @@ -89,7 +89,7 @@ services: network_mode: host boots: - image: quay.io/tinkerbell/boots:327-58ab49913b5498908b16e2607d265a61a05f73b6 + image: ${TINKERBELL_TINK_BOOTS_IMAGE} restart: unless-stopped network_mode: host command: -dhcp-addr 0.0.0.0:67 -tftp-addr $TINKERBELL_HOST_IP:69 -http-addr $TINKERBELL_HOST_IP:80 -log-level DEBUG @@ -133,7 +133,7 @@ services: - ./state/webroot:/usr/share/nginx/html/ hegel: - image: quay.io/tinkerbell/hegel:196-fa897aa020769db8becb9be29adaeb6be92a7fc7 + image: ${TINKERBELL_TINK_HEGEL_IMAGE} restart: unless-stopped network_mode: host environment: diff --git a/deploy/vagrant/scripts/tinkerbell.sh b/deploy/vagrant/scripts/tinkerbell.sh index c9a41e8..3c03f0c 100644 --- a/deploy/vagrant/scripts/tinkerbell.sh +++ b/deploy/vagrant/scripts/tinkerbell.sh @@ -80,12 +80,12 @@ main() ( sudo apt-get install -y jq fi - if [ ! -f ./envrc ]; then - ./generate-envrc.sh eth1 >envrc + if [ ! -f ./.env ]; then + ./generate-envrc.sh eth1 > .env fi # shellcheck disable=SC1091 - . ./envrc + . ./.env make_certs_writable diff --git a/generate-envrc.sh b/generate-envrc.sh index bbc357a..a7eb7a2 100755 --- a/generate-envrc.sh +++ b/generate-envrc.sh @@ -52,6 +52,15 @@ generate_envrc() ( local registry_password registry_password=$(generate_password) cat < envrc" + err "Usage: $0 network-interface-name > .env" exit 1 fi diff --git a/setup.sh b/setup.sh index e096224..9a097fb 100755 --- a/setup.sh +++ b/setup.sh @@ -8,7 +8,7 @@ set -eu # See https://tinkerbell.org/setup for the installation steps. # file to hold all environment variables -ENV_FILE=envrc +ENV_FILE=.env SCRATCH=$(mktemp -d -t tmp.XXXXXXXXXX) readonly SCRATCH @@ -407,7 +407,7 @@ bootstrap_docker_registry() ( # osie looks for tink-worker:latest, so we have to play with it a bit # https://github.com/tinkerbell/osie/blob/master/apps/workflow-helper.sh#L66 - docker_mirror_image "quay.io/tinkerbell/tink-worker:sha-adb49da" "${TINKERBELL_HOST_IP}/tink-worker:latest" + docker_mirror_image "${TINKERBELL_TINK_WORKER_IMAGE}" "${TINKERBELL_HOST_IP}/tink-worker:latest" ) setup_docker_registry() ( @@ -482,7 +482,7 @@ check_prerequisites() ( ) whats_next() ( - echo "$NEXT 1. Enter /vagrant/deploy and run: source ../envrc; docker-compose up -d" + echo "$NEXT 1. Enter /vagrant/deploy and run: source ../.env; docker-compose up -d" echo "$BLANK 2. Try executing your fist workflow." echo "$BLANK Follow the steps described in https://tinkerbell.org/examples/hello-world/ to say 'Hello World!' with a workflow." ) diff --git a/test/_vagrant/vagrant_test.go b/test/_vagrant/vagrant_test.go index bdce7ea..7d6b0c5 100644 --- a/test/_vagrant/vagrant_test.go +++ b/test/_vagrant/vagrant_test.go @@ -35,7 +35,7 @@ func TestVagrantSetupGuide(t *testing.T) { } }() - _, err = machine.Exec(ctx, "cd /vagrant/deploy && source ../envrc && docker-compose up -d") + _, err = machine.Exec(ctx, "cd /vagrant/deploy && source ../.env && docker-compose up -d") if err != nil { t.Fatal(err) }