Giter Site home page Giter Site logo

update-kustomization's Introduction

Update Kustomization

An CI image for updating image tags using kustomize.

Environment variables:

  • SSH_KEY: Base64-encoded private ssh key of MANIFEST_USER
  • MANIFEST_HOST: Manifest git server host
  • MANIFEST_USER: Manifest git user name
  • MANIFEST_USER_EMAIL: Manifest git user email
  • MANIFEST_REPO: Manifest git repository
  • MANIFEST_BRANCH: Manifest repository branch
  • IMAGES: Updated images (comma-separated list)
  • IMAGE_TAG: Image tag generated in current build
  • KUSTOMIZATION: Kustomization path relative to the project root

Drone Usage Example

kind: pipeline
name: publish-mysvc1
steps:
- name: publish
  image: plugins/docker
  settings:
    context: mysvc1
    dockerfile: mysvc1/Dockerfile
    username:
      from_secret: docker_username
    password:
      from_secret: docker_password
    registry: harbor.mycompany.com
    repo: harbor.mycompany.com/myuser/mysvc1
    tags:
    - ${DRONE_COMMIT_BRANCH}-${DRONE_COMMIT_SHA:0:7}
    - latest
  when:
    event: push

---
kind: pipeline
name: publish-mysvc2
steps:
- name: publish
  image: plugins/docker
  settings:
    context: mysvc2
    dockerfile: mysvc2/Dockerfile
    username:
      from_secret: docker_username
    password:
      from_secret: docker_password
    registry: harbor.mycompany.com
    repo: harbor.mycompany.com/myuser/mysvc2
    tags:
    - ${DRONE_COMMIT_BRANCH}-${DRONE_COMMIT_SHA:0:7}
    - latest
  when:
    event: push
    
---
kind: pipeline
name: update-kustomization
steps:
- name: kustomization
  pull: if-not-exists
  image: minghsu0107/update-kustomization
  environment:
    SSH_KEY:
      from_secret: ssh_key
    MANIFEST_HOST: git.mycompany.com
    MANIFEST_USER: myuser
    MANIFEST_USER_EMAIL: [email protected]
    MANIFEST_REPO: myapp-manifests
    MANIFEST_BRANCH: main
    IMAGES: harbor.mycompany.com/myuser/mysvc1,harbor.mycompany.com/myuser/mysvc2
    IMAGE_TAG: ${DRONE_COMMIT_BRANCH}-${DRONE_COMMIT_SHA:0:7}
    KUSTOMIZATION: overlays/production
  when:
    event: push
depends_on:
 - publish-mysvc1
 - publish-mysvc2

In the above example, the image tag is in the form of ${DRONE_COMMIT_BRANCH}-${DRONE_COMMIT_SHA:0:7}, where DRONE_COMMIT_BRANCH and DRONE_COMMIT_SHA are environment variables provided by Drone at run time.

update-kustomization's People

Contributors

minghsu0107 avatar anupriya17 avatar

Watchers

 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.