This repository has been archived by the owner on Oct 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (52 loc) · 1.67 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
.SILENT:
PYTHON_BIN=python3
SUDO=sudo
PIP_BIN=pip
# Colors
COLOR_RESET = \033[0m
COLOR_INFO = \033[32m
COLOR_COMMENT = \033[33m
## This help screen
help:
printf "${COLOR_COMMENT}Usage:${COLOR_RESET}\n"
printf " make [target]\n\n"
printf "${COLOR_COMMENT}Available targets:${COLOR_RESET}\n"
awk '/^[a-zA-Z\-\_0-9\.@]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf " ${COLOR_INFO}%-16s${COLOR_RESET}\t\t%s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
## Instal python dependencies
install_dependencies:
${SUDO} ${PIP_BIN} install -r $$(pwd)/requirements.txt
## Run unit tests
test:
${PYTHON_BIN} -m unittest discover -s ./tests
## Build python package
build:
${PYTHON_BIN} setup.py build
## Install python package
install_as_package:
${SUDO} ${PYTHON_BIN} setup.py install
## Remove build and temporary directories
clean:
${SUDO} rm -rf .eggs *.egg-info build
## Run the HTTP server
dev_http_run:
ssh-server-audit --config=$$(pwd)/examples/travis-config.yml
## Build expectations for test volume
dev_build_expectations:
ssh-server-audit --config=$$(pwd)/examples/travis-config.yml --build-expectations=test_vagrant_volume
## Set up a test SSH server containerized
setup_test_docker_host:
${SUDO} docker run -d --rm --publish=2422:22 wolnosciowiec/docker-alpine-sshd:7.5 -o LogLevel=DEBUG
## Build a docker container
build_docker_container:
${SUDO} docker build . -t wolnosciowiec/ssh-server-audit
## Run the docker container
run_docker_container:
${SUDO} docker run wolnosciowiec/ssh-server-audit