blob: 220c49653a0482f9ba743c734148e90c1bfbecfb [file] [log] [blame] [edit]
include ../make/bazel.mk
include ../make/docker.mk
# First create a list of all the modules that ./go/ts depends upon.
tsDependentModules := $(shell go list -f '{{ join .Imports "\n" }}' go.skia.org/infra/fiddlek/go/ts/ )
# Then use that list to find all the Go files that make up those dependent modules.
tsDependentFiles := $(shell echo $(tsDependentModules) | xargs -L 1 go list -f '{{ $$dir := .Dir }}{{ range .GoFiles }}{{ $$dir }}/{{ . }}{{ "\n" }}{{ end }}' )
./modules/json/index.ts: $(tsDependentFiles)
go generate ./go/...
fiddle_secwrap:
cd cpp; docker build --tag secwrap_builder .
# This doesn't actually make the built executable available, just tests that
# we can build it.
build: ./modules/json/index.ts fiddle_secwrap
$(BAZEL) build --config=mayberemote go/... modules/... pages/...
serve:
@echo "Bazel doesn't have a serve-all option."
@echo "For the module under development, try running something like:"
@echo "bazel run modules/fiddle-embed-sk:demo_page_server"
release-fiddle: build
$(BAZEL) run --config=mayberemote //fiddlek:push_fiddle_container
.PHONY: pull-skia-release-image
pull-skia-release-image:
# Pull down the most recently build Skia docker container.
$(DOCKER) pull gcr.io/skia-public/skia-release:prod
release-fiddler: build
$(BAZEL) run --config=mayberemote //fiddlek:push_fiddler_container
release: release-fiddle release-fiddler
# Used by the autodeployment framework:
# https://skia.googlesource.com/buildbot/+doc/main/docker_pushes_watcher/README.md
release-fiddler-ci: build
# COPY_FROM_DIR and STABLE_DOCKER_TAG env variables are expected to be
# set by the auto deploy mechanism,
cp $(COPY_FROM_DIR)/skia.tar.gz build/skia.tar.gz
${BAZEL} run //fiddlek:push_fiddler_container --workspace_status_command=bazel/override_container_label.sh
# Cleanup the build directory.
git checkout build/*
# Review section in README.md before running this target
push_I_am_really_sure: release
$(BAZEL) run --config=mayberemote //kube/go/pushk -- --use-temp-checkout fiddle fiddler
push_fiddle: release-fiddle
$(BAZEL) run --config=mayberemote //kube/go/pushk -- --use-temp-checkout fiddle
# Review section in README.md before running this target
push_fiddler_I_am_really_sure: release-fiddler
$(BAZEL) run --config=mayberemote //kube/go/pushk -- --use-temp-checkout fiddler
cli:
go install -v ./go/fiddlecli
test: testgo testjs
testjs:
$(BAZEL) test --config=mayberemote modules/...
testgo:
go test -v ./...
# This presumes a fiddler is available at port :8000 and scrapexchange is available at port :9000.
# You can either run a local copy of scrapexchange, or port-forward the production instance:
# kubectl port-forward service/scrapexchange 9000
.PHONY: run_local_fiddle
run_local_fiddle: build
../_bazel_bin/fiddlek/go/fiddle/fiddle_/fiddle --local --port=:8080 \
--source_image_dir=/etc/fiddle/source --scrapexchange=http://localhost:9000 \
--dist_dir=../_bazel_bin/fiddlek/pages/development
# Runs a local fiddler.
.PHONY: run_local_fiddler
run_local_fiddler:
$(DOCKER) run -ti -p8000:8000 --cap-add=SYS_PTRACE gcr.io/skia-public/fiddler:prod --fiddle_root=/tmp --checkout=/tmp/skia/skia/ --local