Skip to content

A tool to turn the continuous integration / deployment variables into a common format for generally usable scripts without any dependencies.

License

Notifications You must be signed in to change notification settings

cidverse/normalizeci

Repository files navigation

normalize.ci

Go Reference Go Report Card OpenSSF Scorecard

A cli tool (or go library) to provide a foundation for a platform-agnostic CICD process.

Documentation: https://cidverse.github.io/normalizeci/

Quick Links:

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 (i.e. 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 normalize --format export --output nci.env generate nci variables in format export for unix systems, stored as file
2 normalizeci normalize --format powershell generate nci variables in format export for windows powershell, written to stdout
3 normalizeci normalize --output nci.env generate nci variables in the suggested format for the current system
4 normalizeci normalize --hostenv --output nci.env additionally to 3 includes all env vars from the host
5 normalizeci normalize --format cmd generate nci variables in format export for windows cmd, written to stdout
6 normalizeci denormalize --target gitlab generate a gitlab ci like environment based on the normalized environment
7 normalizeci version print version information

file based

Linux/MacOS

normalizeci normalize --format export --output nci.env
source nci.env
rm nci.env

Windows

normalizeci normalize --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 normalize)

Windows

$nenv = normalizeci normalize
Invoke-Expression "$nenv"

library

Install the latest version as library:

go get -u github.com/cidverse/normalizeci/pkg

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
AppVeyor appveyor
Azure DevOps Pipeline azure-devops
CircleCI circleci
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
AWS CodeBuild aws-codebuild
Bamboo bamboo
Bitbucket bitbucket
Bitrise bitrise
Buddy buddy
Buildkite buildkite
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

If a system is missing in this list, please open an issue.

License

Released under the MIT license.

About

A tool to turn the continuous integration / deployment variables into a common format for generally usable scripts without any dependencies.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages