Copyright | (c) Denis Shevchenko, 2016 |
---|---|
License | MIT |
Maintainer | me@dshevchenko.biz |
Stability | alpha |
Safe Haskell | None |
Language | Haskell2010 |
API calls for work with Environment Variables used in project build.
For more info please see "Environment variables" section in your CircleCI project's Settings.
- getEnvVars :: ProjectPoint -> CircleCIResponse [EnvVar]
- getEnvVar :: ProjectPoint -> EnvVarName -> CircleCIResponse EnvVar
- addEnvVar :: ProjectPoint -> EnvVar -> CircleCIResponse EnvVar
- deleteEnvVar :: ProjectPoint -> EnvVarName -> CircleCIResponse EnvVarDeleted
- data EnvVar = EnvVar {}
- data EnvVarDeleted
- type EnvVarName = Text
- module Network.CircleCI.Common.Types
- module Network.CircleCI.Common.Run
API calls
:: ProjectPoint | Names of GitHub user/project. |
-> CircleCIResponse [EnvVar] | List of environment variables. |
Shows list of environment variables for the single project. Based on https://circleci.com/docs/api/#list-environment-variables.
Usage example:
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} import Network.CircleCI main :: IO () main = runCircleCI (getEnvVars $ ProjectPoint "denisshevchenko" "circlehs") (AccountAPIToken "e64c674195b87d76e988e9fbcba2whatever") >>= \case Left problem -> print problem Right envVars -> print envVars
:: ProjectPoint | Names of GitHub user/project. |
-> EnvVarName | Environment variable name. |
-> CircleCIResponse EnvVar | Environment variable. |
Shows single environment variable. Based on https://circleci.com/docs/api/#get-environment-variable.
Usage example:
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} import Network.CircleCI main :: IO () main = runCircleCI (getEnvVar project "GCC") token >>= \case Left problem -> print problem Right envVar -> print envVar where project = ProjectPoint "denisshevchenko" "circlehs" token = AccountAPIToken "e64c674195b87d76e988e9fbcba2whatever"
:: ProjectPoint | Names of GitHub user/project. |
-> EnvVar | Environment variable. |
-> CircleCIResponse EnvVar | Added environment variable. |
Adds environment variable. Based on https://circleci.com/docs/api/#add-environment-variable.
Usage example:
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} import Network.CircleCI main :: IO () main = runCircleCI (addEnvVar project envVar) token >>= \case Left problem -> print problem Right newEnvVar -> print newEnvVar where project = ProjectPoint "denisshevchenko" "circlehs" envVar = EnvVar "GCC" "/usr/local/bin/gcc-4.8" token = AccountAPIToken "e64c674195b87d76e988e9fbcba2whatever"
:: ProjectPoint | Names of GitHub user/project. |
-> EnvVarName | Environment variable name. |
-> CircleCIResponse EnvVarDeleted | Info about environment variable deleting. |
Deletes single environment variable. Based on https://circleci.com/docs/api/#delete-environment-variable.
Usage example:
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE LambdaCase #-} import Network.CircleCI main :: IO () main = runCircleCI (deleteEnvVar project "GCC") token >>= \case Left problem -> print problem Right isDeleted -> print isDeleted where project = ProjectPoint "denisshevchenko" "circlehs" token = AccountAPIToken "e64c674195b87d76e988e9fbcba2whatever"
Types for calls and responses
Environment variable, name/value.
data EnvVarDeleted Source
Environment variable deleting status.
type EnvVarName = Text Source
Name of environment variable.
module Network.CircleCI.Common.Run