graphql-engine/server/Makefile
Vishnu Bharathi 6cfbde92e4 ci: add support for linux/arm64 docker image
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2933
GitOrigin-RevId: ceeab6164d8437703cd6e37e3dad9d63940ef966
2021-12-09 09:34:22 +00:00

45 lines
1.9 KiB
Makefile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

SHELL := /bin/bash
VERSION ?= $(shell ../scripts/get-version.sh)
export VERSION
registry := hasura
# This packager version is built using the packeger.df in the packaging folder:
# docker build -t "hasura/graphql-engine-packager:20210218" -f packager.df .
packager_ver := 20210218
SERVER_BUILD_OUTPUT ?= /build/_server_output
docs_output := /build/_server_output/docs.tar.gz
# Getting access to the built products with the `cabal v2-*` commands is really awkward; see
# <https://www.haskell.org/cabal/users-guide/nix-local-build.html#where-are-my-build-products> for a
# little more context. Ideally, we could use `cabal v2-install` for this, but `v2-install` does
# strange and complicated things, and I could not get it to work.
#
# This glob is a pretty heavy hammer designed to work regardless of `cabal-install` version (see the
# aforementioned link for why thats tricky). If `cabal v2-*` ever gets a better way to do this,
# please replace this with something less hacky.
executables_glob := ../dist-newstyle/build/*/*/graphql-engine-*/**/opt/build/{graphql-engine/graphql-engine,graphql-engine-tests/graphql-engine-tests,graphql-engine-integration-tests/graphql-engine-integration-tests}
# assumes this is built in circleci
ci-build:
## configure
cabal v2-update --project-file=cabal.project.ci
## build
cabal v2-build --project-file=cabal.project.ci
## install
mkdir -p '$(SERVER_BUILD_OUTPUT)'
echo '$(VERSION)' > '$(SERVER_BUILD_OUTPUT)/version.txt'
shopt -s failglob globstar && cp $(executables_glob) '$(SERVER_BUILD_OUTPUT)/'
# assumes this is built in circleci
ci-docs:
# build
cabal haddock
# copy
cd ../dist-newstyle/build/*/*/graphql-engine-*/**/doc/html/graphql-engine/ && tar czf $(docs_output) *
packager: packaging/packager.df
docker build -t '$(registry)/graphql-engine-packager:$(packager_ver)' -f packaging/packager.df ./packaging/
.PHONY: ci-build ci-docs packager