Giter VIP home page Giter VIP logo

gitops-with-private-bitbucket-pipelines-and-argocd's Introduction

GitOps CI/CD with Bitbucket Pipelines for a Simple TypeScript (Node.js) Application

This is one of my exploratory project to dive into DevOps practices. This is not a working "out of the box" example but more of a general reference repository


what's Involved:

  • Tested with nodejs v14.21.3 on Mac (intel)
  • A Kubernetes (k8s) cluster (validated on remote, but should also be operable locally)
  • ArgoCD installed in the cluster
  • A container image repository
  • A private Bitbucket repository to host Helm charts for all applications (lets call it helm charts repository)
  • This Bitbucket repository (application repository) containing the TypeScript code, along with the application Helm chart, which gets copied over to the central Helm charts repository

Clarifications

  • This repository represents 'awesome' application which runs as container / service in kubernetes. Each application will have its own repository and similar pipeline. helm charts repository will contain helm charts for each service

  • The clone uses authentication token because it clones and pushes a private repository


working with repository

init repository

npm install && npm run build

run test

npm run test

workflow:

When you update your code and push it to the application repository, the CI/CD pipeline does the following:

  • If a tag is included (it should contain the application version) using git push --follow-tags:
    • The semver is validated
    • The container image is built and pushed
    • The Helm chart is updated with the new version and copied to the helm charts repository
  • If a tag is not included, it checks if the Helm chart is updated. If it is, it gets copied to the helm charts repository
  • ArgoCD picks up the Helm changes from the helm charts repository and deploys it to the cluster

what could be improved?

Here are some additional functionalities and improvements you could consider:

  • Have pipeline scripts in a seperate repository that uploads them to S3/GCS and pipeline downloads them and executes them. This will allow for central management of pipeline scripts (this is parcial solution that makes increasing number of application repositories maintanace a bit easier).
  • Different flows for different tags
  • Adding an ingress to the Helm chart (you should have an ingress controller)
  • Reducing the size of the container
  • Scanning code for security issues / lint
  • Adding more services
  • Incorporating and running tests in the CI/CD pipeline

Feedback, Questions and Contributions

Think something could be improved or have questions?
Found an error or oversight?
Feel free to open an issue or send a pull request.

gitops-with-private-bitbucket-pipelines-and-argocd's People

Contributors

alegmal 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.