-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
171 lines (142 loc) · 5.11 KB
/
Copy pathmakefile
File metadata and controls
171 lines (142 loc) · 5.11 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
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
.PHONY: help clean update install
.PHONY: synthetics-install synthetics-test synthetics-test-dev synthetics-lint
.PHONY: synthetics-build synthetics-start synthetics-clean synthetics-update
.PHONY: synthetics-start-debug
.PHONY: cdk-install cdk-build cdk-test cdk-test-dev cdk-test-update cdk-format
.PHONY: cdk-lint cdk-synth cdk-diff cdk-clean cdk-update
# Makefile for managing synthetics and CDK projects
# This Makefile provides a set of commands to manage the synthetics and CDK projects
# including installation, testing, linting, building, and cleaning.
# It also includes commands for updating dependencies and running the projects in development mode.
# Usage:
# make <target>
# Targets:
# synthetics-install: Install dependencies for the synthetics project
# synthetics-test: Run tests for the synthetics project
# synthetics-test-dev: Run tests for the synthetics project in watch mode
# synthetics-lint: Run linting for the synthetics project
# synthetics-build: Build the synthetics project
# synthetics-start: Run the synthetics project locally
# synthetics-start-debug: Run the synthetics project locally in debug mode
# synthetics-clean: Clean the synthetics project artifacts
# synthetics-update: Update dependencies for the synthetics project
# cdk-install: Install dependencies for the CDK project
# cdk-build: Build the CDK project
# cdk-test: Run tests for the CDK project
# cdk-test-dev: Run tests for the CDK project in watch mode
# cdk-test-update: Run tests for the CDK project and update snapshot files
# cdk-format: Format the CDK code
# cdk-lint: Run linting for the CDK project
# cdk-synth: Synthesize the CDK stack
# cdk-diff: Show the CDK diff
# cdk-update: Update dependencies for the CDK project
# cdk-clean: Clean the CDK project artifacts
# install: Install dependencies for both projects
# clean: Clean all artifacts from both projects
# update: Update all dependencies for both projects
# help: Show this help message
# Configuration
export PATH := node_modules/.bin:$(PATH)
export SHELL := /usr/bin/env bash
# Default target
help:
@echo "make synthetics-install"
@echo "make synthetics-test"
@echo "make synthetics-test-dev"
@echo "make synthetics-lint"
@echo "make synthetics-build"
@echo "make synthetics-start"
@echo "make synthetics-start-debug"
@echo "make synthetics-clean"
@echo "make synthetics-update"
@echo "make cdk-install"
@echo "make cdk-build"
@echo "make cdk-test"
@echo "make cdk-test-dev"
@echo "make cdk-test-update"
@echo "make cdk-format"
@echo "make cdk-lint"
@echo "make cdk-synth"
@echo "make cdk-diff"
@echo "make cdk-update"
@echo "make cdk-clean"
@echo "make install"
@echo "make clean"
@echo "make update"
define log
@node scripts/log $(1)
endef
# Synthetics targets
synthetics-install:
$(call log, "Installing synthetics dependencies...")
cd synthetics && pnpm install
cd synthetics && npx playwright install chromium
synthetics-test:
$(call log, "Running synthetics tests...")
cd synthetics && pnpm test
synthetics-test-dev:
$(call log, "Running synthetics tests in watch mode...")
cd synthetics && pnpm run test:dev
synthetics-lint:
$(call log, " Running synthetics lint....")
cd synthetics && pnpm run lint
synthetics-build:
$(call log, "Building synthetics project...")
cd synthetics && pnpm run build
synthetics-start:
$(call log, "Run synthetics locally...")
cd synthetics && pnpm start
synthetics-start-debug:
$(call log, "Run synthetics locally...")
cd synthetics && DEBUG_MODE=true pnpm start
synthetics-clean:
$(call log, "Cleaning synthetics...")
cd synthetics && rm -rf node_modules dist coverage
synthetics-update:
$(call log, "Updating synthetics dependencies...")
cd synthetics && pnpm update -L -i
# CDK targets
cdk-install:
$(call log, "Installing CDK dependencies...")
cd cdk && pnpm install
cdk-build:
$(call log, "Building CDK project...")
cd cdk && pnpm run build
cdk-test:
$(call log, "Running CDK tests...")
cd cdk && pnpm run test
cdk-test-dev:
$(call log, "Running CDK tests in watch mode...")
cd cdk && pnpm run test:dev
cdk-test-update:
$(call log, "Running CDK tests and updating snapshot files...")
cd cdk && pnpm run test-update
cdk-format:
$(call log, "Formatting CDK code...")
cd cdk && pnpm run format
cdk-lint:
$(call log, "Running CDK lint...")
cd cdk && pnpm run lint
cdk-synth:
$(call log, "Synthesizing CDK stack...")
cd cdk && pnpm run synth
cdk-diff:
$(call log, "Showing CDK diff...")
cd cdk && AWS_PROFILE=frontend pnpm run diff
cdk-update:
$(call log, "Updating cdk dependencies...")
cd cdk && pnpm update -L -i
# Clean CDK artifacts
cdk-clean:
$(call log, "Cleaning CDK...")
cd cdk && rm -rf node_modules dist coverage cdk.out
# Targets for managing both projects
install: synthetics-install cdk-install
$(call log, "Installing all dependencies...")
$(call log, "All dependencies installed successfully.")
clean: synthetics-clean cdk-clean
$(call log, "Cleaning all artifacts...")
$(call log, "All artifacts cleaned successfully.")
update: synthetics-update cdk-update
$(call log, "Updating all dependencies...")
$(call log, "All dependencies updated successfully.")