@@ -69,6 +69,10 @@ def generate_makefile(self):
6969 }
7070 excluded_files = ["pkg-deinstall.in" , "pkg-install.in" , "etc" , "usr" ]
7171
72+ # Remove tests from the package if the user has specified to do so
73+ if self .args .notests :
74+ os .system (f"rm -rf { files_dir .joinpath ('usr/local/pkg/RESTAPI/Tests' )} " )
75+
7276 # Set Jijna2 environment and variables
7377 j2_env = jinja2 .Environment (
7478 autoescape = jinja2 .select_autoescape ([]),
@@ -131,14 +135,15 @@ def build_on_remote_host(self):
131135 """Runs the build on a remote host using SSH."""
132136 # Automate the process to pull, install dependencies, build and retrieve the package on a remote host
133137 includes_dir = f"~/build/{ REPO_NAME } /{ PKG_NAME } /files/usr/local/pkg/RESTAPI/.resources/vendor/"
138+ notests = "--notests" if self .args .notests else ""
134139 build_cmds = [
135140 "mkdir -p ~/build/" ,
136141 f"rm -rf ~/build/{ REPO_NAME } " ,
137142 f"git clone https://github.com/{ REPO_OWNER } /{ REPO_NAME } .git ~/build/{ REPO_NAME } /" ,
138143 f"git -C ~/build/{ REPO_NAME } checkout " + self .args .branch ,
139144 f"composer install --working-dir ~/build/{ REPO_NAME } " ,
140145 f"cp -r ~/build/{ REPO_NAME } /vendor/* { includes_dir } " ,
141- f"python3 ~/build/{ REPO_NAME } /tools/make_package.py --tag { self .args .tag } " ,
146+ f"python3 ~/build/{ REPO_NAME } /tools/make_package.py --tag { self .args .tag } { notests } " ,
142147 ]
143148
144149 # Run each command and exit on bad status if failure
@@ -213,6 +218,12 @@ def tag(value_string):
213218 required = False ,
214219 help = "filename to use for the built package file." ,
215220 )
221+ parser .add_argument (
222+ "--notests" ,
223+ dest = "notests" ,
224+ action = "store_true" ,
225+ help = "Exclude tests from the package build." ,
226+ )
216227 self .args = parser .parse_args ()
217228
218229
0 commit comments