Skip to content

Instantly share code, notes, and snippets.

@soerenmartius
Created March 29, 2020 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soerenmartius/dc9dbb092f40def2ed6337fdc1a18927 to your computer and use it in GitHub Desktop.
Save soerenmartius/dc9dbb092f40def2ed6337fdc1a18927 to your computer and use it in GitHub Desktop.
SemaphoreCI Pipeline Configuration
version: v1.0
name: "IaC-Github CI Pipeline"
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
global_job_config:
env_vars:
- name: BUILD_TOOLS_VERSION
value: v0.1.2
- name: TF_IN_AUTOMATION
value: "yes"
- name: TERRAFORM_PLANFILE
value: "out.tfplan"
secrets:
- name: github_access_token
- name: aws_access_credentials
prologue:
commands:
- checkout --use-cache
blocks:
- name: "Lint and Plan"
task:
prologue:
commands:
- cache clear
jobs:
- name: "Pre Commit Hooks"
commands:
- make pre-commit-hooks
- name: "Terraform Plan"
commands:
- make terraform-init
- make terraform-plan
- cache store terraform-wd-$SEMAPHORE_GIT_BRANCH .terraform
- cache store terraform-planfile-$SEMAPHORE_GIT_BRANCH $TERRAFORM_PLANFILE
promotions:
- name: "IaC-GitHub Deploy to GitHub"
pipeline_file: deploy.yml
auto_promote:
when: "branch = 'master'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment