Skip to content

Latest commit

 

History

History
108 lines (93 loc) · 4.86 KB

README.md

File metadata and controls

108 lines (93 loc) · 4.86 KB

Victor

Victor is always here to assist you through continuous deployment, and especially when updating and storing Pulumi stack states in webservers through a GitHub Action workflow or a Drone pipeline.

reference docker pulls go report Coverage Status
License CI CodeQL
OpenSSF Scoreboard

How to use

You can drop the following into your GitHub Action workflow.

name: 'My workflow'

on:
  push:
    branches:
      - 'main'

jobs:
  my-job:
    runs-on: 'ubuntu-latest'
    steps:
      - name: 'Victor CD'
        uses: 'ctfer-io/victor@v0'
        with:
          # Webserver related options
          statefile: 'https://my-webserver.dev/project.stack.state'
          username: ${{ secrets.WEBDAV_USERNAME }}
          password: ${{ secrets.WEBDAV_PASSWORD }}
          # Pulumi related options
          passphrase: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
          context: './deploy'
          resources:
            - "kubernetes 3.29.1"
            - "random 4.13.2"
          configuration:
            - "namespace prod"
            - "version v1.5.2"
          server: 'https://my-webserver.dev/pulumi'
          outputs: 'outputs.json'
        # Specific environment variables that fit your context (e.g. offline)
        env:
          MY_VAR1: 'my_value'
          MY_VAR2: ${{ secrets.MY_VAR2 }}

Alternatively, you can use it in a Drone pipeline (type: docker).

steps:
  - name: victor
    image: ctferio/victor:latest
    settings:
      # Webserver related options
      statefile: https://my-webserver.dev/project.stack.state
      username:
        from_secret: WEBSERVER_USERNAME
      password:
        from_secret: WEBSERVER_PASSWORD
      # Pulumi related options
      passphrase:
        from_secret: PULUMI_CONFIG_PASSPHRASE
      context: ./deploy
      resources:
        - "kubernetes 3.29.1"
        - "random 4.13.2"
      configuration:
        - "namespace prod"
        - "version v1.5.2"
      server: https://my-webserver.dev/pulumi
      outputs: outputs.json
    # Specific environment variables that fit your context (e.g. offline)
    environment:
      MY_VAR1: "my_value"
      MY_VAR2:
        from_secret: MY_VAR2

How it works

The following resumes what Victor does for you.

How it works in a GitHub Action workflow or a Drone pipeline

Here are more explanation:

  1. Get stack if exist: Victor create a new Pulumi workspace in your GitHub Action workflow or Drone pipeline, then create a stack, and if the webserver contains a state file, loads it. This enable the following to work properly.
  2. Update: by comparing the existing and actualised resources (does a refresh first) to the target, Victor enable fine-grained continuous deployment of your resources.
  3. Push updated stack: finally, Victor exports the stack state file and uploads it in the webserver such that future iterations will be able to load it, to really do continuous deployment.

Why using it ?

So why doing it with a GitHub Action or a Drone plugin rather than using multiple steps ?

Simplicity

Using this plugin, you ease your Continuous Deployments from a GitHub Action workflow or a Drone pipeline, without the need to maintain plugin updates, stack import and export, basic authentication handling... Yes you can work without it, but why not simplify your job and focus on the real business value ?