@@ -31,7 +31,7 @@ help: ## Display this help
31
31
# This recipe builds and pushes images for production. Note: RELEASE_TAG must be set
32
32
#
33
33
.PHONY : cloudbuild
34
- cloudbuild : require_release_tag push_prod_images # # Build and push images
34
+ cloudbuild : require_release_tag push # # Build and push images
35
35
36
36
.PHONY : require_release_tag
37
37
require_release_tag :
@@ -43,78 +43,80 @@ endif
43
43
#
44
44
# These recipes build all the top-level docker images
45
45
46
- build_ % _image :
46
+ build/image/ % :
47
47
@# if TAG is 'latest', the two -t arguments are equivalent and do the same thing
48
48
docker build $(BUILD_ARG ) -t ${REGISTRY} /$(IMAGE_NAME ) -t ${REGISTRY} /$(IMAGE_NAME ) :$(TAG ) -f $(DOCKERFILE ) $(DIR )
49
49
50
50
#
51
51
# These recipes build the sandbox images.
52
52
#
53
- build_ % _sandbox :
53
+ build/sandbox/ % :
54
54
@# if TAG is 'latest', the two -t arguments are equivalent and do the same thing
55
55
docker build -t ${REGISTRY} /$(IMAGE_NAME ) -t ${REGISTRY} /$(IMAGE_NAME ) :$(TAG ) -f $(DOCKERFILE ) $(DIR )
56
56
57
- build_analysis_image : DIR=$(PREFIX )
58
- build_analysis_image : DOCKERFILE=$(PREFIX ) /cmd/analyze/Dockerfile
59
- build_analysis_image : IMAGE_NAME=analysis
57
+ build/image/analysis : DIR=$(PREFIX )
58
+ build/image/analysis : DOCKERFILE=$(PREFIX ) /cmd/analyze/Dockerfile
59
+ build/image/analysis : IMAGE_NAME=analysis
60
60
61
- build_scheduler_image : DIR=$(PREFIX )
62
- build_scheduler_image : DOCKERFILE=$(PREFIX ) /cmd/scheduler/Dockerfile
63
- build_scheduler_image : IMAGE_NAME=scheduler
61
+ build/image/scheduler : DIR=$(PREFIX )
62
+ build/image/scheduler : DOCKERFILE=$(PREFIX ) /cmd/scheduler/Dockerfile
63
+ build/image/scheduler : IMAGE_NAME=scheduler
64
64
65
- build_static_analysis_sandbox : DIR=$(PREFIX )
66
- build_static_analysis_sandbox : DOCKERFILE=$(SANDBOX_DIR ) /staticanalysis/Dockerfile
67
- build_static_analysis_sandbox : IMAGE_NAME=static-analysis
65
+ build/sandbox/static_analysis : DIR=$(PREFIX )
66
+ build/sandbox/static_analysis : DOCKERFILE=$(SANDBOX_DIR ) /staticanalysis/Dockerfile
67
+ build/sandbox/static_analysis : IMAGE_NAME=static-analysis
68
68
69
- build_dynamic_analysis_sandbox : DIR=$(SANDBOX_DIR ) /dynamicanalysis
70
- build_dynamic_analysis_sandbox : DOCKERFILE=$(SANDBOX_DIR ) /dynamicanalysis/Dockerfile
71
- build_dynamic_analysis_sandbox : IMAGE_NAME=dynamic-analysis
69
+ build/sandbox/dynamic_analysis : DIR=$(SANDBOX_DIR ) /dynamicanalysis
70
+ build/sandbox/dynamic_analysis : DOCKERFILE=$(SANDBOX_DIR ) /dynamicanalysis/Dockerfile
71
+ build/sandbox/dynamic_analysis : IMAGE_NAME=dynamic-analysis
72
72
73
- .PHONY : build_prod_images
74
- build_prod_images : build_dynamic_analysis_sandbox build_static_analysis_sandbox build_analysis_image build_scheduler_image # # Build images
73
+ .PHONY : build
74
+ build : build/sandbox/dynamic_analysis build/sandbox/static_analysis build/image/analysis build/image/scheduler # # Build images
75
75
76
76
#
77
77
# Builds then pushes analysis and sandbox images
78
78
#
79
79
80
- push_ % :
80
+ push/image/ % :
81
81
docker push --all-tags ${REGISTRY} /$(IMAGE_NAME )
82
82
83
- push_analysis_image : IMAGE_NAME=analysis
84
- push_analysis_image : build_analysis_image
83
+ push/sandbox/ % :
84
+ docker push --all-tags ${REGISTRY} / $( IMAGE_NAME )
85
85
86
- push_scheduler_image : IMAGE_NAME=scheduler
87
- push_scheduler_image : build_scheduler_image
86
+ push/image/analysis : IMAGE_NAME=analysis
87
+ push/image/analysis : build/image/analysis
88
88
89
- push_dynamic_analysis_sandbox : IMAGE_NAME=dynamic-analysis
90
- push_dynamic_analysis_sandbox : build_dynamic_analysis_sandbox
89
+ push/image/scheduler : IMAGE_NAME=scheduler
90
+ push/image/scheduler : build/image/scheduler
91
91
92
- push_static_analysis_sandbox : IMAGE_NAME=static -analysis
93
- push_static_analysis_sandbox : build_static_analysis_sandbox
92
+ push/sandbox/dynamic_analysis : IMAGE_NAME=dynamic -analysis
93
+ push/sandbox/dynamic_analysis : build/sandbox/dynamic_analysis
94
94
95
- .PHONY : push_prod_sandboxes
96
- push_prod_sandboxes : push_dynamic_analysis_sandbox push_static_analysis_sandbox
95
+ push/sandbox/static_analysis : IMAGE_NAME=static-analysis
96
+ push/sandbox/static_analysis : build/sandbox/static_analysis
97
97
98
- .PHONY : push_prod_images
99
- push_prod_images : push_prod_sandboxes push_analysis_image push_scheduler_image # # Push production images
98
+ .PHONY : push/prod_sandboxes
99
+ push/prod_sandboxes : push/sandbox/dynamic_analysis push/sandbox/static_analysis
100
100
101
+ .PHONY : push
102
+ push : push/prod_sandboxes push/image/analysis push/image/scheduler # # Push production images
101
103
102
104
#
103
105
# These update (sync) locally built sandbox images from Docker to
104
106
# podman. In order to use locally built sandbox images for analysis,
105
107
# pass '-nopull' to scripts/run_analysis.sh
106
108
#
107
- sync_ % _sandbox :
109
+ sync/sandbox/ % :
108
110
docker save ${REGISTRY} /${IMAGE_NAME} :$(TAG ) | sudo podman load
109
111
110
- sync_dynamic_analysis_sandbox : IMAGE_NAME=dynamic-analysis
111
- sync_dynamic_analysis_sandbox : build_dynamic_analysis_sandbox
112
+ sync/sandbox/dynamic_analysis : IMAGE_NAME=dynamic-analysis
113
+ sync/sandbox/dynamic_analysis : build/sandbox/dynamic_analysis
112
114
113
- sync_static_analysis_sandbox : IMAGE_NAME=static-analysis
114
- sync_static_analysis_sandbox : build_static_analysis_sandbox
115
+ sync/sandbox/static_analysis : IMAGE_NAME=static-analysis
116
+ sync/sandbox/static_analysis : build/sandbox/static_analysis
115
117
116
- .PHONY : sync_prod_sandboxes
117
- sync_prod_sandboxes : sync_dynamic_analysis_sandbox sync_static_analysis_sandbox
118
+ .PHONY : sync
119
+ sync : sync/sandbox/dynamic_analysis sync/sandbox/static_analysis # # Sync prod sandboxes
118
120
119
121
120
122
#
@@ -175,7 +177,7 @@ e2e_test_logs_analysis:
175
177
176
178
.PHONY : build_e2e_test_images
177
179
build_e2e_test_images : TAG=test
178
- build_e2e_test_images : sync_prod_sandboxes build_analysis_image build_scheduler_image
180
+ build_e2e_test_images : sync build/image/analysis build/image/scheduler
179
181
180
182
181
183
0 commit comments