Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
[6.1] Move package directory out of /var/lib/gravity (#2284)
Browse files Browse the repository at this point in the history
* Remove unused Makefile variables.
(cherry picked from commit 1196e2c)
* Remove unused robotest targets.
(cherry picked from commit 5c60ac3)
* Remove trailing / from top directory.
(cherry picked from commit 203edad)
* Move gravity --state-dir cache to build dir.
(cherry picked from commit 3a06b8a)
* Remove old assets/robotest content.
(cherry picked from commit 6a1f402)
* Update e.
  • Loading branch information
wadells authored Oct 28, 2020
1 parent e46900e commit 1a753b9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 300 deletions.
58 changes: 3 additions & 55 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# - make install : build via `go install`. The output goes into GOPATH/bin/
# - make clean : remove the build output and artifacts
#
TOP := $(dir $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
TOP := $(realpath $(dir $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))))

OPS_URL ?=

Expand Down Expand Up @@ -150,14 +150,10 @@ TELEKUBE_OUT := $(GRAVITY_BUILDDIR)/telekube.tar
TF_PROVIDER_GRAVITY_OUT := $(GRAVITY_BUILDDIR)/terraform-provider-gravity
TF_PROVIDER_GRAVITYENTERPRISE_OUT := $(GRAVITY_BUILDDIR)/terraform-provider-gravityenterprise

GRAVITY_DIR := /var/lib/gravity
GRAVITY_ASSETS_DIR := /usr/local/share/gravity

LOCAL_OPSCENTER_HOST ?= opscenter.localhost.localdomain
LOCAL_OPSCENTER_DIR := $(GRAVITY_DIR)/opscenter
LOCAL_ETCD_DIR := $(GRAVITY_DIR)/etcd
LOCAL_OPS_URL := https://$(LOCAL_OPSCENTER_HOST):33009
LOCAL_STATE_DIR ?= $(LOCAL_OPSCENTER_DIR)/read

LOCAL_STATE_DIR ?= $(GRAVITY_BUILDDIR)/state

# Build artifacts published to S3
GRAVITY_PUBLISH_TARGETS := $(GRAVITY_OUT) \
Expand All @@ -170,8 +166,6 @@ GRAVITY_PUBLISH_TARGETS := $(GRAVITY_OUT) \
$(TELEKUBE_APP_OUT) \
$(TILLER_APP_OUT)

TELEPORT_DIR = /var/lib/teleport

GRAVITY_EXTRA_OPTIONS ?=

# Address of OpsCenter to publish telekube binaries and artifacts to
Expand Down Expand Up @@ -615,48 +609,6 @@ wizard-gen: K8S_OUT := kubernetes-$(GRAVITY_VERSION).tar.gz
wizard-gen:
gravity ops create-wizard --ops-url=$(LOCAL_OPS_URL) gravitational.io/telekube:0.0.0+latest /tmp/telekube

#
# robotest-installer builds an installer tarball for use in robotest
# Resulting installer URL is written to a properies file specified with BUILDPROPS
#
.PHONY: robotest-installer
robotest-installer: TMPDIR := $(shell mktemp -d)
robotest-installer: BUILDPROPS ?= build.properties
robotest-installer: LOCAL_STATE_DIR := $(TMPDIR)/state
robotest-installer: EXPORT_DIR := $(LOCAL_STATE_DIR)/export
robotest-installer: EXPORT_APP_TARBALL := $(EXPORT_DIR)/app.tar.gz
robotest-installer: ROBOTEST_APP_PACKAGE ?= $(TELEKUBE_APP_PKG)
robotest-installer: ROBOTEST_APP_PACKAGE_SRCDIR ?= $(TOP)/assets/telekube
robotest-installer: ROBO_BUCKET_URL = s3://builds.gravitational.io/robotest
robotest-installer: ROBO_GRAVITY_BUCKET := $(ROBO_BUCKET_URL)/gravity/$(GRAVITY_VERSION)
robotest-installer: INSTALLER_FILE := $(subst /,-,$(subst :,-,$(ROBOTEST_APP_PACKAGE)))-$(GRAVITY_VERSION)-installer.tar.gz
robotest-installer: INSTALLER_URL := $(ROBO_BUCKET_URL)/$(INSTALLER_FILE)
robotest-installer: robotest-publish-gravity
robotest-installer:
# Reset properties file
@> $(BUILDPROPS)
@mkdir -p $(TMPDIR)/state/export
@$(MAKE) packages LOCAL_STATE_DIR=$(LOCAL_STATE_DIR)
@$(GRAVITY_BUILDDIR)/gravity package export \
--state-dir=$(LOCAL_STATE_DIR) \
$(ROBOTEST_APP_PACKAGE) \
$(EXPORT_APP_TARBALL)
@tar xvf $(EXPORT_APP_TARBALL) -C $(EXPORT_DIR)/ --strip-components=1 resources/app.yaml
@$(GRAVITY_BUILDDIR)/tele --debug build \
--state-dir=$(LOCAL_STATE_DIR) \
$(EXPORT_DIR)/app.yaml -o $(INSTALLER_FILE)
aws s3 cp --region us-east-1 $(INSTALLER_FILE) $(INSTALLER_URL)
# Jenkins: downstream job configuration
echo "ROBO_INSTALLER_URL=$(INSTALLER_URL)" >> $(BUILDPROPS)
echo "GRAVITY_VERSION=$(GRAVITY_VERSION)" >> $(BUILDPROPS)
@rm -rf $(TMPDIR)

.PHONY: robotest-publish-gravity
robotest-publish-gravity:
aws s3 cp --region us-east-1 $(GRAVITY_BUILDDIR)/gravity \
$(ROBO_GRAVITY_BUCKET)/ \
--metadata version=$(GRAVITY_VERSION)

#
# number of environment variables are expected to be set
# see https://github.com/gravitational/robotest/blob/master/suite/README.md
Expand All @@ -669,10 +621,6 @@ robotest-run-suite:
robotest-run-nightly:
./build.assets/robotest/run.sh nightly $(shell pwd)/upgrade_from

.PHONY: robotest-installer-ready
robotest-installer-ready:
mv $(GRAVITY_BUILDDIR)/telekube.tar $(GRAVITY_BUILDDIR)/telekube_ready.tar

.PHONY: dev
dev: goinstall

Expand Down
244 changes: 0 additions & 244 deletions assets/robotest/terraform.tf

This file was deleted.

2 changes: 1 addition & 1 deletion e
Submodule e updated from 447292 to c101c4

0 comments on commit 1a753b9

Please sign in to comment.