This repository has been archived by the owner on Apr 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 108
/
Makefile
73 lines (59 loc) · 1.79 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
SHELL=/bin/bash
ifndef ELASTIC_VERSION
ELASTIC_VERSION=5.2.1
endif
ifdef STAGING_BUILD_NUM
VERSION_TAG=$(ELASTIC_VERSION)-${STAGING_BUILD_NUM}
KIBANA_DOWNLOAD_URL=http://staging.elastic.co/$(VERSION_TAG)/downloads/kibana/kibana-${ELASTIC_VERSION}-linux-x86_64.tar.gz
X_PACK_URL=http://staging.elastic.co/$(VERSION_TAG)/downloads/kibana-plugins/x-pack/x-pack-${ELASTIC_VERSION}.zip
else
VERSION_TAG=$(ELASTIC_VERSION)
KIBANA_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/kibana/kibana-${ELASTIC_VERSION}-linux-x86_64.tar.gz
X_PACK_URL=x-pack
endif
REGISTRY=docker.elastic.co
IMAGE=$(REGISTRY)/kibana/kibana
VERSIONED_IMAGE=$(IMAGE):$(VERSION_TAG)
LATEST_IMAGE=$(IMAGE):latest
export ELASTIC_VERSION
export KIBANA_DOWNLOAD_URL
export X_PACK_URL
export VERSIONED_IMAGE
export VERSION_TAG
BASE_IMAGE=$(REGISTRY)/kibana/kibana-ubuntu-base:latest
TEST_COMPOSE=docker-compose --file docker-compose.test.yml
test: flake8 clean build test-direct test-indirect
test-direct:
# Direct tests: Invoke the image in various ways and make assertions.
( \
source venv/bin/activate; \
py.test test/direct \
)
test-indirect:
# Indirect tests: Use a dedicated testing container to probe Kibana
# over the network.
$(TEST_COMPOSE) up -d elasticsearch kibana
$(TEST_COMPOSE) run --rm tester py.test -p no:cacheprovider /test/indirect || (make clean; false)
make clean
flake8: venv
( \
source venv/bin/activate; \
flake8 /test \
)
build:
docker-compose build --pull
push: build
docker push $(VERSIONED_IMAGE)
clean: clean-test
docker-compose down
docker-compose rm --force
clean-test:
$(TEST_COMPOSE) down
$(TEST_COMPOSE) rm --force
venv:
virtualenv --python=python3.5 venv
( \
source venv/bin/activate; \
pip install -r test/direct/requirements.txt; \
)
.PHONY: build clean flake8 push pytest test