-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·87 lines (74 loc) · 2.61 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Copyright (C) 2020, 2021, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
NAME:=console
DOCKER_IMAGE_NAME ?= ${NAME}-dev
DOCKER_IMAGE_TAG ?= local-$(shell git rev-parse --short HEAD)
KIND_KUBECONFIG ?= ${HOME}/.kube/config
CREATE_LATEST_TAG=0
JET_CLI_VERSION=10.1.0
CLUSTER_NAME ?= console-integ
VZ_UITEST_CONFIG_TEMPLATE ?= $(shell pwd)/integtest/config.uitest.json
VERRAZZANO_REPO_PATH ?= $(shell pwd)/../verrazzano
ifeq ($(MAKECMDGOALS),$(filter $(MAKECMDGOALS),push))
ifndef DOCKER_REPO
$(error DOCKER_REPO must be defined as the name of the docker repository where image will be pushed)
endif
ifndef DOCKER_NAMESPACE
$(error DOCKER_NAMESPACE must be defined as the name of the docker namespace where image will be pushed)
endif
ifndef DOCKER_IMAGE_NAME
$(error DOCKER_IMAGE_NAME must be defined as the name of the docker image that will be pushed)
endif
DOCKER_IMAGE_FULLNAME = ${DOCKER_REPO}/${DOCKER_NAMESPACE}/${DOCKER_IMAGE_NAME}
endif
.PHONY: all
all: build
.PHONY: npm-install
npm-install:
echo NodeJS version is $(shell node --version)
npm ci
ifndef JENKINS_URL
npm ci @oracle/ojet-cli@${JET_CLI_VERSION}
endif
.PHONY: check-formatting
check-formatting: npm-install
npm run prettier
.PHONY: lint-code
lint-code: check-formatting
npm run eslint
.PHONY: unit-test
unit-test: npm-install
export PATH=./node_modules/.bin:${PATH} && \
ojet build && \
pwd && \
ls -l node_modules/\@oracle/oraclejet/dist/types/ojmodel && \
ls -l web/js/libs/oj
echo $$PATH
sudo env "PATH=$$PATH" npm test
.PHONY: ojet-build
ojet-build: npm-install
PATH=./node_modules/.bin:${PATH} && \
ojet build --release
./calc_integrity_hash.sh
.PHONY: build
build: ojet-build
docker build --pull \
-t ${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} .
.PHONY: push
push: build
docker tag ${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} ${DOCKER_IMAGE_FULLNAME}:${DOCKER_IMAGE_TAG}
docker push ${DOCKER_IMAGE_FULLNAME}:${DOCKER_IMAGE_TAG}
if [ "${CREATE_LATEST_TAG}" == "1" ]; then \
docker tag ${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} ${DOCKER_IMAGE_FULLNAME}:latest; \
docker push ${DOCKER_IMAGE_FULLNAME}:latest; \
fi
.PHONY: run-ui-tests
run-ui-tests: npm-install
./integtest/scripts/edit_integ_test_config.sh ${VZ_UITEST_CONFIG_TEMPLATE} > tmp.uitestconfig.json
export VZ_UITEST_CONFIG=tmp.uitestconfig.json && \
npm run integtest
.PHONY: run-app-page-test
run-app-page-test: npm-install
./integtest/scripts/edit_integ_test_config.sh ${VZ_UITEST_CONFIG_TEMPLATE} > tmp.uitestconfig.json
export VZ_UITEST_CONFIG=tmp.uitestconfig.json && \
npm run app-page-test