Skip to content

phellams/phellams-automator

Repository files navigation

🐳 Phellams-Automator

Static Badge

About The Project

Debian-based Docker image derived from Debian-12-slim.

Use case:

  • Build: PowerShell modules in the form of folder, .zip, or .nupkg.

  • Build: .NET binaries.

    • .NET SDK v8.0.412

      • Libraries and binaries (AOT)
    • .NET SDK v10.0.103

      • Libraries and binaries (AOT)
  • Build: NuGet packages:

    • GitLab .nupkg packages.
    • Chocolatey .nupkg packages.
    • ProGet NuGet .nupkg packages.
    • ProGet Chocolatey .nupkg packages.
  • Send: Codecov results/reports.

  • Send: Coveralls results/reports.

  • Build: RubyGems gems.

  • Build: Jekyll websites.

    • Build Gem-based Jekyll websites.

This image is intended to be used with the Automator-Devops automation suite to build and deploy PowerShell modules, .NET binaries, NuGet packages, Chocolatey packages, RubyGems packages, and Jekyll websites.

This image is not intended to be used as a standalone image. It is intended to be used with the Automator-Devops automation suite or other similar automation suites or scripts.


Features

Copy Build files:

NOTE! PowerShell module specific

  • Build-Module from Psmpacker. See the README for more information on how to use Psmpacker.

Build .NET binaries:

  • dotnet build. See the README for more information on how to use dotnet build.

Package .nupkg packages:

Package .nupkg packages compatible with psgallery, chocolatey, gitlab packages, github packages:

  • Chocolatey .nupkg packages: New-ChocoNuspecFile and New-ChocoPackage. See the README for more details on how to use Nupsforge.
  • ProGet NuGet .nupkg packages: New-NuspecPackageFile and New-NupkgPackage. See the README for more details on how to use Nupsforge.
  • ProGet Chocolatey .nupkg packages: New-ChocoNuspecFile and New-ChocoPackage. See the README for more details on how to use Nupsforge.

Generate Verification Checksums:

  • New-VerificationFile from csverify. See the README for more information on how to use csverify.

Generate Semantic Version using Get-GitAutoVersion cmdlet:

  • Git semantic versioning generator: Get-GitAutoVersion cmdlet.

Publish code coverage results to codecov:

  • Publish code coverage results to Codecov.

Publish code coverage results to coveralls:

  • Publish code coverage results to Coveralls.

Run PowerShell commands and scripts using default shell:

  • pwsh -c './phellams/myscript.ps1'

Build, pack, and deploy RubyGems:

  • [WIP] Build, pack, and deploy RubyGems packages using GemCommander. See the README for more details on how to use GemCommander.

Build, pack, and deploy Jekyll websites:

  • [WIP] Build, pack, and deploy Jekyll websites using JekyllCommander. See the README for more details on how to use JekyllCommander.

Image Manifest

arc docker docker docker

🟣 Binaries

🟑 Common Binaries

πŸ”΅ PowerShell Modules

  • βœ… Pester 5.5.0

    • Testing framework for PowerShell.
  • βœ… PSScriptAnalyzer 1.0

    • PowerShell script analyzer.
  • βœ… PowerShell-Yaml 1.0

    • PowerShell YAML parser.
  • βœ… ColorConsole

    • Colorful console output using ANSI escape sequences with the default PowerShell console color palette.
  • βœ… Tadpol

    • Progress bars, loaders, and spinners generator.
  • βœ… ShellDock

    • Simple runspace executor with progress indicator.
  • βœ… Quicklog

    • Console logger with color support.
  • βœ… Nupsforge

    • NuGet package generator supporting: psgallery, chocolatey, proget (psgallery, chocolatey), gitlab packages, github packages.
  • βœ… Psmpacker

    • Build folder generator.
  • βœ… CSVerify

    • Code verification via VERIFICATION.txt.
  • βœ… GitAutoVersion

    • Git semantic versioning generator.
  • βœ… Phwriter

    • Generate Linux man pages for PowerShell cmdlets/functions.
  • [WIP] GemCommander

    • Build and deploy RubyGems packages.
  • [WIP] JekyllCommander

    • Build and deploy Jekyll websites.

