All Projects → RamblingCookieMonster → Buildhelpers

RamblingCookieMonster / Buildhelpers

Licence: mit
Helper functions for PowerShell CI/CD scenarios

Programming Languages

powershell
5483 projects

Projects that are alternatives of or similar to Buildhelpers

Psdeploy
Simple PowerShell based deployments
Stars: ✭ 302 (+73.56%)
Mutual labels:  build, build-automation, continuous-deployment, ci-cd
Flubucore
A cross platform build and deployment automation system for building projects and executing deployment scripts using C# code.
Stars: ✭ 695 (+299.43%)
Mutual labels:  build, build-automation, continuous-integration, continuous-deployment
Nevergreen
🐤 A build monitor with attitude
Stars: ✭ 170 (-2.3%)
Mutual labels:  continuous-integration, continuous-deployment, ci-cd
Agola
Agola: CI/CD Redefined
Stars: ✭ 783 (+350%)
Mutual labels:  continuous-integration, continuous-deployment, ci-cd
Build
Netlify Build runs the build command, Build Plugins and bundles Netlify Functions.
Stars: ✭ 135 (-22.41%)
Mutual labels:  build, continuous-integration, continuous-deployment
Nginx Builder
A tool to build deb or rpm package of required Nginx version from the source code, with the ability to connect third-party modules. Nginx parameters are set in the yaml configuration file.
Stars: ✭ 123 (-29.31%)
Mutual labels:  build, build-automation, ci-cd
Gocd
Main repository for GoCD - Continuous Delivery server
Stars: ✭ 6,314 (+3528.74%)
Mutual labels:  continuous-integration, continuous-deployment, ci-cd
Ci Detector
Detect continuous integration environment and get information of current build
Stars: ✭ 138 (-20.69%)
Mutual labels:  build-automation, appveyor, continuous-integration
Origin
Conformance test suite for OpenShift
Stars: ✭ 8,046 (+4524.14%)
Mutual labels:  continuous-integration, continuous-deployment, ci-cd
Flow Core X
Powerful and user-friendly CI / CD server with high availability, parallel build, agent scaling
Stars: ✭ 1,108 (+536.78%)
Mutual labels:  build-automation, continuous-integration, ci-cd
Dyn365 Ce Devops
DevOps for Dynamics 365 Customer Engagement (CE) is becoming a popular topic. The goal of this project is to help Dynamics 365 CE solution builders understand and accelerate their implementation of DevOps practices with Dynamics CE and VSTS.
Stars: ✭ 82 (-52.87%)
Mutual labels:  build-automation, continuous-integration, continuous-deployment
old vespene
DISCONTINUED: a frozen fork will exist forever at mpdehaan/vespene
Stars: ✭ 672 (+286.21%)
Mutual labels:  build, continuous-integration, continuous-deployment
Drone
Drone is a Container-Native, Continuous Delivery Platform
Stars: ✭ 24,287 (+13858.05%)
Mutual labels:  build-automation, continuous-integration, ci-cd
Platform Espressif32
Espressif 32: development platform for PlatformIO
Stars: ✭ 333 (+91.38%)
Mutual labels:  build, continuous-integration, continuous-deployment
Dyn365 Ce Vsts Tasks
VSTS Extension for Dynamics 365 Customer Engagement
Stars: ✭ 94 (-45.98%)
Mutual labels:  build-automation, continuous-integration, continuous-deployment
Cargo Make
Rust task runner and build tool.
Stars: ✭ 895 (+414.37%)
Mutual labels:  build, build-automation, appveyor
Android-CICD
This repo demonstrates how to work on CI/CD for Mobile Apps 📱 using Github Actions 💊 + Firebase Distribution 🎉
Stars: ✭ 37 (-78.74%)
Mutual labels:  continuous-integration, continuous-deployment, ci-cd
Serverless Plugin Canary Deployments
Canary deployments for your Serverless application
Stars: ✭ 283 (+62.64%)
Mutual labels:  continuous-integration, continuous-deployment, ci-cd
Git Push Deploy
Simple Automated CI/CD Pipeline for GitHub and GitLab Projects
Stars: ✭ 21 (-87.93%)
Mutual labels:  continuous-integration, continuous-deployment, ci-cd
Leeroyci
Leeroy is a self hosted, continuous integration and build service
Stars: ✭ 84 (-51.72%)
Mutual labels:  build-automation, continuous-integration, continuous-deployment

