This is an automated email from the ASF dual-hosted git repository.

jensdeppe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 2cd1d32  GEODE-5709: Add CI job to build Windows images (#2443)
2cd1d32 is described below

commit 2cd1d3232e14cae4b1d9a954b614a75207bf9f90
Author: Jens Deppe <[email protected]>
AuthorDate: Mon Sep 10 14:03:04 2018 -0700

    GEODE-5709: Add CI job to build Windows images (#2443)
---
 .../google-windows-geode-builder/build_image.sh    | 46 +++++++++++++++++
 .../windows-packer.json                            | 59 ++++++++++++++++++++++
 ci/pipelines/images/images.yml                     | 31 +++++++++++-
 3 files changed, 135 insertions(+), 1 deletion(-)

diff --git a/ci/images/google-windows-geode-builder/build_image.sh 
b/ci/images/google-windows-geode-builder/build_image.sh
new file mode 100755
index 0000000..9cc8adf
--- /dev/null
+++ b/ci/images/google-windows-geode-builder/build_image.sh
@@ -0,0 +1,46 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+SOURCE="${BASH_SOURCE[0]}"
+while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a 
symlink
+  SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+  SOURCE="$(readlink "$SOURCE")"
+  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative 
symlink, we need to resolve it relative to the path where the symlink file was 
located
+done
+SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+
+pushd ${SCRIPTDIR}
+
+IMAGE_FAMILY_PREFIX=""
+if [[ -z "${GEODE_FORK}" ]]; then
+  echo "GEODE_FORK environment variable must be set for this script to work."
+  exit 1
+fi
+
+GEODE_BRANCH=${GEODE_BRANCH:-$(git rev-parse --abbrev-ref HEAD)}
+SANITIZED_GEODE_BRANCH=$(echo ${GEODE_BRANCH} | tr "/" "-" | tr '[:upper:]' 
'[:lower:]' | cut -c 1-20)
+SANITIZED_GEODE_FORK=$(echo ${GEODE_FORK} | tr "/" "-" | tr '[:upper:]' 
'[:lower:]' | cut -c 1-16)
+
+if [[ "${SANITIZED_GEODE_FORK}" != "apache" ]]; then
+  IMAGE_FAMILY_PREFIX="${SANITIZED_GEODE_FORK}-${SANITIZED_GEODE_BRANCH}-"
+fi
+
+echo "Running packer"
+packer build \
+  --var "image_family_prefix=${IMAGE_FAMILY_PREFIX}" \
+  windows-packer.json
diff --git a/ci/images/google-windows-geode-builder/windows-packer.json 
b/ci/images/google-windows-geode-builder/windows-packer.json
new file mode 100644
index 0000000..fffe760
--- /dev/null
+++ b/ci/images/google-windows-geode-builder/windows-packer.json
@@ -0,0 +1,59 @@
+{
+  "variables": {
+    "image_family_prefix": "local-testing-",
+    "geode_docker_image": "gcr.io/apachegeode-ci/test-container"
+  },
+  "builders": [
+    {
+      "image_name": "{{user 
`image_family_prefix`}}windows-geode-builder-{{timestamp}}",
+      "image_family": "{{user `image_family_prefix`}}windows-geode-builder",
+      "type": "googlecompute",
+      "project_id": "apachegeode-ci",
+      "source_image": "windows-server-1709-dc-core-for-containers-v20180814",
+      "disk_size": "100",
+      "machine_type": "n1-standard-1",
+      "communicator": "winrm",
+      "winrm_username": "packer_user",
+      "winrm_insecure": true,
+      "winrm_use_ssl": true,
+      "metadata": {
+        "windows-startup-script-cmd": "winrm quickconfig -quiet & net user 
/add packer_user & net localgroup administrators packer_user /add & winrm set 
winrm/config/service/auth @{Basic=\"true\"}"
+      },
+      "zone": "us-central1-a",
+      "omit_external_ip": false,
+      "use_internal_ip": true
+    }
+  ],
+  "provisioners": [
+    {
+      "type": "powershell",
+      "inline": [
+        "$ErrorActionPreference = \"Stop\"",
+        "Set-ExecutionPolicy Bypass -Scope Process -Force",
+
+        "Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing 
| Invoke-Expression",
+        "choco install -y jdk8 git rsync",
+        "choco install -y openssh /SSHServerFeature",
+        "refreshenv",
+
+        "winrm set winrm/config/service '@{AllowUnencrypted=\"true\"}'",
+        "New-NetfirewallRule -displayname sshd -direction inbound -action 
allow -protocol tcp -localport 22",        "New-Service -name sshd -description 
'OpenSSH sshd server' -binarypathname 'c:\\Program 
Files\\OpenSSH-Win64\\sshd.exe' -startuptype automatic",                        
        "$OldPath = (Get-ItemProperty -Path 
'Registry::HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Session 
Manager\\Environment' -Name PATH).Path",        "$NewPath = $OldPath + ';' + 
'c:\\Progra [...]
+        "Install-Module -Name ProcessMitigations -Force",        
"Get-ChildItem -Path \"C:\\Program Files\\Git\\bin\" -Recurse -Include *exe | 
%{ Set-ProcessMitigation -Name $_.Name -Disable ForceRelocateASLR,ForceRelocate 
}",        "Get-ChildItem -Path \"C:\\ProgramData\\chocolatey\" -Recurse 
-Include *exe | %{ Set-ProcessMitigation -Name $_.Name -Disable 
ForceRelocateASLR,ForceRelocate }",
+
+        "write-output 'Adding openjdk docker image'",
+        "docker pull openjdk:8u181-jdk-windowsservercore-1709",
+        "write-output 'Removing unused docker images'",
+        "docker rmi microsoft/windowsservercore:1709",
+        "docker rmi microsoft/nanoserver:1709",
+
+        "write-output 'Cloning geode repo'",
+        "& 'c:\\Program Files\\Git\\bin\\git.exe' clone -b develop --depth 1 
https://github.com/apache/geode.git geode",
+        "pushd geode",        "Add-Content -Path build.gradle -Value 
\"subprojects {`n  task getDeps(type: Copy) {`n  from 
project.sourceSets.main.runtimeClasspath`n  from 
project.sourceSets.test.runtimeClasspath`n from configurations.testRuntime`n  
into 'runtime/'`n }`n}\"",
+        "$Env:JAVA_HOME = 'C:\\Program Files\\Java\\jdk1.8.0_181'",
+        ".\\gradlew.bat --no-daemon rat getDeps",
+        "popd",
+        "rm -force geode"
+      ]
+    }
+  ]
+}
diff --git a/ci/pipelines/images/images.yml b/ci/pipelines/images/images.yml
index e710d4e..3395971 100644
--- a/ci/pipelines/images/images.yml
+++ b/ci/pipelines/images/images.yml
@@ -47,6 +47,14 @@ resources:
     paths:
     - ci/images/google-geode-builder
 
+- name: google-windows-geode-builder
+  type: git
+  source:
+    uri: https://github.com/((!geode-fork))/geode.git
+    branch: ((!geode-build-branch))
+    paths:
+    - ci/images/google-windows-geode-builder
+
 - name: alpine37-docker-image
   type: docker-image
   source:
@@ -162,7 +170,6 @@ jobs:
       trigger: true
     - get: google-geode-builder
       trigger: true
-    - get: alpine-tools-docker-image
   - task: build-image
     image: alpine-tools-docker-image
     config:
@@ -178,6 +185,28 @@ jobs:
       run:
         path: 
google-geode-builder/ci/images/google-geode-builder/build_image.sh
 
+- name: build-google-windows-geode-builder
+  public: ((!public-pipelines))
+  serial: true
+  plan:
+  - aggregate:
+    - get: google-windows-geode-builder
+      trigger: true
+  - task: build-image
+    image: alpine-tools-docker-image
+    config:
+      inputs:
+      - name: google-windows-geode-builder
+      outputs:
+      - name: results
+      platform: linux
+      params:
+        GEODE_FORK: ((!geode-fork))
+        GEODE_BRANCH: ((!geode-build-branch))
+        GEODE_DOCKER_IMAGE: 
gcr.io/apachegeode-ci/((!docker-image-prefix))test-container
+      run:
+        path: 
google-windows-geode-builder/ci/images/google-windows-geode-builder/build_image.sh
+
 - name: build-alpine-tools-docker-image
   public: ((!public-pipelines))
   serial: true

Reply via email to