Commits

Jason R. Coombs  committed 9cf373d

Ported cmd script into subprocess calls in install-jaraco-site

  • Participants
  • Parent commits 2fc087c

Comments (0)

Files changed (2)

File jaraco/site/manage.py

+from __future__ import print_function
+
 import os
 import shutil
+import subprocess
 
 import pkg_resources
 
 		script_name = 'scripts/' + script
 		shutil.copy(pkg_resources.resource_filename('jaraco.site', script_name),
 			os.path.join(base, script))
-	print "Don't forget you still need to run the scripts in", base
+	create_site()
+	print("Don't forget you still need to run the scripts in", base)
+
+def create_site():
+	app_cmd = r'\windows\system32\inetsrv\appcmd.exe'
+	subprocess.check_call([
+		app_cmd,
+		'add', 'site',
+		'/id:3', '/name:Primary Web Site',
+		r'/physicalPath:c:\inetpub\jaraco.site',
+		'/bindings:http/*:80:www.jaraco.com,https/*:443:www.jaraco.com',
+		],
+	)
+	subprocess.check_call([
+		app_cmd,
+		'add', 'apppool',
+		'/name:Primary Web Site',
+	])
+	subprocess.check_call([
+		app_cmd,
+		'set', 'app',
+		'Primary Web Site/',
+		'/applicationPool:Primary Web Site',
+	])

File jaraco/site/scripts/create-iis-site.cmd

-@echo off
-\windows\system32\inetsrv\appcmd add site /id:3 /name:"Primary Web Site" /physicalPath:c:\inetpub\jaraco.site /bindings:http/*:80:www.jaraco.com,https/*:443:www.jaraco.com
-\windows\system32\inetsrv\appcmd add apppool /name:"Primary Web Site"
-\windows\system32\inetsrv\appcmd set app "Primary Web Site/" /applicationPool:"Primary Web Site"
-mkdir \inetpub\jaraco.site