-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
97 lines (73 loc) · 2.69 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
96
97
VERSION = $(shell cat VERSION)
# needed by my Linux machine at work :)
SHELL := /bin/bash
# note in skaffold its called differently..
MAKEFILE_DOCKER_IMAGE_NAME = pasta-ror7
help:
cat Makefile
assets:
rake assets:precompile
db-recreate-DANGEOURS:
./destroy-and-recreate.sh
docker-build:
DOCKER_BUILDKIT=1 time docker build -t pasta-ror7:v$(VERSION) .
docker-run: docker-build
docker run -it -p 8080:8080 pasta-ror7:v$(VERSION) ./entrypoint-8080.sh
macosx-docker-build:
./docker-buildx-on-mac-m1.sh
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
docker-push: docker-build
# apologies this is a Riccardo only problem.
echo WARNING If you are on a arm64 Mac you will push BAD docker... FIXME.
uname | grep Linux && echo 'OK Linux no probs of my Mac weird cross compiling.'
# push latest version
docker tag pasta-ror7:v$(VERSION) palladius/pastang:v$(VERSION)
docker push palladius/pastang:v$(VERSION)
# also pushes to LATEST..
docker tag pasta-ror7:v$(VERSION) palladius/pastang
docker push palladius/pastang
find-interesting-changes:
echo These are things it took me a while to fix, and are important and hard to see changes..
rgrep Ric2022 .
run-dev:
rails s
run-prod-directly:
RAILS_ENV=production \
RICCARDO_SECRET_KEY_BASE=0a2780996c36bef4a8728d3676665a6f \
MESSAGGIO_OCCASIONALE="note this key is available to the whole world. Make sure if you have something interesting you find the time to change the ENV file :)" \
./entrypoint-8080.sh
run-prod-docker: docker-build
docker run -it -p 8080:8080 \
--env RAILS_ENV=production \
--env RICCARDO_SECRET_KEY_BASE=0a2780996c36bef4a8728d3676665a6f \
--env MESSAGGIO_OCCASIONALE='This time I run the dockerized version with proper ENVs setup like this amazingly meaningful message' \
pasta-ror7:v$(VERSION) ./entrypoint-8080.sh
kubectl-apply-prod:
./kubectl-apply-to-prod.sh
get-skaffold-pods:
kubectl get 'pod,deployment' | grep skpasta
# servicepods
echo Try also: ./test-app.sh
make test-apps
# install gems locally -> will expedite the Dockerfile a balus!
install:
bundle config set --local path 'vendor/bundle'
bundle install
test-apps:
echo Testing load balancers
./test-app.sh
verify: test-apps
.PHONY: pulumi
pulumi:
make -C pulumi/pastang/ up
#####################################
# Skaffold experiments
#####################################
skaffold-dev-local:
./skaffold-dev-local.sh
run-latest-docker-prod:
docker run -it -p 8080:8080 \
--env RAILS_ENV=production \
--env RICCARDO_SECRET_KEY_BASE=0a2780996c36bef4a8728d3676665a6f \
--env MESSAGGIO_OCCASIONALE='This is the latest Pasta PROD from DockerHub ran from Makefile' \
palladius/pastang:latest ./entrypoint-8080.sh