-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
177 lines (176 loc) · 7.05 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
SHELL=/bin/bash
GITHUB_RUN_ID ?=123
b: build
build: build-node build-maven
build-node:
cd news-cast-explorer-fe && yarn && npm run build
build-test-node: build-node test-node
build-node-cypress:
cd e2e && yarn
run-node:
cd news-cast-explorer-fe; \
npm start
build-node-docker:
cd news-cast-explorer-fe && [ -d node_modules ] || mkdir node_modules
cd news-cast-explorer-fe && [ -d dist ] || mkdir dist
cd news-cast-explorer-fe && chmod 777 node_modules
cd news-cast-explorer-fe && chmod 777 dist
touch news-cast-explorer-fe/yarn.lock
chmod 777 news-cast-explorer-fe
chmod 777 news-cast-explorer-fe/yarn.lock
docker-compose -p ${GITHUB_RUN_ID} -f docker-compose.yml -f docker-compose.builder.yml build gui-builder
docker-compose -p ${GITHUB_RUN_ID} -f docker-compose.yml -f docker-compose.builder.yml up --exit-code-from gui-builder gui-builder
cd news-cast-explorer-fe && [ -d node_modules ] && echo "dist has been created!!" || echo "dist has not been created!!"
build-node-cypress-docker:
cd e2e && [ -d node_modules ] || mkdir node_modules
cd e2e && chmod 777 node_modules
touch e2e/yarn.lock
chmod 777 e2e
chmod 777 e2e/yarn.lock
docker-compose -p ${GITHUB_RUN_ID} -f docker-compose.yml -f docker-compose.builder.yml build cypress-builder
docker-compose -p ${GITHUB_RUN_ID} -f docker-compose.yml -f docker-compose.builder.yml up --exit-code-from cypress-builder cypress-builder
build-maven-docker:
docker-compose -p ${GITHUB_RUN_ID} -f docker-compose.yml -f docker-compose.builder.yml build backend-builder
docker-compose -p ${GITHUB_RUN_ID} -f docker-compose.yml -f docker-compose.builder.yml up --exit-code-from backend-builder backend-builder
qa-maven-docker:
docker-compose -p ${GITHUB_RUN_ID} -f docker-compose.yml -f docker-compose.builder.yml build backend-qa
docker-compose -p ${GITHUB_RUN_ID} -f docker-compose.yml -f docker-compose.builder.yml up --exit-code-from backend-qa backend-qa
report-maven-docker:
docker-compose -p ${GITHUB_RUN_ID} -f docker-compose.yml -f docker-compose.builder.yml build backend-report
docker-compose -p ${GITHUB_RUN_ID} -f docker-compose.yml -f docker-compose.builder.yml up --exit-code-from backend-report backend-report
build-maven:
mvn clean install -DskipTests
build-test:
mvn clean install
test: test-node test-maven
test-node:
cd news-cast-explorer-fe && npm run jest
test-maven:
mvn test
local: no-test
mkdir -p bin
no-test:
mvn clean install -DskipTests
docker-clean:
docker-compose -p ${GITHUB_RUN_ID} rm -svf
docker-clean-local:
docker-compose rm -svf
docker-stop-all:
docker ps -a --format '{{.ID}}' | xargs -I {} docker stop {}
dist:
cp -r news-cast-explorer-fe/dist docker-files/nginx
docker: dist
docker-compose -p ${GITHUB_RUN_ID} up -d --build --remove-orphans
docker-local: dist
docker-compose up -d --build --remove-orphans
docker-logs:
cd e2e; \
make docker-logs
docker-clean-build-start: docker-clean b docker
docker-clean-start: docker-clean docker
stop:
docker-compose -p ${GITHUB_RUN_ID} down --remove-orphans
prune-all: stop
docker ps -a --format '{{.ID}}' -q | xargs docker stop
docker ps -a --format '{{.ID}}' -q | xargs docker rm
docker system prune --all
docker builder prune
docker system prune --all --volumes
case:
cd news-cast-demo && mkdir -p dst && yarn && node app.js
update-snyk:
npm i -g snyk
update-node:
npm install -g npm-check-updates
cd news-cast-demo && ncu -u && yarn
cd news-cast-explorer-fe && npx browserslist && ncu -u && yarn
audit:
cd news-cast-demo && npm audit fix && yarn
cypress-install:
cd e2e && make build
cypress-open:
cd e2e && make cypress-open
cypress-open-docker:
cd e2e && make cypress-open-docker
cypress-electron:
cd e2e && make cypress-electron
cypress-chrome:
cd e2e && make cypress-chrome
cypress-firefox:
cd e2e && make cypress-firefox
cypress-firefox-full:
cd e2e && make cypress-firefox-full
cypress-edge:
cd e2e && make cypress-edge
docker-action: dist
docker-compose -p ${GITHUB_RUN_ID} -f docker-compose.yml -f docker-compose.builder.yml up -d news-cast-postgres news-cast-kafka news-cast-mock news-cast-cdc news-cast-fetcher news-cast-choreography news-cast-orchestration news-cast-fe
nce-wait:
bash nce_wait.sh
dcd: dc-migration
docker-compose -p ${GITHUB_RUN_ID} down --remove-orphans
dcd-local:
docker-compose down --remove-orphans
dcp:
docker-compose -p ${GITHUB_RUN_ID} stop
dcup: dcd docker-clean docker nce-wait
dcup-full-action: dcd docker-clean no-test build-node docker nce-wait
dcup-full-local: dcd docker-clean-local no-test build-node docker nce-wait
dcup-action: dcp docker-action nce-wait
dcup-light: dcd
docker-compose -p ${GITHUB_RUN_ID} up -d news-cast-postgres news-cast-kafka
build-kafka:
docker-compose -p ${GITHUB_RUN_ID} stop news-cast-kafka
docker-compose -p ${GITHUB_RUN_ID} rm news-cast-kafka
docker-compose -p ${GITHUB_RUN_ID} build --no-cache news-cast-kafka
docker-compose -p ${GITHUB_RUN_ID} up -d
build-nginx: build-node
docker-compose -p ${GITHUB_RUN_ID} stop news-cast-fe
docker-compose -p ${GITHUB_RUN_ID} rm news-cast-fe
docker-compose -p ${GITHUB_RUN_ID} build --no-cache news-cast-fe
docker-compose -p ${GITHUB_RUN_ID} up -d
end-logs:
docker-compose -p ${GITHUB_RUN_ID} logs --tail 1000 news-cast-postgres
docker-compose -p ${GITHUB_RUN_ID} logs --tail 1000 news-cast-mock
docker-compose -p ${GITHUB_RUN_ID} logs --tail 1000 news-cast-fetcher
docker-compose -p ${GITHUB_RUN_ID} logs --tail 1000 news-cast-cdc
docker-compose -p ${GITHUB_RUN_ID} logs --tail 1000 news-cast-orchestration
docker-compose -p ${GITHUB_RUN_ID} logs --tail 1000 news-cast-choreography
docker-compose -p ${GITHUB_RUN_ID} logs --tail 1000 news-cast-fe
coverage-maven:
mvn jacoco:prepare-agent package jacoco:report
coverage-node:
cd news-cast-explorer-fe && npm run coverage
report:
mvn omni-coveragereporter:report
local-pipeline: build-maven build-node test-maven test-node coverage-maven coverage-node report
update-browsers:
npx update-browserslist-db@latest
update-all: update-snyk update-browsers
update: remove-lock-files
git pull
npm install caniuse-lite
npm install -g npm-check-updates
cd news-cast-explorer-fe; \
yarn; \
npx browserslist --update-db; \
ncu -u; \
yarn
remove-lock-files:
find . -name "package-lock.json" | xargs -I {} rm {}; \
find . -name "yarn.lock" | xargs -I {} rm {};
revert-deps-cypress-update:
if [ -f e2e/docker-composetmp.yml ]; then rm e2e/docker-composetmp.yml; fi
if [ -f e2e/packagetmp.json ]; then rm e2e/packagetmp.json; fi
git checkout e2e/docker-compose.yml
git checkout e2e/package.json
deps-cypress-update:
curl -sL https://raw.githubusercontent.com/jesperancinha/project-signer/master/cypressUpdateOne.sh | bash
deps-plugins-update:
curl -sL https://raw.githubusercontent.com/jesperancinha/project-signer/master/pluginUpdatesOne.sh | bash -s -- $(PARAMS)
deps-update: update
accept-prs:
curl -sL https://raw.githubusercontent.com/jesperancinha/project-signer/master/acceptPR.sh | bash
update-repo-prs:
curl -sL https://raw.githubusercontent.com/jesperancinha/project-signer/master/update-all-repo-prs.sh | bash
dc-migration:
curl -sL https://raw.githubusercontent.com/jesperancinha/project-signer/master/setupDockerCompose.sh | bash