normalizeci

command module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2022 License: MIT Imports: 5 Imported by: 0

README

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

NAME SLUG
Azure DevOps Pipeline azure-devops
GitLab CI/CD gitlab-ci
GitHub Actions github-actions
Local Git Repository local

Note: If none of the above systems is detected, repository information is determined based on the local Git repository.

supported repository types

  • git

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.

NAME SLUG
AppVeyor appveyor
AWS CodeBuild aws-codebuild
Bamboo bamboo
Bitbucket bitbucket
Bitrise bitrise
Buddy buddy
Buildkite buildkite
CircleCI circleci
Cirrus CI cirrusci
Codefresh codefresh
Codeship codeship
Drone drone
Jenkins jenkins
Sail CI sailci
Semaphore semaphore
Shippable shippable
TeamCity teamcity
Travis CI travis-ci
Wercker wercker

License

Released under the MIT license.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cli module
lib module
pkg module
cmd
spec module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL