Skip to content

Instantly share code, notes, and snippets.

$image = "redis"
$containerName = "river-cache"
$hostPort = 6379
$containerPort = 6379
$attempts = 0
$maxAttempts = 3
$startSuccess = $false
do {
$image = "rabbitmq"
$containerName = "river-queue"
$attempts = 0
$maxAttempts = 3
$startSuccess = $false
# https://stackoverflow.com/questions/54217076/docker-port-bind-fails-why-a-permission-denied
do {
param ([switch]$mount)
$image = "mysql"
$containerName = "river-mysql"
$hostPort = 3306
$containerPort = 3306
$attempts = 0
$maxAttempts = 3
$startSuccess = $false
$image = "hyness/spring-cloud-config-server"
$name = "river-cloud-config"
$attempts = 0
$startSuccess = $false
$maxAttempts = 3
$configPath = (Get-Item (Join-Path $PSScriptRoot "../../river-flow-config/local")).FullName.Replace("\", "/")
do {
param([switch]$all, [int]$top)
Push-Location $PSScriptRoot
# Eureka takes longest. start first in new window, takes a while, lots of continual Eureka output
"Launching Eureka startup in another process"
Invoke-Expression 'cmd /c start powershell -NoProfile -Command { .\eureka-start.ps1 }'
""
# Start Spring Cloud Config server for Producer and Consumer configuration.
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[ValidateRange(1, 180)]
[int]$daysBack = 7,
[Parameter(Mandatory=$false)]
[string]$author,
[Parameter(Mandatory=$false)]
param([string]$checkoutBranch = "develop")
function Get-AllRepos ([string]$checkoutBranch = "develop")
{
Get-ChildItem -Recurse -Depth 2 -Force |
Where-Object { $_.Mode -match "h" -and $_.FullName -like "*\.git" } |
ForEach-Object {
$dir = Get-Item (Join-Path $_.FullName "../")
pushd $dir
function Remove-MergedBranches
{
Get-ChildItem -Recurse -Depth 2 -Force |
Where-Object { $_.Mode -match "h" -and $_.FullName -like "*\.git" } |
ForEach-Object {
$dir = Get-Item (Join-Path $_.FullName "../")
pushd $dir
"removing merged branches in $($dir.Name)"
git branch --merged | %{$_.trim()} | ?{$_ -notmatch 'develop' -and $_ -notmatch 'master'} | %{git branch -d $_}
function Remove-MergedBranches
{
Get-ChildItem -Recurse -Depth 2 -Force |
Where-Object { $_.Mode -match "h" -and $_.FullName -like "*\.git" } |
ForEach-Object {
$dir = Get-Item (Join-Path $_.FullName "../")
pushd $dir
"removing merged branches in $($dir.Name)"
git branch --merged | %{$_.trim()} | ?{$_ -notmatch 'develop' -and $_ -notmatch 'master'} | %{git branch -d $_}
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[ValidateScript({
if (-Not ($_ | Test-Path) ) {
throw "repos root path does not exist"
}
if (-Not ($_ | Test-Path -PathType Container) ) {
throw "Repos root must be a folder"
}