From d77b75c22f3f507509d2e8fb526fc8e7826b637e Mon Sep 17 00:00:00 2001 From: David Dollar Date: Thu, 30 Jan 2020 16:29:22 -0500 Subject: [PATCH] ci: install racks using cli (#102) * ci: install using cli * fix tokens for cli install * wait to start health checking --- .github/workflows/release.yml | 17 +---------------- ci/debug.sh | 17 +++++++++++++++++ ci/install.sh | 5 +---- ci/login.sh | 8 -------- ci/secrets.sh | 6 +++--- ci/uninstall.sh | 4 +--- pkg/router/router.go | 2 ++ 7 files changed, 25 insertions(+), 34 deletions(-) create mode 100755 ci/debug.sh delete mode 100755 ci/login.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96e172b..4fb46a5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -96,27 +96,12 @@ jobs: run: ci/cli.sh - name: install run: ci/install.sh - - name: login - run: ci/login.sh - name: wait run: sleep 300 - name: test run: ci/test.sh - name: debug - run: | - export KUBECONFIG=~/.kube/config.${{ matrix.provider }}.${RACK_NAME} - set -x - kubectl get node - kubectl describe node - kubectl get all -n ${RACK_NAME}-system || true - kubectl logs deployment/api -n ${RACK_NAME}-system || true - kubectl logs deployment/atom -n ${RACK_NAME}-system || true - kubectl logs deployment/registry -n ${RACK_NAME}-system || true - kubectl logs deployment/router -n ${RACK_NAME}-system || true - kubectl get event -n ${RACK_NAME}-system || true - kubectl get all -n ${RACK_NAME}-httpd || true - kubectl logs deployment/web -n ${RACK_NAME}-httpd || true - kubectl get event -n ${RACK_NAME}-httpd || true + run: ci/debug.sh if: always() - name: uninstall run: ci/uninstall.sh diff --git a/ci/debug.sh b/ci/debug.sh new file mode 100755 index 0000000..42fd307 --- /dev/null +++ b/ci/debug.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +export KUBECONFIG=~/.kube/config.${PROVIDER}.${RACK_NAME} + +set -x + +kubectl get node +kubectl describe node +kubectl get all -n ${RACK_NAME}-system || true +kubectl logs deployment/api -n ${RACK_NAME}-system || true +kubectl logs deployment/atom -n ${RACK_NAME}-system || true +kubectl logs deployment/registry -n ${RACK_NAME}-system || true +kubectl logs deployment/router -n ${RACK_NAME}-system || true +kubectl get event -n ${RACK_NAME}-system || true +kubectl get all -n ${RACK_NAME}-httpd || true +kubectl logs deployment/web -n ${RACK_NAME}-httpd || true +kubectl get event -n ${RACK_NAME}-httpd || true diff --git a/ci/install.sh b/ci/install.sh index d17f3ff..3886655 100755 --- a/ci/install.sh +++ b/ci/install.sh @@ -1,7 +1,4 @@ #!/bin/bash set -ex -o pipefail -cd install/${PROVIDER} - -terraform init -terraform apply -var name=${RACK_NAME} -var release=${VERSION} -auto-approve \ No newline at end of file +convox rack install ${PROVIDER} ${RACK_NAME} \ No newline at end of file diff --git a/ci/login.sh b/ci/login.sh deleted file mode 100755 index e7ffe8c..0000000 --- a/ci/login.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -cd install/${PROVIDER} - -RACK_URL=$(terraform output rack_url) - -echo "::add-mask::${RACK_URL}" -echo "::set-env name=RACK_URL::${RACK_URL}" \ No newline at end of file diff --git a/ci/secrets.sh b/ci/secrets.sh index d83a946..4cbc262 100755 --- a/ci/secrets.sh +++ b/ci/secrets.sh @@ -17,9 +17,9 @@ azure) export_secret ARM_TENANT_ID ;; do) - export_secret TF_VAR_access_id - export_secret TF_VAR_secret_key - export_secret TF_VAR_token + export_secret DIGITALOCEAN_ACCESS_ID + export_secret DIGITALOCEAN_SECRET_KEY + export_secret DIGITALOCEAN_TOKEN ;; gcp) export_secret GOOGLE_CREDENTIALS diff --git a/ci/uninstall.sh b/ci/uninstall.sh index 9be72f0..bab4296 100755 --- a/ci/uninstall.sh +++ b/ci/uninstall.sh @@ -1,6 +1,4 @@ #!/bin/bash set -ex -o pipefail -cd install/${PROVIDER} - -terraform destroy -var name=${RACK_NAME} -auto-approve -lock=false +convox rack uninstall ${RACK_NAME} \ No newline at end of file diff --git a/pkg/router/router.go b/pkg/router/router.go index 65de973..35d2123 100644 --- a/pkg/router/router.go +++ b/pkg/router/router.go @@ -296,6 +296,8 @@ func (r *Router) generateCertificateCA(hello *tls.ClientHelloInfo) (*tls.Certifi // try to request every known host on a timer to trigger things like // certificate generation before the user gets to them func (r *Router) healthTicker() { + time.Sleep(60 * time.Second) + for range time.Tick(healthTick) { if err := r.healthTick(); err != nil { fmt.Printf("ns=router at=health.ticker error=%v\n", err)