# DSTY - jenkins-std-lib (Shared Library) - Install programs like terraform, packer and AWS CLI easily!

**URL:** https://community.jenkins.io/t/dsty-jenkins-std-lib-shared-library-install-programs-like-terraform-packer-and-aws-cli-easily/748
**Category:** Showing Off
**Created:** [November 5, 2021, 1:30pm UTC](https://community.jenkins.io/t/dsty-jenkins-std-lib-shared-library-install-programs-like-terraform-packer-and-aws-cli-easily/748 "2021-11-05T13:30:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![shadycuz](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/shadycuz/32/196_2.png) [@shadycuz](https://community.jenkins.io/u/shadycuz)
#### Post date: [November 5, 2021, 1:30pm UTC](https://community.jenkins.io/t/dsty-jenkins-std-lib-shared-library-install-programs-like-terraform-packer-and-aws-cli-easily/748/1 "2021-11-05T13:30:02Z")

</div>

[DontShaveTheYak](https://github.com/DontShaveTheYak) has released [v0.11.0](https://github.com/DontShaveTheYak/jenkins-std-lib/releases/tag/0.11.0) of the [jenkins-std-lib](https://github.com/DontShaveTheYak/jenkins-std-lib).

This release is more of a building block to accelerate the development of other features in the future. The classes in the new `programs` package are meant to aid in the downloading of executables from remote locations. Right now only HTTP servers are available but in the future other sources can be added like AWS S3, pip or npm.

Checkout the example jobs [here](https://github.com/DontShaveTheYak/jenkins-std-lib/tree/master/jobs/system/os/programs), which demonstrates most of the new features. Hosted javadoc documentation is available [here](https://javadoc.io/doc/io.github.dontshavetheyak/jenkins-std-lib/latest/index.html).

A sneak peak:

```auto
node() {

    // Clear the workspace
    Path.workspace().deleteContents()

    // The version we want to install
    final String pinnedVersion = '1.0.0'

    TerraformInstaller tfInstaller = new TerraformInstaller(pinnedVersion)

    // Install the terraform binary and get back a generic cli tool
    CliTool terraform = tfInstaller.install()

    // Get the version output for testing
    String version = terraform.runCommand('--version').stdOut

    // Test that the version is the one we pinned
    if (!version.contains(pinnedVersion)) {

        error("The version ${pinnedVersion} was not installed.")

    }

    // Does nothing since it is already installed
    tfInstaller.install()

    // Install the latest version
    tfInstaller = new TerraformInstaller()

    terraform = tfInstaller.install()

    version = terraform.runCommand('--version').stdOut

    // Test the version installed is no longer the pinned version
    if (version.contains(pinnedVersion)) {

        error('The latest version was not installed.')

    }

}

```

Shameless plug below 😅

If you are using the vscode IDE, then I highly recommend my [Jenkins Extension Pack](https://marketplace.visualstudio.com/items?itemName=DontShaveTheYak.jenkins-extension-pack) which gives you auto completion and javadoc comments directly in your IDE.
