-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile.eif
95 lines (61 loc) · 4.68 KB
/
Makefile.eif
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
CONFIG_DIR=/etc/uid2operator
DATA_DIR=/opt/uid2operator
.PHONY: all
all: build_eif
##################################################################################################################################################################
# EIF
.PHONY: build_eif
build_eif: uid2operator.eif euidoperator.eif
uid2operator.eif: build_artifacts build_configs build/proxies.nitro.yaml build/syslog-ng-client.conf build/syslog-ng-core_4.6.0-1_amd64.deb build/syslog-ng-ose-pub.asc build/entrypoint.sh build/vsockpx build/Dockerfile build/load_config.py build/make_config.py
cd build; docker build -t uid2operator . --build-arg JAR_VERSION=`cat package.version` --build-arg IMAGE_VERSION=`cat package.version`-`git show --format="%h" --no-patch`; docker save -o ./uid2operator.tar uid2operator; docker cp ./uid2operator.tar amazonlinux:/uid2operator.tar; rm -f ./uid2operator.tar
docker exec amazonlinux bash aws_nitro_eif.sh uid2operator
euidoperator.eif: build_artifacts build_configs build/proxies.nitro.yaml build/syslog-ng-client.conf build/syslog-ng-core_4.6.0-1_amd64.deb build/syslog-ng-ose-pub.asc build/entrypoint.sh build/vsockpx build/Dockerfile build/load_config.py build/make_config.py
cd build; docker build -t euidoperator . --build-arg IDENTITY_SCOPE='EUID' --build-arg JAR_VERSION=`cat package.version` --build-arg IMAGE_VERSION=`cat package.version`-`git show --format="%h" --no-patch`; docker save -o ./euidoperator.tar euidoperator; docker cp ./euidoperator.tar amazonlinux:/euidoperator.tar; rm -f ./euidoperator.tar
docker exec amazonlinux bash aws_nitro_eif.sh euidoperator
##################################################################################################################################################################
# Config scripts
build/load_config.py: ./scripts/aws/load_config.py
cp ./scripts/aws/load_config.py ./build/
build/make_config.py: ./scripts/aws/make_config.py
cp ./scripts/aws/make_config.py ./build/
##################################################################################################################################################################
# Configs
.PHONY: build_configs
build_configs: build/conf/default-config.json build/conf/prod-uid2-config.json build/conf/integ-uid2-config.json build/conf/prod-euid-config.json build/conf/integ-euid-config.json build/conf/logback.xml build/conf/logback-debug.xml
build/conf/default-config.json: build_artifacts ./scripts/aws/conf/default-config.json
cp ./scripts/aws/conf/default-config.json ./build/conf/
build/conf/prod-uid2-config.json: build_artifacts ./scripts/aws/conf/prod-uid2-config.json
cp ./scripts/aws/conf/prod-uid2-config.json ./build/conf/
build/conf/prod-euid-config.json: build_artifacts ./scripts/aws/conf/prod-euid-config.json
cp ./scripts/aws/conf/prod-euid-config.json ./build/conf/
build/conf/integ-uid2-config.json: build_artifacts ./scripts/aws/conf/integ-uid2-config.json
cp ./scripts/aws/conf/integ-uid2-config.json ./build/conf/
build/conf/integ-euid-config.json: build_artifacts ./scripts/aws/conf/integ-euid-config.json
cp ./scripts/aws/conf/integ-euid-config.json ./build/conf/
build/conf/logback.xml: build_artifacts ./scripts/aws/conf/logback.xml
cp ./scripts/aws/conf/logback.xml ./build/conf/
build/conf/logback-debug.xml: build_artifacts ./scripts/aws/conf/logback-debug.xml
cp ./scripts/aws/conf/logback-debug.xml ./build/conf/
build/Dockerfile: build_artifacts ./scripts/aws/Dockerfile
cp ./scripts/aws/Dockerfile ./build/
build/proxies.nitro.yaml: build_artifacts ./scripts/aws/proxies.nitro.yaml
cp ./scripts/aws/proxies.nitro.yaml ./build/
build/syslog-ng-client.conf: build_artifacts ./scripts/aws/syslog-ng/syslog-ng-client.conf
cp ./scripts/aws/syslog-ng/syslog-ng-client.conf ./build/
build/syslog-ng-core_4.6.0-1_amd64.deb: build_artifacts ./scripts/aws/syslog-ng/client/syslog-ng-core_4.6.0-1_amd64.deb
cp ./scripts/aws/syslog-ng/client/syslog-ng-core_4.6.0-1_amd64.deb ./build/
build/syslog-ng-ose-pub.asc: build_artifacts ./scripts/aws/syslog-ng/client/syslog-ng-ose-pub.asc
cp ./scripts/aws/syslog-ng/client/syslog-ng-ose-pub.asc ./build/
build/entrypoint.sh: build_artifacts
cp ./scripts/aws/entrypoint.sh ./build/
##################################################################################################################################################################
# Artifacts
.PHONY: build_artifacts
build_artifacts: build/build_artifacts.stamp
build/build_artifacts.stamp: Dockerfile.nitro.builder
docker build -t uid2-nitro-builder -f Dockerfile.nitro.builder .
docker create --name uid2-nitro-builder uid2-nitro-builder
docker cp uid2-nitro-builder:/build .
docker rm uid2-nitro-builder
mkdir -p build/conf
touch build/build_artifacts.stamp