Build status

BuildHelpers

This is a quick and dirty PowerShell module with a variety of helper functions for PowerShell CI/CD scenarios.

Many of our build scripts explicitly reference build-system-specific features. We might rely on $ENV:APPVEYOR_REPO_BRANCH to know which branch we're in, for example.

This certainly works, but we can enable more portable build scripts by bundling up helper functions, normalizing build variables, and avoiding build-system-specific features.

Pull requests and other contributions welcome!

Instructions

# One time setup
    # Download the repository
    # Unblock the zip
    # Extract the BuildHelpers folder to a module path (e.g. $env:USERPROFILE\Documents\WindowsPowerShell\Modules\)

    #Simple alternative, if you have PowerShell 5, or the PowerShellGet module:
        Install-Module BuildHelpers

# Import the module.
    Import-Module BuildHelpers

# Get commands in the module
    Get-Command -Module BuildHelpers

# Get help
    Get-Help Get-BuildVariable -Full
    Get-Help about_BuildHelpers

Examples

Get Normalized Build Variables

Get-BuildVariable

# We assume you're in the project root. If not, specify a path:
Get-BuildVariable -Path C:\MyProjectRoot

Get Project Name

We occasionally need to reference the project or module name:

Get-ProjectName

This checks the following expected file system organizations, in order:

(1) File structure:

  • ProjectX (Repo root)
    • ProjectX (Project here)

Output: ProjectX

(2) File structure:

  • ProjectX (Repo root)
    • DifferentName (Project here. tsk tsk)
      • DifferentName.psd1

Output: DifferentName

(3) File structure:

  • ProjectX (Repo root)
    • ProjectX.psd1 (Please don't use this organization...)

Output: ProjectX

(5) File structure:

  • ProjectWhatever (Repo root)
    • src (or source)
      • ProjectX.psd1

Output: ProjectX

(6) File structure:

  • ProjectX
    • NoHelpfulIndicatorsOfProjectName.md

Output: ProjectX

Create Normalized Environment Variables

This runs a few commands from BuildHelpers module, and populates ENV:BH... variables

# Read the current environment, populate env vars
Set-BuildEnvironment

# Read back the env vars
Get-Item ENV:BH*

Here's an example, having run Set-BuildEnvironment in an AppVeyor project:

AppVeyor Example

Update your FunctionsToExport

During the module authoring process, updating FunctionsToExport can be tedious, so many folks leave this set to '*', missing out on module auto-loading and other benefits.

To get the best of both worlds, use FunctionsToExport='*', and use Set-ModuleFunction in your build before deployment:

# Set your build environment (we use this to get psd1 path)
Set-BuildEnvironment

# Check current FunctionsToExport:
Select-String -Path .\PSSlack\PSSlack.psd1 -Pattern FunctionsToExport

    # PSSlack\PSSlack.psd1:61:FunctionsToExport = '*'

# Update the psd1 with Set-ModuleFunction:
Set-ModuleFunction

# Check FunctionsToExport again:
Select-String -Path .\PSSlack\PSSlack.psd1 -Pattern FunctionsToExport

    # PSSlack\PSSlack.psd1:61:FunctionsToExport = @('Find-SlackMessage','Get-PSSlackConfig','Get-SlackChannel','Get-SlackHistory','Get-SlackUser','New-SlackField','New-SlackMessage','New-SlackMessageAttachment','Send-SlackApi','Send-SlackFile','Send-SlackMessage','Set-PSSlackConfig')

Update your ModuleVersion

Typical examples take an existing PSD1 file and bump the module version from that. Not so helpful if you don't commit that version to Git: The next time you bump the version, you're bumping the original version.

# Get the latest version for a project
$Version = Get-NextNugetPackageVersion -Name $env:BHProjectName

# Update the module metadata with the new version - thanks to Joel Bennett for this function!
Update-Metadata -Path $env:BHPSModuleManifest -PropertyName ModuleVersion -Value $Version

Notes

Thanks to Joel Bennett for the ConvertTo-Metadata function that we use in Set-ModuleFunction!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].