-
Notifications
You must be signed in to change notification settings - Fork 28
/
Makefile
80 lines (64 loc) · 4.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
.PHONY: clean local docker react react-campaigns backup-db restore-db minio realS3 firsttime
build: application
help:
@printf "\n"
@printf "make application Builds the entire application\n"
@printf "make firsttime Starts the containers for a full test system using docker-compose\n"
@printf "make campaigns Builds the react campaigns application\n"
@printf "make docs Builds the documentation\n"
@printf "make docker Creates a jacamars/newbidder docker image\n"
@printf "make restore-db Restores the postgres database from the previously saved db\n"
@printf "make backup-db Saves the current db\n"
@printf "make minio Makes a minio s3 setup in /tmp\n"
@printf "make realS3 Makes a real s3 setup\n"
@printf "\n"
firsttime:
./firsttime.sh
react-campaigns:
rm react/campaigns/package-lock.json|| true
rm react/campaigns/yarn.lock || true
cd react/campaigns && npm update --force
cd react/campaigns && yarn install
cd react/campaigns && npm run-script build
rm -r www/campaigns || true
cp -a react/campaigns/build www
mv www/build www/campaigns
react: react-campaigns
application: react local docker
local:
mvn assembly:assembly -DdescriptorId=jar-with-dependencies -Dmaven.test.skip=true
docker build -t jacamars/newbidder .
minio:
mkdir -p /tmp/s3
docker-compose -f minio.yml up -d
bash -c "./wait-for-it.sh localhost:9000 -t 120"
./tools/copy2s3 "endpoint=http://localhost:9000&aws_access_key=AKIAIOSFODNN7EXAMPLE&aws_secret_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY&bucket=rtb4free-big-data&filename=data/METHBOT.txt&key=cidr/METHBOT.txt"
./tools/copy2s3 "endpoint=http://localhost:9000&aws_access_key=AKIAIOSFODNN7EXAMPLE&aws_secret_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY&bucket=rtb4free-big-data&filename=data/zip_codes_states.csv&key=geo/zip_codes_states.csv"
./tools/copy2s3 "endpoint=http://localhost:9000&aws_access_key=AKIAIOSFODNN7EXAMPLE&aws_secret_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY&bucket=rtb4free-big-data&filename=data/adxgeo.csv&key=geo/adxgeo.csv"
./tools/copy2s3 "endpoint=http://localhost:9000&aws_access_key=AKIAIOSFODNN7EXAMPLE&aws_secret_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY&bucket=rtb4free-big-data&filename=Campaigns/payday.json&key=config/payday.json"
./tools/copy2s3 "endpoint=http://localhost:9000&aws_access_key=AKIAIOSFODNN7EXAMPLE&aws_secret_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY&bucket=rtb4free-big-data&filename=data/audience.txt&key=bloom/audience1/test-audience.txt"
./tools/copy2s3 "endpoint=http://localhost:9000&aws_access_key=AKIAIOSFODNN7EXAMPLE&aws_secret_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY&bucket=rtb4free-big-data&filename=www/images/320x50.jpg&key=images/320x50/tunein.jpg"
./tools/copy2s3 "endpoint=http://localhost:9000&aws_access_key=AKIAIOSFODNN7EXAMPLE&aws_secret_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY&bucket=rtb4free-big-data&filename=www/contact.html/&key=landing/rtb4free/contact.html"
./tools/copy2s3 "endpoint=http://localhost:9000&aws_access_key=AKIAIOSFODNN7EXAMPLE&aws_secret_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY&bucket=rtb4free-big-data&filename=www/images/trump.mp4&key=video/trump.mp4"
realS3:
./tools/copy2s3 "aws_access_key=$(aws_access_key)&aws_secret_key=$(aws_secret_key)&aws_region=$(aws_region)&bucket=$(bucket)&filename=data/METHBOT.txt&key=cidr/METHBOT.txt"
./tools/copy2s3 "aws_access_key=$(aws_access_key)&aws_secret_key=$(aws_secret_key)&aws_region=$(aws_region)&bucket=$(bucket)&filename=data/zip_codes_states.csv&key=geo/zip_codes_states.csv"
./tools/copy2s3 "aws_access_key=$(aws_access_key)&aws_secret_key=$(aws_secret_key)&aws_region=$(aws_region)&bucket=$(bucket)&filename=data/adxgeo.csv&key=geo/adxgeo.csv"
./tools/copy2s3 "aws_access_key=$(aws_access_key)&aws_secret_key=$(aws_secret_key)&aws_region=$(aws_region)&bucket=$(bucket)&filename=Campaigns/payday.json&key=config/payday.json"
./tools/copy2s3 "aws_access_key=$(aws_access_key)&aws_secret_key=$(aws_secret_key)&aws_region=$(aws_region)&bucket=$(bucket)&filename=data/audience.txt&key=bloom/audience1/test-audience.txt"
./tools/copy2s3 "aws_access_key=$(aws_access_key)&aws_secret_key=$(aws_secret_key)&aws_region=$(aws_region)&bucket=$(bucket)&filename=www/images/320x50.jpg&key=images/320x50/tunein.jpg"
./tools/copy2s3 "aws_access_key=$(aws_access_key)&aws_secret_key=$(aws_secret_key)&aws_region=$(aws_region)&bucket=$(bucket)&filename=www/contact.html/&key=landing/rtb4free/contact.html"
./tools/copy2s3 "aws_access_key=$(aws_access_key)&aws_secret_key=$(aws_secret_key)&aws_region=$(aws_region)&bucket=$(bucket)&filename=www/images/trump.mp4&key=video/trump.mp4"
docker:
docker build -t jacamars/newbidder .
# docker push jacamars/newbidder
push:
docker push jacamars/newbidder
backup-db:
mkdir -p /tmp/data
pg_dump -F c -b -v --dbname=postgresql://postgres:postgres@localhost:5432 > database.backup
restore-db:
mkdir -p /tmp/data
pg_restore --dbname=postgresql://postgres:postgres@localhost:5432 --verbose database.backup
clean:
mvn clean