All Projects → azionaventures → aziona-cli

azionaventures / aziona-cli

Licence: GPL-3.0 license
azionaventures.github.io/aziona-cli/

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects
Dockerfile
14818 projects
Makefile
30231 projects

Labels

Projects that are alternatives of or similar to aziona-cli

Chart Releaser Action
A GitHub Action to turn a GitHub project into a self-hosted Helm chart repo, using helm/chart-releaser CLI tool
Stars: ✭ 146 (+942.86%)
Mutual labels:  ci-cd
Pypyr
pypyr task-runner cli & api for automation pipelines. Automate anything by combining commands, different scripts in different languages & applications into one pipeline process.
Stars: ✭ 173 (+1135.71%)
Mutual labels:  ci-cd
Psdepend
PowerShell Dependency Handler
Stars: ✭ 212 (+1414.29%)
Mutual labels:  ci-cd
Fabric8
fabric8 is an open source microservices platform based on Docker, Kubernetes and Jenkins
Stars: ✭ 1,783 (+12635.71%)
Mutual labels:  ci-cd
Godot Ci
Docker image to export Godot Engine games. Templates for Gitlab CI and GitHub Actions to deploy to GitLab Pages/GitHub Pages/Itch.io.
Stars: ✭ 168 (+1100%)
Mutual labels:  ci-cd
Ofc Bootstrap
Bootstrap OpenFaaS Cloud for your team
Stars: ✭ 178 (+1171.43%)
Mutual labels:  ci-cd
Tensor
Tensor - Comprehensive web-based automation framework and Centralized infrastructure management platform
Stars: ✭ 136 (+871.43%)
Mutual labels:  ci-cd
Helloworld Msa
Main repository with documentation and support files
Stars: ✭ 218 (+1457.14%)
Mutual labels:  ci-cd
Nevergreen
🐤 A build monitor with attitude
Stars: ✭ 170 (+1114.29%)
Mutual labels:  ci-cd
Werf
The CLI tool gluing Git, Docker, Helm, and Kubernetes with any CI system to implement CI/CD and Giterminism
Stars: ✭ 2,814 (+20000%)
Mutual labels:  ci-cd
Paths Filter
Conditionally run actions based on files modified by PR, feature branch or pushed commits
Stars: ✭ 155 (+1007.14%)
Mutual labels:  ci-cd
Useful Jenkins Groovy Init Scripts
A repo of useful groovy init scripts for working with jenkins hooks..
Stars: ✭ 162 (+1057.14%)
Mutual labels:  ci-cd
Mcw Cloud Native Applications
MCW Cloud-native applications
Stars: ✭ 184 (+1214.29%)
Mutual labels:  ci-cd
Mcw Serverless Architecture
MCW Serverless architecture
Stars: ✭ 147 (+950%)
Mutual labels:  ci-cd
Makisu
Fast and flexible Docker image building tool, works in unprivileged containerized environments like Mesos and Kubernetes.
Stars: ✭ 2,409 (+17107.14%)
Mutual labels:  ci-cd
Astra
Automated Security Testing For REST API's
Stars: ✭ 1,898 (+13457.14%)
Mutual labels:  ci-cd
Buildhelpers
Helper functions for PowerShell CI/CD scenarios
Stars: ✭ 174 (+1142.86%)
Mutual labels:  ci-cd
DevSecOps
Ultimate DevSecOps library
Stars: ✭ 4,450 (+31685.71%)
Mutual labels:  ci-cd
Lasso
Lasso is a Laravel package created to make your deployments blazing fast.
Stars: ✭ 217 (+1450%)
Mutual labels:  ci-cd
Cml
♾️ CML - Continuous Machine Learning | CI/CD for ML
Stars: ✭ 2,843 (+20207.14%)
Mutual labels:  ci-cd

Aziona-CLI Documentation

Python

Aziona CLI is a cross CI platform tool that enables the building, testing, releasing, and deploying, DevOps/GitOps process steps. Pipelines have two major problems, namely the setup of the environment with all the dependencies, environmental variables and the management and maintenance of scripts to be executed during the CI/CD process. Aziona CLI tries to simplify the aforementioned aspects by allowing developers to create agnostic and platform-independent configurations. The advantage of Aziona configurations is that you can declare in one or more YML / Json files the tasks, environment variables, and dependencies needed to run the pipeline.

File

Architecture

Aziona CLI is written in Python3 and can be used in various ways in both local and pipelined environments, such as a:

  • Container image (Ubuntu 20.04)
  • Python package
  • GitHub action

YML structure

The YML structure is divided into targets that include multiple stages; on top of that, you can inject a custom environment and additional settings. Each stage is defined as a single action that imports modules executed with optional arguments.

File

Modules Modules are actions executed by a stage; they have different types like Python or bash modules. Each module has to have defined the type, module, and eventually additional arguments.

Develop environment

Requirements

  • python >= 3.7
  • pip3
  • docker and docker-compose

Setup

git clone https://github.com/azionaventures/aziona-cli.git
sudo make setup-dev
source ./venv/bin/active

Local environment

Requirements

  • python >= 3.7
  • pip3
  • docker and docker-compose

Setup

