Add the organic AST explorer to the CI builds for the homepage.

This commit is contained in:
Tom Alexander
2024-01-27 23:07:01 -05:00
parent 57dd72fb91
commit d7c2a34c8e
4 changed files with 389 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
FROM rustlang/rust:nightly-alpine3.17
RUN apk add --no-cache musl-dev make bash
RUN rustup target add wasm32-unknown-unknown
RUN cargo install wasm-bindgen-cli
CMD ["make", "wasm"]

52
docker/organic/Makefile Normal file
View File

@@ -0,0 +1,52 @@
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
OS:=$(shell uname -s)
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
endif
.RECIPEPREFIX = >
IMAGE_NAME:=homepage-build-organic
# REMOTE_REPO:=harbor.fizz.buzz/private
TARGET :=
.PHONY: help
help:
> @grep -h "##" $(MAKEFILE_LIST) | grep -v grep | sed -E 's/^([^:]*): *## */\1: /'
.PHONY: build
build: ## Build the docker image.
> docker build --tag $(IMAGE_NAME) --target=$(TARGET) --file Dockerfile ../../
.PHONY: push
push: ## Push the docker image to a remote repository.
ifdef REMOTE_REPO
> docker tag $(IMAGE_NAME) $(REMOTE_REPO)/$(IMAGE_NAME)
> docker push $(REMOTE_REPO)/$(IMAGE_NAME)
else
> @echo "REMOTE_REPO not defined, not pushing to a remote repo."
endif
.PHONY: clean
clean:
> docker rmi $(IMAGE_NAME)
ifdef REMOTE_REPO
> docker rmi $(REMOTE_REPO)/$(IMAGE_NAME)
else
> @echo "REMOTE_REPO not defined, not removing from remote repo."
endif
.PHONY: run
run: build
run: ## Launch the docker image
> docker run --rm -i -t $(IMAGE_NAME)
.PHONY: shell
shell: ## Launch an interactive shell inside the docker image.
shell: build
> docker run --rm -i -t --entrypoint /bin/bash --mount type=tmpfs,destination=/tmp $(IMAGE_NAME)