blob: 01783d5526e053e070a2fce1be9a5e1582da22e8 [file] [log] [blame]
# This makefile is used to compile Autoroller code, build Docker images
# containing the same, and generate, apply, and push Kubernetes configs
# for the autorollers.
VULCANIZE1=true
# The list of files we want to go into core.js, which is concat'd and
# minified. These files should be either present in the project, brought
# into third_party/bower_compoents via bower, or in node_modules.
CORE_SOURCE_FILES = node_modules/native-promise-only/npo.js \
third_party/bower_components/webcomponentsjs/webcomponents.min.js \
../res/js/common.js
BOWER_DIR=third_party/bower_components
include ../go/skiaversion/skiaversion.mk
include ../kube/kube.mk
include ../webtools/webtools.mk
.PHONY: autoroll-fe
autoroll-fe: core_js elements_html skiaversion
ln -sf ../../res res/imp/res
CGO_ENABLED=0 GOOS=linux go install -a ./go/autoroll-fe
.PHONY: autoroll-be
autoroll-be: skiaversion
GOOS=linux go install -a ./go/autoroll-be
.PHONY: autoroll-google3
autoroll-google3: skiaversion
CGO_ENABLED=0 GOOS=linux go install -a ./go/autoroll-google3
.PHONY: all
all: autoroll-fe autoroll-be autoroll-google3
# Build debug versions of core.js and elements.html.
.PHONY: debug
debug: clean_webtools debug_core_js debug_elements_html
ROLLER_INTERNAL_CONFIG_DIR = "/tmp/skia-autoroll-internal-config"
USE_INTERNAL_CONFIG_DIR_PROMPT ?= $$(bash -c 'read -s -p "The checkout in $(ROLLER_INTERNAL_CONFIG_DIR) is dirty. Would you still like to use it? (y/n): " ans; echo $$ans')
setup-internal-config-repo:
if [[ ! -d $(ROLLER_INTERNAL_CONFIG_DIR) ]]; then \
git clone https://skia.googlesource.com/skia-autoroll-internal-config.git $(ROLLER_INTERNAL_CONFIG_DIR); \
else \
git -C $(ROLLER_INTERNAL_CONFIG_DIR) fetch && \
git -C $(ROLLER_INTERNAL_CONFIG_DIR) diff --quiet origin/master || \
if [ $$? -ne 0 ]; then \
if [[ "$(USE_INTERNAL_CONFIG_DIR_PROMPT)" != "y" ]]; then \
echo "Exiting"; exit 1; \
fi; \
fi; \
fi
# These targets build kubernetes releases.
.PHONY: release-be
release-be: autoroll-be build_base_cipd_release
./build_backend_release
.PHONY: release-fe
release-fe: autoroll-fe
./build_frontend_release
.PHONY: release-google3
release-google3: autoroll-google3 setup-internal-config-repo
CONFIG_DIR="$(ROLLER_INTERNAL_CONFIG_DIR)" ./build_google3_release "$(MESSAGE)"
.PHONY: release-all
release-all: release-fe release-be release-google3
# autoroll-pusher is used by the below targets to apply k8s configurations.
.PHONY: autoroll-pusher
autoroll-pusher: kube-conf-gen deployment-dirs
go install -v ./go/autoroll-pusher
# apply-roller generates a new backend release build and applies it, along with
# the current roller config file(s), to the roller(s) matching the ROLLER
# environment variable. Also updates the frontend with the current roller
# config(s) but does not change the frontend build.
.PHONY: apply-roller
apply-roller: release-be autoroll-pusher setup-internal-config-repo
autoroll-pusher --roller="$(ROLLER)" --update-config --update-be-image
# push-roller is the same as apply-roller, but it also commits and pushes the
# modified kubernetes config files into the git repo, using the commit message
# from the MESSAGE environment variable.
.PHONY: push-roller
push-roller: release-be autoroll-pusher setup-internal-config-repo
autoroll-pusher --roller="$(ROLLER)" --update-config --update-be-image --commit-with-msg="$(MESSAGE)" --use-tmp-checkout
# push-be generates a new backend release build and applies it to ALL rollers,
# then commits and pushes the modified kubernetes config files into the git
# repo, using the commit message from the MESSAGE environment variable. Does NOT
# update the roller config files used by the backends.
.PHONY: push-be
push-be: release-be autoroll-pusher setup-internal-config-repo
autoroll-pusher --update-be-image --commit-with-msg="$(MESSAGE)" --use-tmp-checkout
# push-fe generates a new frontend release build, applies it, and commits and
# pushes the modified kubernetes config files into the git repo, using the
# commit message from the MESSAGE environment variable. Does NOT update the
# roller config files used by the frontends.
.PHONY: push-fe
push-fe: release-fe autoroll-pusher setup-internal-config-repo
autoroll-pusher --update-fe-image --commit-with-msg="$(MESSAGE)" --use-tmp-checkout
# push-all generates new frontend and backend release builds, applies them along
# with the current roller config files(s), and commits and pushes the modified
# kubernetes config files into the git repo, using the commit message from the
# MESSAGE environment variable.
.PHONY: push-all
push-all: release-be release-fe autoroll-pusher setup-internal-config-repo
autoroll-pusher --update-config --update-be-image --update-fe-image --commit-with-msg="$(MESSAGE)" --use-tmp-checkout
# validate runs the validate_autoroll_config task driver using the provided
# CONFIG variable, which may be a single config file or a directory containing
# config files.
.PHONY: validate
validate:
go run ../infra/bots/task_drivers/validate_autoroll_configs/validate_autoroll_configs.go --local --config="$(CONFIG)"