forked from vantage-sh/ec2instances.info
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (25 loc) · 1.45 KB
/
Copy pathMakefile
File metadata and controls
34 lines (25 loc) · 1.45 KB
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
.DEFAULT_GOAL := all
.PHONY: fetch-data generate-images compress-www next write-updated-at gofmt prettier format all
fetch-data:
./fetch_data.sh
generate-images:
docker build -t ec2instances-imagegen -f imagegen/Dockerfile .
mkdir -p www
docker run --user $(shell id -u):$(shell id -g) --rm -e NEXT_PUBLIC_URL -e OPENGRAPH_URL -v $(shell pwd)/www:/app/www ec2instances-imagegen
compress-www:
tar -cvzf www_pre_build.tar.gz www
mv www_pre_build.tar.gz www/www_pre_build.tar.gz
next:
docker build -t ec2instances-node -f next/Dockerfile.base .
docker run -e NEXT_PUBLIC_URL -e DENY_ROBOTS_TXT -e NEXT_PUBLIC_REMOVE_ADVERTS -e NEXT_PUBLIC_SENTRY_DSN -e SENTRY_ORG -e SENTRY_PROJECT -e SENTRY_AUTH_TOKEN -e OPENGRAPH_URL -e NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID -e NEXT_PUBLIC_ENABLE_VANTAGE_SCRIPT_TAG -e NEXT_PUBLIC_INSTANCESKV_URL -v $(shell pwd):/app -w /app --rm -t ec2instances-node sh -c 'cd next && npm ci && npm run build'
cp -a next/out/. www/
write-updated-at:
echo $(shell date +%s) > www/updated_at
gofmt:
docker build -t ec2instances-format -f Dockerfile.format .
docker run --user $(shell id -u):$(shell id -g) -v $(shell pwd)/scraper:/app --rm -t ec2instances-format gofmt -w .
prettier:
docker build -t ec2instances-format -f Dockerfile.format .
docker run --user $(shell id -u):$(shell id -g) -v $(shell pwd):/app --rm -t ec2instances-format prettier --write .
format: gofmt prettier
all: fetch-data compress-www generate-images next write-updated-at