mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 17:31:56 +03:00
bf76de3ab6
Co-authored-by: Aravind K P <8335904+scriptonist@users.noreply.github.com> GitOrigin-RevId: 484147cb31becf6742620219d1c2b96a66bdb667
46 lines
1.1 KiB
Makefile
46 lines
1.1 KiB
Makefile
PWD := $(shell pwd)
|
|
PARENT_DIR := $(shell dirname $(PWD))
|
|
VERSION ?= $(shell ../get-version.sh)
|
|
BUILD_DIR ?= /build
|
|
BINARY ?= $(BUILD_DIR)/_cli_output/binaries/cli-hasura-linux-amd64
|
|
IMAGE_TAG ?= cli-migrations
|
|
BUILD_OUTPUT ?= $(BUILD_DIR)/_cli_migrations_output
|
|
SERVER_BUILD_OUTPUT := $(BUILD_DIR)/_server_output
|
|
SHELL := /bin/bash
|
|
.SHELLFLAGS := -ce
|
|
|
|
.PHONY: load-server-image
|
|
load-server-image:
|
|
docker load -i '$(SERVER_BUILD_OUTPUT)/image.tar'
|
|
|
|
.PHONY: build-cli-migrations-v1
|
|
.ONESHELL:
|
|
build-cli-migrations-v1:
|
|
cd v1
|
|
cp ${BINARY} .
|
|
docker build -t ${IMAGE_TAG} .
|
|
docker save -o '$(BUILD_OUTPUT)/v1.tar' '$(IMAGE_TAG)'
|
|
|
|
.PHONY: test-cli-migrations-v1
|
|
.ONESHELL:
|
|
test-cli-migrations-v1:
|
|
cd v1/test
|
|
./test.sh
|
|
|
|
.PHONY: build-cli-migrations-v2
|
|
.ONESHELL:
|
|
build-cli-migrations-v2:
|
|
cd v2
|
|
./prepare_docker_context.sh
|
|
docker build -t '${IMAGE_TAG}-v2' .
|
|
docker save -o '$(BUILD_OUTPUT)/v2.tar' '$(IMAGE_TAG)-v2'
|
|
|
|
.PHONY: test-cli-migrations-v2
|
|
.ONESHELL:
|
|
test-cli-migrations-v2:
|
|
cd v2/test
|
|
./test.sh
|
|
|
|
.PHONY: all
|
|
all: load-server-image build-cli-migrations-v2 test-cli-migrations-v2
|