Add Windows init script User Data 53/12053/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Tue, 31 Jul 2018 20:19:45 +0000 (16:19 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 1 Aug 2018 00:21:00 +0000 (20:21 -0400)
Add the User Data script for Windows systems.

Change-Id: I9a38c3965b6201dbcecf204b2046694413996719
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
docs/_static/ciman/jenkins-init-script-windows.ps1.example [new file with mode: 0644]
docs/infra/bootstrap.rst

diff --git a/docs/_static/ciman/jenkins-init-script-windows.ps1.example b/docs/_static/ciman/jenkins-init-script-windows.ps1.example
new file mode 100644 (file)
index 0000000..d06a973
--- /dev/null
@@ -0,0 +1,11 @@
+<powershell>
+  # Resize first partition of first disk to maximum size
+  Get-Partition -DiskNumber 0 -PartitionNumber 1
+  $size = (Get-PartitionSupportedSize -DiskNumber 0 -PartitionNumber 1)
+  Resize-Partition -DiskNumber 0 -PartitionNumber 1 -Size $size.SizeMax
+
+  mkdir -Force "${SLAVE_JENKINS_HOME}"
+  (new-object System.Net.WebClient).DownloadFile('${SLAVE_JAR_URL}','${SLAVE_JENKINS_HOME}\slave.jar')
+  cd "${SLAVE_JENKINS_HOME}"
+  java ${SLAVE_JVM_OPTIONS} -jar "slave.jar" -jnlpUrl "${SLAVE_JNLP_URL}" -secret "${SLAVE_JNLP_SECRET}"
+</powershell>
index 6c4f7b8..e1d7d1c 100644 (file)
@@ -234,6 +234,19 @@ Bootstrap common-packer and initial builder
 
    .. literalinclude:: ../_static/ciman/jenkins-init-script.sh.example
 
+   For Windows:
+
+   .. code-block:: none
+
+      Type: OpenStack User Data
+      ID: jenkins-init-script-windows
+      Name: jenkins-init-script-windows
+      Comment: jenkins-init-script-windows
+
+   With the contents (change the git clone URL as necessary for the project):
+
+   .. literalinclude:: ../_static/ciman/jenkins-init-script-windows.ps1.example
+
 #. Configure ``cattle`` cloud
 
    #. Create cloud config directory ``mkdir -p jenkins-config/clouds/openstack/cattle``