πŸ”΅ PowerShell Profile

  • βœ… PowerShell.profile.ps1

    • Custom PowerShell profile displaying image information.
    • Imports modules and functions from the ./includes folder.

Build

build

Building the image locally

Clone and run docker build -t phellams-automator -f phellams-automator.dockerfile . to build the image.

git clone https://gitlab.com/phellams/phellams-automator.git
cd phellams-automator
docker build -t phellams-automator -f phellams-automator.dockerfile .
docker image inspect phellams-automator #| jq

or alternatively, use the local build script:

# Windows
./phellams-automator-local-builder.ps1 -buildMode Base

# linux
sudo pwsh -c ./phellams-automator-local-builder.ps1 -buildMode Base

Local builds are tagged with :localbuild

Usage

Output image information

Default shell is pwsh and will output the container information.

docker run --rm phellams-automator

Mount path examples

# dynamic path
docker run -it -v .:/phellams-automator docker.io/sgkens/phellams-automator 

# absolute path
docker run -it -v $(pwd):/phellams-automator docker.io/sgkens/phellams-automator

Or, if you want to use the absolute path with WSL2:

# Wsl2
docker run -it -v $(wslpath -w $(pwd)):/phellams-automator docker.io/sgkens/phellams-automator
# Linux
docker run -it -v $(pwd):/phellams-automator docker.io/sgkens/phellams-automator

Examples running commands inside the container

# nuget
docker run --rm -v .:yourfolder docker.io/sgkens/phellams-automator nuget pack ./

# pester
docker run --rm -v .:yourfolder docker.io/sgkens/phellams-automator invoke-pester -script ./tests/tests.ps1

# psscriptanalyzer
docker run --rm -v .:yourfolder docker.io/sgkens/phellams-automator invoke-psscriptanalyzer -script ./tests/tests.ps1

# dotnet
docker run --rm -v .:yourfolder docker.io/sgkens/phellams-automator dotnet build

# gitautoversion
docker run --rm -v .:yourfolder docker.io/sgkens/phellams-automator (Get-Gitautoversion).Version

Interactive shell

docker run --rm -it -v .:yourfolder docker.io/sgkens/phellams-automator:latest

# Running script in container
docker run -it --rm -v $(pwd):/phellams -w /phellams sgkens/phellams-automator:latest pwsh -c './phellams/myscript.ps1'

Roadmap

🟑 Task List

  • Add Ruby support to allow building of jekyll websites
    • Add RubyGems support - required dependencies
  • Add Jekyll support
  • Add toml support with ptoml, and linux toml support
  • Add chocolatey support Chocolatey is not officially supported by linux* however it doesnt explicitly say it is not supported, use mono and compile choco for mono, use choco offical package, docker.io/chocolatey/choco:latest
  • Fix outstanding Security Vulnerabilities reported by dockerhub vulnerability scanner.
  • update nupsforge to support gitlab packages
  • Add coveralls
  • add codecov
  • add nuget via mono to access nuget v 6.x + in debian 12
  • use mono to attempt to run choco executable
    • opted to use mono docker image to run choco builds and deploy does support all but for build and deploy choco packages to chocolatey is sufficent.
  • Start porting binaries to Debian bins 13 slim and test

Contributing

Feel free to contribute! Fork the repo and submit a merge request with your improvements. Or, open an issue with the enhancement tag to discuss your ideas.

  1. Fork the Project from git clone https://gitlab.com/phellams/phellams-automator.git
  2. Create your Feature Branch check out the branch dev git switch dev.
    1. git switch -c feature/AmazingFeature
    2. or
    3. git checkout -b feature/AmazingFeature
  3. Commit your Changes git commit -m 'Add some AmazingFeature'
  4. Push to the Branch git push origin feature/AmazingFeature
  5. Open a Merge Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

Changelog

About

Docker image debian base containing .Net Core SDK, PowerShell Core.x, NuGet, Pester, PSScriptAnalyzer, PowerShell-Yaml, ColorConsole, Nupsforge, Psmpacker, CSVerify, GitAutoVersion, and custom PowerShell Profile.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors