-
Notifications
You must be signed in to change notification settings - Fork 23
/
Makefile
95 lines (78 loc) · 3.93 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
88
89
90
91
92
93
94
95
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
STAGE := ${STAGE}
STAGE := $(if $(STAGE),$(STAGE),testing)
all:
@echo 'Available make targets:'
@grep '^[^#[:space:]^\.PHONY.*].*:' Makefile
docker-build:
docker build -t mozillaiam/cis-dev-preview:latest .
docker-run:
@echo "Starting Docker..."
@echo "/!\ Creating a fake database of users WILL TAKE SOME TIME."
@echo "/!\ Wait a bit before querying the service!"
docker run -p 80:80 \
-e AWS_ACCESS_KEY_ID="fake" \
-e AWS_SECRET_ACCESS_KEY="fake" \
-e AWS_DEFAULT_REGION="us-west-2" \
-ti mozillaiam/cis-dev-preview:latest supervisord -c /opt/cis/conf/supervisor.conf
preview-shell:
docker run -ti mozillaiam/cis-dev-preview:latest /bin/bash
.PHONY: login-to-ecr
login-to-ecr:
aws ecr get-login --no-include-email | bash
.PHONY: deploy-shell
deploy-shell: login-to-ecr
docker pull 320464205386.dkr.ecr.us-west-2.amazonaws.com/custom-codebuild-cis-ci:latest
docker run -ti -v ~/.aws:/root/.aws -v ${PWD}:/var/task 320464205386.dkr.ecr.us-west-2.amazonaws.com/custom-codebuild-cis-ci:latest /bin/bash
.PHONY: build
build:
docker-compose run tester make -C serverless-functions build-without-publish STAGE=$(STAGE)
.PHONY: publish
publish:
make -C serverless-functions publish-layer STAGE=$(STAGE)
.PHONY: release
release:
docker-compose -f docker-compose-local.yml run tester make -C serverless-functions deploy-change-service STAGE=$(STAGE)
docker-compose -f docker-compose-local.yml run tester make -C serverless-functions deploy-ldap-publisher STAGE=$(STAGE)
docker-compose -f docker-compose-local.yml run tester make -C serverless-functions deploy-person-api STAGE=$(STAGE)
docker-compose -f docker-compose-local.yml run tester make -C serverless-functions deploy-notifications STAGE=$(STAGE)
docker-compose -f docker-compose-local.yml run tester make -C serverless-functions deploy-curator STAGE=$(STAGE)
docker-compose -f docker-compose-local.yml run tester make -C serverless-functions deploy-hris-publisher STAGE=$(STAGE)
docker-compose -f docker-compose-local.yml run tester make -C serverless-functions deploy-auth0-publisher STAGE=$(STAGE)
docker-compose -f docker-compose-local.yml run tester make -C serverless-functions deploy-mozilliansorg-groups-publisher STAGE=$(STAGE)
.PHONY: release-module
release-module:
docker-compose -f docker-compose-local.yml run tester make -C serverless-functions deploy-$(MODULE) STAGE=$(STAGE)
.PHONY: release-no-docker
release-no-docker:
@echo "releasing the functions using codebuild serverless"
make -C serverless-functions deploy-change-service STAGE=$(STAGE)
make -C serverless-functions deploy-ldap-publisher STAGE=$(STAGE)
make -C serverless-functions deploy-person-api STAGE=$(STAGE)
make -C serverless-functions deploy-notifications STAGE=$(STAGE)
make -C serverless-functions deploy-curator STAGE=$(STAGE)
make -C serverless-functions deploy-hris-publisher STAGE=$(STAGE)
make -C serverless-functions deploy-auth0-publisher STAGE=$(STAGE)
make -C serverless-functions deploy-mozilliansorg-groups-publisher STAGE=$(STAGE)
.PHONY: build-ci-container
build-ci-container:
cd ci && docker build . -t 320464205386.dkr.ecr.us-west-2.amazonaws.com/custom-codebuild-cis-ci
.PHONY: login-to-ecr upload-ci-container
push-ci-container:
docker push 320464205386.dkr.ecr.us-west-2.amazonaws.com/custom-codebuild-cis-ci
.PHONY: test
test:
docker-compose build
docker-compose run --rm tester bash -c '/root/utils/fake-creds.sh && source /root/.bashrc && make -C python-modules test-tox'
.PHONE: test-module
test-module:
docker-compose build
@echo "Testing single module: $(MODULE)"
docker-compose run --rm tester bash -c '/root/utils/fake-creds.sh && source /root/.bashrc && make -C python-modules/$(MODULE) test-tox'
.PHONY: developer-shell
developer-shell:
@echo 'launching docker compose environment with all the bells and whistles'
docker-compose run tester
.PHONY: install-serverless
install-serverless:
npm install --global serverless