# flexo

Provides an interface for creating a Flexo pipeline, which generates a full CI/CD pipeline based on a template. Also
provides helper functions to simplify aspects of working with Jenkinsfile Scripted Pipelines.

See: https://git-aws.internal.justin.tv/pages/flexo/flexo-docs/docs/pipelines/overview.html

## flexo.pipeline

Instantiates a new Flexo pipeline based on a `template` and allowed to run on agents that match `agentLabel`.

**USAGE**

Example:

```groovy
@Library('flexo-libs') _

flexo.pipeline(template: "DOTNETCORE_ECS") {
  ecrAssumeRoleArn = "arn:aws:iam::0123456789:role/PublishToECRRole"
  ecrRepository = "0123456789.dkr.ecr.us-west-2.amazonaws.com/my-dotnetcore-service"

  stagingAWSAccount = "012345678902"
  stagingECSAssumeRoleArn = "arn:aws:iam::012345678902:role/DeployToStagingRole"
  stagingECSTaskFamily = "MyDotnetcoreServiceTaskFamily"
  stagingCodeDeployApplication = "MyStagingCodeDeployApplication"
  stagingCodeDeployDeploymentGroup = "staging"

  productionAWSAccount = "012345678903"
  productionECSAssumeRoleArn = "arn:aws:iam::012345678903:role/DeployToProductionRole"
  productionECSTaskFamily = "MyDotnetcoreServiceTaskFamily"
  productionCodeDeployApplication = "MyProductionCodeDeployApplication"
  productionCodeDeployDeploymentGroup = "production"
}
```

## flexo.checkout

Checks out source code in the Jenkinsfile Scripted Syntax, also saving the results to environment variables as you would
get with the Declarative syntax.

```groovy
node {
  flexo.checkout()

  stage {
    echo "Current commit ID: ${env.GIT_COMMIT}"
  }
}
```
