Continuous Integration :: ActiveState Platform Documentation (original) (raw)

You can use the State Tool with your Continuous Integration (CI) and Continuous Delivery (CD) processes and tools to define simple and reliable processes for building, testing, and deploying your software projects. You can download a custom language runtime with your code’s specific language and package requirements, and run scripts as required throughout the build process.

The basic process you need to follow is:

  1. Gather environment variable settings: Retrieve the environment variables required to authenticate with the ActiveState Platform.
  2. CI/CD Setup: Configure the integration between your CI/CD and your code repository. For example, link your GitHub repository to your AppVeyor account and provide the necessary authorization to AppVeyor.
  3. Platform Setup: Create a Platform project with your language, operating system, and package requirements.
  4. Configure activestate.yaml: state activate to generate the activestate.yaml file for the project and add it to your code repository.
  5. Build Setup: Add a configuration file to your repository with the build configuration for your CI/CD tool that installs the State Tool and runs any other build steps. For example, a Jenkinsfile for Jenkins, or anappveyor.yml file for AppVeyor.
  6. Webhook Setup: Add a webhook to your version control repository if required. In some cases this may be completed automatically when you are integrating your code repository with the CI/CD tool in step 2. In other cases, it may be a manual step you need to complete.

For your convenience you may want to check out our Example Dockerfile to get you started quickly.

Gathering environment variable settings

Before you begin:

The State Tool will use the following environment variables if they are defined:

Obtaining your API Key

You can obtain an API key by opening a command prompt and running the following State Tool command:

state export new-api-key key-name

In this example, you would copy the token value (the long string at the end of the response) to use as the ACTIVESTATE_API_KEY environment variable in your CI/CD application.

Obtaining your Private Key

You can obtain your private key by opening a command prompt and running the following State Tool command:

Disabling Updates

It is recommended you disable updates on automated environments, so as not to interrupt your automations when state tool updates become available. To do this, simply run:

state config set autoupdate false

You can still manually update by running state update.