| # 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 ../make/clusters.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 |
| |
| # push-helper is used by the below targets to apply k8s configurations. |
| .PHONY: push-helper |
| push-helper: kube-conf-gen deployment-dirs |
| go install -v ./go/push-helper |
| |
| # 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 push-helper setup-internal-config-repo |
| push-helper --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 push-helper setup-internal-config-repo |
| push-helper --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 push-helper setup-internal-config-repo |
| push-helper --external --internal --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 push-helper setup-internal-config-repo |
| push-helper --external --internal --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 push-helper setup-internal-config-repo |
| push-helper --external --internal --update-config --update-be-image --update-fe-image --commit-with-msg="$(MESSAGE)" --use-tmp-checkout |