Skip to content

Commit e587dd7

Browse files
committed
test: initialize git repository and create initial commit for Symfony and Laravel projects
1 parent f3bda97 commit e587dd7

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tools/internal-test/lib/project_setup.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,26 @@ def _setup_symfony(self):
8888
cwd=self.config.target_dir,
8989
)
9090

91+
# Initialize git repository
92+
self.log.info("Initializing git repository...")
93+
self.cmd.run_command(["git", "init"], cwd=self.config.target_dir)
94+
95+
# Set git user for the repository (required for commits)
96+
self.cmd.run_command(
97+
["git", "config", "user.name", "Test User"], cwd=self.config.target_dir
98+
)
99+
self.cmd.run_command(
100+
["git", "config", "user.email", "test@example.com"],
101+
cwd=self.config.target_dir,
102+
)
103+
104+
# Add all files and create initial commit
105+
self.cmd.run_command(["git", "add", "."], cwd=self.config.target_dir)
106+
self.cmd.run_command(
107+
["git", "commit", "-m", "feat: initial commit with symfony framework"],
108+
cwd=self.config.target_dir,
109+
)
110+
91111
def _setup_laravel(self):
92112
"""Set up Laravel project with DDEV"""
93113
self.log.info("Creating Laravel project using DDEV...")
@@ -122,6 +142,26 @@ def _setup_laravel(self):
122142
cwd=self.config.target_dir,
123143
)
124144

145+
# Initialize git repository
146+
self.log.info("Initializing git repository...")
147+
self.cmd.run_command(["git", "init"], cwd=self.config.target_dir)
148+
149+
# Set git user for the repository (required for commits)
150+
self.cmd.run_command(
151+
["git", "config", "user.name", "Test User"], cwd=self.config.target_dir
152+
)
153+
self.cmd.run_command(
154+
["git", "config", "user.email", "test@example.com"],
155+
cwd=self.config.target_dir,
156+
)
157+
158+
# Add all files and create initial commit
159+
self.cmd.run_command(["git", "add", "."], cwd=self.config.target_dir)
160+
self.cmd.run_command(
161+
["git", "commit", "-m", "feat: initial commit with laravel framework"],
162+
cwd=self.config.target_dir,
163+
)
164+
125165
def setup_resume(self):
126166
"""Resume setup of an existing project"""
127167
if not self.state.is_project_created():

0 commit comments

Comments
 (0)