normalize.ci
A cli tool (or go library) to provide a foundation for a platform-agnostic CICD process.
features
- normalization - check the env vars and the local repository to provide a common set of env vars on any ci platform.
- compatibility - convert the common env vars into a specific format (ie. gitlab) to run a script made for gitlab on any ci provider.
installation
You can download the binaries from the project releases: https://github.com/cidverse/normalizeci/releases
Linux:
sudo curl -L -s -o /usr/local/bin/normalizeci https://github.com/cidverse/normalizeci/releases/download/v1.0.0/linux_amd64
sudo chmod +x /usr/local/bin/normalizeci
(available builds: linux_386, linux_amd64, windows_386, windows_amd64, darwin_386, darwin_amd64)
usage
cli
Examples:
Id |
Command |
Description |
1 |
normalizeci --format export --output nci.env |
generate nci variables in format export for unix systems, stored as file |
2 |
normalizeci --format powershell |
generate nci variables in format export for windows powershell, written to stdout |
3 |
normalizeci --output nci.env |
generate nci variables in the suggested format for the current system |
4 |
normalizeci --hostenv --output nci.env |
additionally to 3 includes all env vars from the host |
5 |
normalizeci --format cmd |
generate nci variables in format export for windows cmd, written to stdout |
6 |
normalizeci -v |
print version information |
file based
Linux/MacOS
normalizeci --format export --output nci.env
source nci.env
rm nci.env
Windows
normalizeci --format powershell --output nci.ps1
& .\nci.ps1
rm nci.ps1
terminal session
The NormalizeCI CLI will return the commands to set the normalized variables in your current terminal session, so you need to run the response of the command.
Linux/MacOS
eval $(normalizeci run)
Windows
$nenv = normalizeci
Invoke-Expression "$nenv"
library
Install the latest version as library:
go get -u github.com/cidverse/normalizeci
And access the normalized environment, by default it will search for the vcs repo based on the current working directory.
var normalized = normalizeci.RunDefaultNormalization()
normalized variables (!)
supported systems
Note: If none of the above systems is detected, repository information is determined based on the local Git repository.
supported repository types
planned systems
Note:: If you want to contribute, feel free to pick one of the following services and add a package to normalize their variables.
License
Released under the MIT license.