2020-04-15 04:56:00 +03:00
|
|
|
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
|
2020-04-30 08:22:11 +03:00
|
|
|
SERVER_BUILD_OUTPUT := $(BUILD_DIR)/_server_output
|
2021-03-02 10:25:32 +03:00
|
|
|
SHELL := /bin/bash
|
|
|
|
.SHELLFLAGS := -ce
|
2020-04-30 08:22:11 +03:00
|
|
|
|
|
|
|
.PHONY: load-server-image
|
|
|
|
load-server-image:
|
|
|
|
docker load -i '$(SERVER_BUILD_OUTPUT)/image.tar'
|
2020-04-15 04:56:00 +03:00
|
|
|
|
|
|
|
.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
|
2020-11-12 12:25:48 +03:00
|
|
|
./prepare_docker_context.sh
|
2020-04-15 04:56:00 +03:00
|
|
|
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
|
2021-02-17 07:20:19 +03:00
|
|
|
all: load-server-image build-cli-migrations-v2 test-cli-migrations-v2
|