mirror of
https://github.com/taigrr/yq
synced 2025-01-18 04:53:17 -08:00
Task: Simplify development
The base directory has all shell scripts in scripts/ and all example/test files in examples/. A Makefile provides all the commands with helpful information. If a developer simply types `make` then vendor is properly updated, the code is formatted, linted, tested, built, acceptance test run, and installed. Linting errors resolved. Ignored test case (`TestParsePath`) updated to work as expected.
This commit is contained in:
34
Makefile.variables
Normal file
34
Makefile.variables
Normal file
@@ -0,0 +1,34 @@
|
||||
export PROJECT = yaml
|
||||
IMPORT_PATH := github.com/mikefarah/${PROJECT}
|
||||
|
||||
export GIT_COMMIT = $(shell git rev-parse --short HEAD)
|
||||
export GIT_DIRTY = $(shell test -n "$$(git status --porcelain)" && echo "+CHANGES" || true)
|
||||
export GIT_DESCRIBE = $(shell git describe --tags --always)
|
||||
LDFLAGS :=
|
||||
# LDFLAGS += -X ${IMPORT_PATH}/${PROJECT}.Commit=${GIT_COMMIT}
|
||||
# LDFLAGS += -X ${IMPORT_PATH}/${PROJECT}.Version=${GIT_DESCRIBE}
|
||||
|
||||
# Windows environment?
|
||||
CYG_CHECK := $(shell hash cygpath 2>/dev/null && echo 1)
|
||||
ifeq ($(CYG_CHECK),1)
|
||||
VBOX_CHECK := $(shell hash VBoxManage 2>/dev/null && echo 1)
|
||||
|
||||
# Docker Toolbox (pre-Windows 10)
|
||||
ifeq ($(VBOX_CHECK),1)
|
||||
ROOT := /${PROJECT}
|
||||
else
|
||||
# Docker Windows
|
||||
ROOT := $(shell cygpath -m -a "$(shell pwd)")
|
||||
endif
|
||||
else
|
||||
# all non-windows environments
|
||||
ROOT := $(shell pwd)
|
||||
endif
|
||||
|
||||
DEV_IMAGE := ${PROJECT}_dev
|
||||
|
||||
DOCKRUN := docker run --rm \
|
||||
-v ${ROOT}/vendor:/go/src \
|
||||
-v ${ROOT}:/${PROJECT}/src/${IMPORT_PATH} \
|
||||
-w /${PROJECT}/src/${IMPORT_PATH} \
|
||||
${DEV_IMAGE}
|
||||
Reference in New Issue
Block a user