-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.ci
95 lines (94 loc) · 4.86 KB
/
Makefile.ci
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
define SERVER_RSA_PRIVATE_KEY
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAyzOP1bef/mRQELQSU99VMXx5JSS/uoEjDVUYbv54qZ0ZNr/x
mr/LVDmklAH85YXoVI9Ze116ms4o27/iSyDRDQzZQJMZQeZkhsrCjl047KCEtuSB
KlrWV514C0PZAI8E5dIOmcThqDL6Oe3ko3cxc5On27O8i1L02ZR63lzAHsiYUKZJ
LCuumsgRjN3Qmnxgsj7blCNlo2Inc04hIU7FxNePnDQeIq9InTQwe8kpdrR3+z7O
M2dOwsgzwQXfRmhRVmMv9WyBOA7ppbhED2xDV0HtwlE7zvVXVzz0XlIH0Bcg2hJV
nOUspMNOVN98hovTNW1zYapq8K4WzdzTLWu6ewIDAQABAoIBAEk+mb8YhFRHRlDv
B5gx7Vx8GJLZ7z5D5CWfIcKIeWfyF6+TenwkXB9M89Th7o2xOfCZB1Effd0lKLcl
MGWSO6hvlDPhkf4eFOg9V+nHEojAx3XBYgmpWo+UVDwDRcocw1Av6lFlFU3yqh2N
cZe2lB2sAJqB7BlwWo+/JJbYaevuD6i6SQUy6kXrbDAFbMY0phcuL4qkW3KsywpY
2bijso8HeLVurk74MaAezbgwVzrhReA89RQruJtEIT4EYECknxammam5PuCSeflV
Mpsh31KP8PSu6Le4ejMYqKnQhLBV1kpA2tZ00NwP1T8PgRcxmBW+YhxDIK/PIwJv
lz0Z8FECgYEA1YVgVX3NZ6HMTmokM/u+rIjAg08meSVokUjnosvdef8RTEYT5DlZ
3RoCmKzth4T9GJE56Cvo+0C6Xvcba2QiHBCuvwa0NCOqNv37qtXsAOwKwBxVx8nn
9LSsrpmrXl407C64mM4pPXH5FMkHrK7AwGikxiceCWZFl4ULcZZDB/MCgYEA86Cb
5uu9Ah3i6X5Sm/wV4WAejLYKIgw046BRXF2ZJB+Rk66l9NG28hIgszQr4tgPVqQ8
m4u/xctII5fSLNN+fKxz7Pqb5uPDrWbBvyk4BAlz+oCV6DpQQrmX79OSSz3GLLxa
IG2CXYe41s02wJZ+WF6Ap/+SRt8qXEOkZpm27VkCgYApC2iHRpWTlECn2jN3Yq82
j1siYraslwpQ00jjvHiomOWEWfw85OFnZTaWjrdiU6grbs9I2BgDJGAvHSVCMY91
Aaf1xJ4jX6+6vnwATPr++mDeqRO8Qg26tnhzX8rXaxiVRi3qAcdfrmcJHdPB2B3p
XrQ9+wsFF4nNJKAch5v/DQKBgQCQtB6lg/OZpEK4yQ0sFQix+rNqhF10Z6eqY/iv
UfC54f5Hp35u8XkmQtolVqGSdR53KcnN4a2gP+OzMGPnuB7y0kNwyFF9TF9XSSde
8Y6R50N50JI5gxlU6IN0MUg9ZI2m2KD3jdPW1dxVyUHyFfEpb8gfAM/TRI4Wix7E
yhw60QKBgQCmmaR1Eg8/sJV/5SiAgHzXkOjPRmQjmwESazhe10mja0s/dyHk7Si3
x7YDoJeQm7c+GO6lb46/ccFU/MGXNmtEDeaLT5bVaZ81zkEWED2AjdHK6S4yttx/
o5uW70B4smBr2njkjibrTjaY1Mb7z4zFVPpK7ohEAulTnqKdHdFeqQ==
-----END RSA PRIVATE KEY-----
endef
export SERVER_RSA_PRIVATE_KEY
# Variables
LATEST_COMMIT := $$(git rev-parse HEAD)
.PHONY: help up down run-local migrate-local
help: ## Show this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
%:
@:
up: ## Run all needed containers, including postgres with exposed port :5432
docker-compose up -d
down: ## Stop and remove all related containers
docker-compose down -v --rmi=local
run-local: ## Run api via `go run`
@APP_PORT=8080 \
APP_BASE_URL=XXXXXXXXXX \
DATABASE_URL=postgresql://pguser:[email protected]/pgdb?sslmode=disable \
JWT_SIGNING_KEY=secret \
QUIZ_WS_CONN_URL=https://aec45cb3e117.ngrok.io/quiz \
SOLANA_API_BASE_URL=http://localhost:8899/ \
POSTMARK_SERVER_TOKEN=local \
POSTMARK_ACCOUNT_TOKEN=local \
STORAGE_KEY=XXXXXXXXXX \
STORAGE_SECRET=XXXXXXXXXX \
STORAGE_ENDPOINT=XXXXXXXXXX \
STORAGE_REGION=XXXXXXXXXX \
STORAGE_BUCKET=XXXXXXXXXX \
STORAGE_URL=XXXXXXXXXX \
STORAGE_FORCE_PATH_STYLE=false \
STORAGE_DISABLE_SSL=true \
FIREBASE_BASE_URL=https://satorio.page.link \
FIREBASE_WEB_API_KEY=XXXXXXXXXXXXXXXXXXXXXX \
FIREBASE_MAIN_SITE_LINK=https://sator.io/ \
FIREBASE_ANDROID_PACKAGE_NAME=com.satorio.app \
FIREBASE_IOS_BUNDLE_ID=io.sator \
FIREBASE_SUFFIX_OPTION=UNGUESSABLE \
SOLANA_FEE_PAYER_ADDR=67CXqkdKLhZxeDaHos2dxNGpqaiJvvva77TDnEipxXPx \
SOLANA_FEE_PAYER_PRIVATE_KEY=tg3BEHU1lH24lo9JccmqLL13DLOzLMptxh0aa3NXJUtL4PVdkvwOmbpCqMTFG7a8CJles911d0uu7SYeuck8Uw== \
SOLANA_ASSET_ADDR=3yKB53R6DCuq2VL7aBfJY4VT9jv3w67NixyWoWoZZe5v \
SOLANA_TOKEN_HOLDER_ADDR=uFhu3UDp2ymFYKRwPf1jrvfhDj1R7eiWjDnkdVQJhGQ \
SOLANA_TOKEN_HOLDER_PRIVATE_KEY=I52q0J0qsUY2NLTSScSKre1lH6XZRu69FGS0pa3xypsNYtRHIr9ICfw0SXUd1Vcr0sf3tqQuG3whne/UvJfBNQ== \
MASTER_OTP_HASH='$$2a$$04$$JEj1CnjccUr237U8lOWMVOUPcm4xG/a3SHcJM00uNQKAx.ujaP5Pa' \
KYC_APP_TOKEN=XXXXXXXXXX \
KYC_APP_SECRET=XXXXXXXXXX \
KYC_APP_BASE_URL=XXXXXXXXXX \
NATS_URL=nats://127.0.0.1:4222 \
NATS_WS_URL=ws://127.0.0.1:8080 \
SERVER_RSA_PRIVATE_KEY="$$SERVER_RSA_PRIVATE_KEY" \
SOLANA_STAKE_POOL_ADDR=4pm3G48wWGrbUVF3JHLDrgVniQi7eSkRyx5bwXnawC2z \
SOLANA_SYSTEM_PROGRAM=11111111111111111111111111111111 \
SOLANA_SYSVAR_RENT=SysvarRent111111111111111111111111111111111 \
SOLANA_SYSVAR_CLOCK=SysvarC1ock11111111111111111111111111111111 \
SOLANA_SPL_TOKEN=TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA \
SOLANA_STAKE_PROGRAM_ID=CL9tjeJL38C3eWqd6g7iHMnXaJ17tmL2ygkLEHghrj4u \
QUIZ_V2_SHUFFLE_QUESTIONS=false \
SATOR_API_KEY=582e89d8-69ca-4206-8e7f-1fc822b41307 \
go run -ldflags "-X main.buildTag=`date -u +%Y%m%d.%H%M%S`-$(LATEST_COMMIT)" -race cmd/api/main.go &> sator-api.log &
migrate-local: ## Run all migrations on local environment
@rm -Rvf migrations/*.sql && \
cp -Rvf ./svc/**/repository/sql/migrations/*.sql migrations/ && \
DATABASE_URL=postgresql://pguser:[email protected]/pgdb?sslmode=disable \
go run ./cmd/migrate/main.go
e2e-tests:
go test -p 1 -count=1 -race -tags=mock_postmark,mock_coingecko,mock_appstore,mock_nft_marketplace,mock_google_firebase ./test/e2e/... ./lib/... ./svc/...
integration-tests:
go test -p 1 -count=1 -race -tags=mock_solana,mock_postmark,mock_appstore,mock_nft_marketplace,mock_google_firebase ./test/integration-tests/...