pip3 install aziona

# or

pip3 install aziona==VERSION

Usage

Ex. Release docker image into Aws ECR from Local env

Require: AWS account and Dockerfile

Create project folder, and create file .aziona.yml with the snippet below.

Create ECR repository in the AWS region where your profile is pointing.

Edit .aziona.yml and export to shell env vars:

  1. export AWS_ACCESS_KEY_ID=xxx
  2. export AWS_SECRET_ACCESS_KEY=xxx
  3. export AWS_ACCOUNT_ID=xxx
  4. export AWS_ECR_REGION=xxx
  5. export AWS_ECR_REPOSITORY=xxx

Create sample Dockerfile.

Finally, run:

aziona release

This aziona configuration file firstly makes login on Ecr service, nextly, build docker image, and endly push image to ecr repository

Snippet

version: "1"

targets:
  release:
    stages:
      login:
        module: aziona.packages.docker.login_aws_credentials
        args: 
          --region: ${AWS_ECR_REGION}
          --registry: ${AWS_ECR_REGISTRY}
      build: 
        module: aziona.packages.docker.build
        args: 
          --path: .
          --dockerfile: Dockerfile
          --tag: ${DOCKER_IMAGE}
      push: 
        module: aziona.packages.docker.push
        args: 
          --image: ${DOCKER_IMAGE}

env:
  AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
  AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
  AWS_ACCOUNT_ID: ${AWS_ACCOUNT_ID}
  AWS_ECR_REGION: ${AWS_ECR_REGION}
  AWS_ECR_REPOSITORY: ${AWS_ECR_REPOSITORY}
  AWS_ECR_REGISTRY: ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_ECR_REGION}.amazonaws.com
  DOCKER_IMAGE: ${AWS_ECR_REGISTRY}/${AWS_ECR_REPOSITORY}:latest

In the case in the local environment you want to use the aws profiles configured in .aws/credentials you have to use the following configuration:

  1. You need to add this args --profile: ${AWS_PROFILE} to login stage

  2. Change the env to and export vars:

env:
  AWS_PROFILE: ${AWS_PROFILE}
  AWS_ACCOUNT_ID: ${AWS_ACCOUNT_ID}
  AWS_ECR_REGION: ${AWS_ECR_REGION}
  AWS_ECR_REPOSITORY: ${AWS_ECR_REPOSITORY}
  AWS_ECR_REGISTRY: ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_ECR_REGION}.amazonaws.com
  DOCKER_IMAGE: ${AWS_ECR_REGISTRY}/${AWS_ECR_REPOSITORY}:latest

[WARNING] It is not recommended to put sensitive data directly into the env.

Ex. Release docker image into Aws ECR from GitHub Action

Let's start with the "Local env" example.

Now that we've texted the process in a local environment, we can create a pipeline in GitHub (or your reference system) that executes our actions.

First, we need to create a ".github" folder in the root of the project with another folder called "workflows" inside.

Create the following secrets in Github:

  1. AWS_ACCESS_KEY_ID
  2. AWS_SECRET_ACCESS_KEY
  3. AWS_ACCOUNT_ID
  4. AWS_ECR_REGION
  5. AWS_ECR_REPOSITORY

Then create a release.yml file in .github/workflows and paste the following code:

name: Release docker image to AWS ECR

on:
  push:
    branches:
      - "main"

env:
  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
  AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
  AWS_ECR_REGION: ${{ secrets.AWS_ECR_REGION }}
  AWS_ECR_REPOSITORY: ${{ secrets.AWS_ECR_REPOSITORY }}

jobs:
  release:
    name: Push image on ECR
    runs-on: ubuntu-20.04

    steps:
      - name: Checkout
      uses: actions/checkout@v2

      - name: Checkout Action - Aziona CLI
      uses: actions/checkout@v2
      with:
          repository: azionaventures/aziona-cli
          ref:  main
          path: .github/actions/aziona

      - name: Aziona cli
      uses: ./.github/actions/aziona
      with:
          target: release

This pipeline will be started whenever a push is made to the main. The GitHub action of aziona-cli is used to execute the "release" target, which will execute all the actions defined in the .aziona.yml file. This way we can test the pipeline locally and be independent of the versioning system.

Ex. Release docker image into Aws ECR from Bitbucket pipeline

Let's start with the "Local env" example.

Create il file bitbucket-pipelines.yml nella root del progetto e inserite il seguente codice:

image:
  name: 

options:
  docker: true

pipelines:
  branches:
    main:
      - step:
          name: Release docker image to AWS ECR
          deployment: env
          image:
            name: azionaventures/aziona-cli:0.1
          script:
            - aziona release

Create deployment named env. Enter the following keys in the deployment:

  1. AWS_ACCESS_KEY_ID
  2. AWS_SECRET_ACCESS_KEY
  3. AWS_ACCOUNT_ID
  4. AWS_ECR_REGION
  5. AWS_ECR_REPOSITORY

The pipeline will use the action-cli:0.1 image to execute the step.

Contributing

1. Open issue 
2. Use module `aziona.core` for I/O, logging, settings etc
3. Formatting and fix code with `make lint`
4. Merge request

License

GNU General Public License v3.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].