Created
July 5, 2017 13:47
-
-
Save stack72/51950268b873c3f8620d68e31b36e8a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <meta-runner name="Terraform Provider"> | |
| <description>Terraform Test Runner to stand up and destroy supporting infra for some of the Acceptance Test Providers</description> | |
| <settings> | |
| <parameters> | |
| <param name="WORKING_DIRECTORY" value="" /> | |
| <param name="TF_WORKDIR" value="" /> | |
| <param name="TF_VERSION" value="" /> | |
| <param name="TF_TESTVARS" value="" /> | |
| <param name="PROVIDER_NAME" value="" /> | |
| <param name="env.GOPATH" value="%system.teamcity.build.checkoutDir%" /> | |
| <param name="env.PATH" value="%env.PATH%:/usr/local/bin/go:%env.GOPATH%/bin:%system.teamcity.build.checkoutDir%/bin" /> | |
| </parameters> | |
| <build-runners> | |
| <runner name="Set git hash as build number" type="simpleRunner"> | |
| <parameters> | |
| <param name="script.content"><![CDATA[#!/bin/bash | |
| GIT_HASH=%system.build.vcs.number% | |
| GIT_HASH_SHORT=${GIT_HASH:0:7} | |
| echo "##teamcity[buildNumber '${GIT_HASH_SHORT}']"]]></param> | |
| <param name="teamcity.step.mode" value="default" /> | |
| <param name="use.custom.script" value="true" /> | |
| </parameters> | |
| </runner> | |
| <runner name="Download dependencies" type="simpleRunner"> | |
| <parameters> | |
| <param name="script.content"><![CDATA[wget -nv https://releases.hashicorp.com/terraform/%TF_VERSION%/terraform_%TF_VERSION%_linux_amd64.zip | |
| unzip -d %system.teamcity.build.checkoutDir%/bin/ terraform_%TF_VERSION%_linux_amd64.zip | |
| terraform version]]></param> | |
| <param name="teamcity.build.workingDir" value="%WORKING_DIRECTORY%" /> | |
| <param name="teamcity.step.mode" value="default" /> | |
| <param name="use.custom.script" value="true" /> | |
| </parameters> | |
| </runner> | |
| <runner name="Prepare infrastructure" type="simpleRunner"> | |
| <parameters> | |
| <param name="script.content"><![CDATA[terraform apply -input=false]]></param> | |
| <param name="teamcity.build.workingDir" value="%TF_WORKDIR%" /> | |
| <param name="teamcity.step.mode" value="default" /> | |
| <param name="use.custom.script" value="true" /> | |
| </parameters> | |
| </runner> | |
| <runner name="Run tests" type="simpleRunner"> | |
| <parameters> | |
| <param name="script.content"><![CDATA[go version | |
| go get github.com/2tvenom/go-test-teamcity | |
| cd %TF_WORKDIR% | |
| %TF_TESTVARS% | |
| cd %WORKING_DIRECTORY% | |
| make testacc TEST=./%PROVIDER_NAME% | go-test-teamcity]]></param> | |
| <param name="teamcity.build.workingDir" value="%WORKING_DIRECTORY%" /> | |
| <param name="teamcity.step.mode" value="default" /> | |
| <param name="use.custom.script" value="true" /> | |
| </parameters> | |
| </runner> | |
| <runner name="Destroy infrastructure" type="simpleRunner"> | |
| <parameters> | |
| <param name="script.content"><![CDATA[terraform destroy -force]]></param> | |
| <param name="teamcity.build.workingDir" value="%TF_WORKDIR%" /> | |
| <param name="teamcity.step.mode" value="execute_always" /> | |
| <param name="use.custom.script" value="true" /> | |
| </parameters> | |
| </runner> | |
| </build-runners> | |
| <requirements /> | |
| </settings> | |
| </meta-runner> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment