Sign inSign up

paradigmadigital/pd-cli

By paradigmadigital

•Updated over 3 years ago

CLI for paradigmadigital

Image
1

2.5K

paradigmadigital/pd-cli repository overview

⁠Pacifier Core CLI

Prerequisites:

⁠Quick Start

docker run --rm paradigmadigital/pd-cli cli install | bash
⁠Update to last version
docker run --rm paradigmadigital/pd-cli cli update | bash

Reload shell

source ~/.bashrc (or source ~/.zshrc)

Use:

 āœ— pd                          

Commands availables:

 - pd cli
 - pd create
 - pd deploy
 - pd go
 - pd help
 - pd run
 - pd sync
 - pd version

version: x.y.z

⁠Commands

⁠pd cli

cli commands for installation and update the cli.

āœ— pd cli

Commands availables:

 - pd cli install
 - pd cli update

⁠pd sync (use flux instead, only for cluster part)
options: 
    -debug=true (default: false) 
    -namespace={value} (take first NAMESPACE in gluon.sh ) 

example: pd sync -debug=true -namespace=santi

Synchronize helm repository with kubernetes cluster.

Needs gluon.sh file with these parameters:

RELEASE_NAME="pacifier-cicd"

RELEASE_NAME: name of the chart in the repository

⁠pd deploy
example: pd deploy

Create flux source and flux helmrelease.

Needs gluon.sh file with these parameters:

FLUX_REPOS=(
"https://git.paradigmadigital.com/pacifier/deployments/intranet-employee-back-deploy?main?3m?git-auth?dev-pacifier"
)

FLUX_REPOS: "https://${git-repository}?${branch}?${refresh_interval}?${git_secret_name}?${namespace}"

⁠actions
  • Create namespace
  • Execute helm with all values configurations
  • Apply all tekton from config/tekton/pipelines $ config/tekton/pipelines to Kubernetes cluster
  • Execute flux command in order to crear all deployments configured in gluon.sh::FLUX_REPOS variable
⁠pd run

shows all cli contains within this cli

Commands availables:

 - pd run flux
 - pd run gcloud
 - pd run git
 - pd run helm
 - pd run jar
 - pd run kubectl
 - pd run mvn
 - pd run terraform

alias for other cli commands installed

alias pdk='pd run kubectl'
alias pdh='pd run helm'
alias pdg='pd run gcloud'
alias pdf='pd run flux'
alias pdt='pd run terraform'
⁠pd run kubectl

kubectl command proxy: Execute all commands as kubectl cli

Use alias:

alias pdk='pd run kubectl'

https://kubernetes.io/docs/reference/kubectl/kubectl/⁠

⁠pd run helm

helm command proxy: Execute all commands as helm cli

Use alias:

alias pdh='pd run helm'

https://helm.sh/docs/helm/⁠

⁠pd run flux

flux command proxy: Execute all commands as flux cli

Use alias:

alias pdf='pd run flux'

https://fluxcd.io/docs/cmd/⁠

⁠pd run gcloud

gcloud command proxy: Execute all commands as gcloud cli

Use alias:

alias pdg='pd run gcloud'

https://cloud.google.com/sdk/gcloud#command_groups⁠

⁠pd go
  1. Create a batch file in your environment root folder (for example: batch.init) (could be batch.any)
  2. Execute pd go init. Note is the same as the file ending. (could be pd go any)

Example: batch.init

create
sync

The command pd go init will execute all pd commands in batch.

using module parameter:

pd go init -module=one-module

The command pd go init will execute all pd commands in ./modules/one-module/batch.init

⁠pd create -type=${TYPE} -name=${NAME} -refresh=false

Create a scaffolded element of types in scaffold repositories variable SCAFFOLDS_REPO could be override in gluon.sh, default value is https://git.paradigmadigital.com/pacifier/catalog/scaffolds/helm-chart-deployments.git⁠

  • type: Type of the scaffold we want to create : variable ${TYPE} inside scaffold
  • name: variable ${NAME} inside scaffold
  • refresh (default: false): refresh repository defined in SCAFFOLD_REPO variable
~ pd create 
Enter type: pacifier-cicd
Enter name: intranet
~ ls -las
total 24
4 drwxrwxr-x 3 sgarciabonacho sgarciabonacho 4096 ene 21 16:52 .
4 drwxrwxr-x 5 sgarciabonacho sgarciabonacho 4096 ene 21 16:52 ..
4 drwxr-xr-x 2 sgarciabonacho docker         4096 ene 21 16:52 chart
4 -rw-r--r-- 1 sgarciabonacho docker           18 ene 21 16:52 .gitignore
4 -rw-r--r-- 1 sgarciabonacho docker           42 ene 21 16:52 gluon.sh
4 -rw-r--r-- 1 sgarciabonacho docker           28 ene 21 16:52 README.md
⁠pd help

shows all commands list

⁠pd version

Show all installed tools versions:

pd version
versions:

  pd-cli: (paradigma digital CLI) - 0.5.3
  kubectl: not installed!
  mvn: image - maven 3.8.4-jdk-11-slim 9c0a4893bfa4 4 weeks ago 446MB
------------------------
[COMMAND]:mvn --version
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /usr/share/maven
Java version: 11.0.13, vendor: Oracle Corporation, runtime: /usr/local/openjdk-11
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-96-generic", arch: "amd64", family: "unix"
------------------------
  jar: image - openjdk 18-jdk-alpine c89120dcca4c 8 weeks ago 329MB
------------------------
[COMMAND]:jar --version
jar 18-ea
------------------------
  git: image - bitnami/git latest 80cb99d57266 45 hours ago 116MB
------------------------
[COMMAND]:git version
git version 2.34.1
------------------------
  flux: image - fluxcd/flux-cli v0.23.0 ccf8922658fc 2 months ago 97.8MB
------------------------
[COMMAND]:flux --version
flux version 0.23.0
------------------------
  helm: image - alpine/helm latest c410ba5c447a 6 weeks ago 67.3MB
------------------------
[COMMAND]:helm version
version.BuildInfo{Version:"v3.7.2", GitCommit:"663a896f4a815053445eec4153677ddc24a0a361", GitTreeState:"clean", GoVersion:"go1.16.10"}
------------------------
  gcloud: image - google/cloud-sdk latest ca2633cf6a18 5 days ago 2.6GB
------------------------
[COMMAND]:gcloud version
Google Cloud SDK 369.0.0
alpha 2022.01.14
app-engine-go 1.9.72
app-engine-java 1.9.93
app-engine-python 1.9.98
app-engine-python-extras 1.9.96
beta 2022.01.14
bigtable 
bq 2.0.72
cbt 0.10.2
cloud-datastore-emulator 2.1.0
cloud-firestore-emulator 1.13.1
cloud-spanner-emulator 1.4.0
core 2022.01.14
datalab 20190610
gsutil 5.6
kpt 1.0.0-beta.9
local-extract 1.3.2
pubsub-emulator 0.6.0
------------------------

Tag summary

Content type

Image

Digest

sha256:6cfe1efc0…

Size

151.7 MB

Last updated

over 3 years ago

docker pull paradigmadigital/pd-cli