You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ma...@apache.org on 2017/04/30 21:16:41 UTC

[1/2] archiva git commit: Adding powershell script for proc cleanup on CI server

Repository: archiva
Updated Branches:
  refs/heads/master e37ed6209 -> de5a585c9


Adding powershell script for proc cleanup on CI server

This script is used by the jenkins builds to cleanup hanging processes
after abort.


Project: http://git-wip-us.apache.org/repos/asf/archiva/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva/commit/3bb2fad4
Tree: http://git-wip-us.apache.org/repos/asf/archiva/tree/3bb2fad4
Diff: http://git-wip-us.apache.org/repos/asf/archiva/diff/3bb2fad4

Branch: refs/heads/master
Commit: 3bb2fad4dcc10543320030d01d5b209f8e64de87
Parents: e37ed62
Author: Martin Stockhammer <ma...@apache.org>
Authored: Sun Apr 30 21:45:14 2017 +0200
Committer: Martin Stockhammer <ma...@apache.org>
Committed: Sun Apr 30 21:45:14 2017 +0200

----------------------------------------------------------------------
 src/ci/scripts/cleanup.bat |  4 ++
 src/ci/scripts/cleanup.ps1 | 96 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 100 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva/blob/3bb2fad4/src/ci/scripts/cleanup.bat
----------------------------------------------------------------------
diff --git a/src/ci/scripts/cleanup.bat b/src/ci/scripts/cleanup.bat
new file mode 100644
index 0000000..fdb09df
--- /dev/null
+++ b/src/ci/scripts/cleanup.bat
@@ -0,0 +1,4 @@
+@echo off
+SET runpath=%~dp0
+
+PowerShell.exe -NonInteractive -ExecutionPolicy bypass -File %runpath%cleanup.ps1 %*

http://git-wip-us.apache.org/repos/asf/archiva/blob/3bb2fad4/src/ci/scripts/cleanup.ps1
----------------------------------------------------------------------
diff --git a/src/ci/scripts/cleanup.ps1 b/src/ci/scripts/cleanup.ps1
new file mode 100644
index 0000000..fd709ed
--- /dev/null
+++ b/src/ci/scripts/cleanup.ps1
@@ -0,0 +1,96 @@
+#
+# 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.
+#
+#
+# Powershell script for cleaning up remaining browser and selenium server processes on the CI servers
+#
+# Author: Martin Stockhammer <ma...@apache.org>  
+# Date  : 2017-04-30
+#
+# Descriptions:
+#  Stopps processes related to the selenium checks, if they were not stopped by the selenium server, because
+#  the job was aborted.
+#  The script cannot determine, which of the processes are started by the current job, so if there are
+#  parallel jobs running on this server that start processes with the same name and user, these
+#  will be stopped too.
+#
+#  Per default the script will stop "firefox.exe","iexplore.exe","chrome.exe"
+#  and the processes "java.exe","mshta.exe" if their commandline arguments contain "selenium-server"
+# 
+# Parameters:
+#  -Verbose              : If set, more output will be printed
+#  -Browsers proc1,proc2 : The list of executables that define the browser processes, that are started by selenium
+#  -SeleniumProcesses    : The list of processes with the string "selenium-server" in the commandline arguments
+
+param (
+    [switch]$Verbose = $False,
+    [String[]]$Browsers = @("firefox.exe","iexplore.exe","chrome.exe"),
+    [String[]]$SeleniumProcesses = @("mshta.exe","java.exe")
+)
+
+# $currentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
+$currentUser = $env:UserName
+Write-Output "User: $currentUser"
+
+if ($Verbose) 
+{
+  Get-Process | Get-Member
+  
+  $View = @(
+   @{l='Handles';e={$_.HandleCount}},
+   @{l='NPM(K)';e={ (Get-Process -Id $_.ProcessId).NonpagedSystemMemorySize/1KB -as [int]}},
+   @{l='PM(K)';e={ $_.PrivatePageCount/1KB -as [int]}},
+   @{l='WS(K)';e={ $_.WorkingSetSize/1KB -as [int]}},
+   @{l='VM(M)';e={ $_.VirtualSize/1mB -as [int]}},
+   @{l='CPU(s)';e={ (Get-Process -Id $_.ProcessId).CPU -as [int]}},
+   @{l='Id';e={ $_.ProcessId}},
+   'UserName'
+   @{l='ProcessName';e={ $_.ProcessName}}
+  )
+  Get-WmiObject Win32_Process | % { $_ | 
+      Add-Member -MemberType ScriptProperty -Name UserName -Value {
+          '{0}\{1}' -f $this.GetOwner().Domain,$this.GetOwner().User
+      } -Force -PassThru
+  }  
+}
+
+foreach ($procName in $SeleniumProcesses) 
+{
+  $processes = Get-WmiObject Win32_Process -Filter "name = '$procName'" | Where-Object {$_.GetOwner().User -eq $currentUser }  | Where-Object {$_.CommandLine -match "selenium-server"}
+  if ($Verbose) {
+    Write-Output "Filter: name = '$procName'"
+  }
+  foreach($proc in $processes)
+  {
+    Write-Output "stopping proccess $($proc.ProcessId) with $($proc.ThreadCount) threads; $($proc.CommandLine.Substring(0, 50))..."
+    Stop-Process -F $proc.ProcessId
+  }
+}
+
+foreach ($procName in $Browsers) 
+{
+  $processes = Get-WmiObject Win32_Process -Filter "name = '$procName'" | Where-Object {$_.GetOwner().User -eq $currentUser } 
+  if ($Verbose) {
+    Write-Output "Filter: name = '$procName'"
+  }
+  foreach($proc in $processes)
+  {
+     Write-Output "stopping proccess $($proc.ProcessId) with $($proc.ThreadCount) threads; $($proc.CommandLine.Substring(0, 50))..."
+     Stop-Process -F $proc.ProcessId
+  }
+}


[2/2] archiva git commit: Change version number for webapptest

Posted by ma...@apache.org.
Change version number for webapptest


Project: http://git-wip-us.apache.org/repos/asf/archiva/repo
Commit: http://git-wip-us.apache.org/repos/asf/archiva/commit/de5a585c
Tree: http://git-wip-us.apache.org/repos/asf/archiva/tree/de5a585c
Diff: http://git-wip-us.apache.org/repos/asf/archiva/diff/de5a585c

Branch: refs/heads/master
Commit: de5a585c9b543cb245b9702e43ea274070df6bf7
Parents: 3bb2fad
Author: Martin Stockhammer <ma...@apache.org>
Authored: Sun Apr 30 23:16:22 2017 +0200
Committer: Martin Stockhammer <ma...@apache.org>
Committed: Sun Apr 30 23:16:22 2017 +0200

----------------------------------------------------------------------
 archiva-modules/archiva-web/archiva-webapp-test/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/archiva/blob/de5a585c/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
----------------------------------------------------------------------
diff --git a/archiva-modules/archiva-web/archiva-webapp-test/pom.xml b/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
index cd01dc4..ecff6b4 100644
--- a/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
+++ b/archiva-modules/archiva-web/archiva-webapp-test/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-web</artifactId>
-    <version>2.2.2-SNAPSHOT</version>
+    <version>2.2.3-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-webapp-test</artifactId>
   <packaging>pom</packaging>