Code Monkey home page Code Monkey logo

spacelift-poc's Introduction

spacelift POC

foundation

spacelift configuration is managed as terraform files here.

  • The stack that points to the foundation subfolder must be an administrative one.
  • If you want to use spacectl stack local-preview --id <stack-id> the stack must have enable_local_preview set to true.
  • policies.tf contains a plan policy to disallow resource groups without mandatory tags and a notification policy to send a mattermost message for failed runs.
  • The mattermost webhook is currently manually added to spacelift as the url must be considered a secret.
  • Private worker pool is configured in the file worker-pool.tf the worker itself in vm.tf and identity.tf
  • The azure-dev stack runs on the private worker
  • Modules are set up in modules.tf
  • A context is created and bound to the foundation and azure-dev stacks. The ssh public key for the vms and the azurerm env vars are currently manually added to the context.

stack1

/stack1 is creating two outputs hello_world and hello_dog

stack2

/stack2 reads output hello_dog from /stack1 and outputs itself hello_dog

To enable stack2 to read the output of stack1 you have to enable External state access in spacelift on stack1 and Administrative on stack2

โ— Be sure to reference stack1's stack id instead of the stack's name as workspace name in stack2/main.tf. The id doesn't change when you rename the stack.

env/dev

/env/dev is the azure-dev stack. Used to deploy to Azure. At the moment only one vm. Using federated credentials to access the Azure API.

modules

Two modules to test the module registry. The configuration for the modules are in the .spacelift directory. Documentation can be found in the module configuration docs

ToDo

  • Approval policy
  • Use GitHub App on GHES
  • Use secrets from Azure Key Vault eg. mattermost webhook

Questions, thoughts

  • stack ID should be a random ID and more prominently featured to avoid confusion
  • way to roll everything back if deployment didn't work
  • How to work with all the checks in branch protection rules

spacelift-poc's People

Contributors

msamendinger avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.