Skip to content

Instantly share code, notes, and snippets.

View marcosborges's full-sized avatar

Marcos Borges marcosborges

View GitHub Profile
{
"openapi": "3.0.0",
"info": {
"title": "Cloud Pro Engine",
"version": "1.0.0"
},
"servers": [
{
"url": "http://{{url}}data-azure"
},
openapi: 3.0.0
info:
title: Cloud Pro Engine
version: 1.0.0
servers:
- url: http://{{url}}data-azure
- url: http://{{url}}update-azure
- url: localhost://
- url: http://{{url}}pub-create-azure
- url: http://{{url}}sizes-azure
FROM ubuntu:20.04
LABEL version="0.0.12"
#
# INSTALL COMMOM TOOLS
#
RUN DEBIAN_FRONTEND=noninteractive apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
###########
# PREPARE #
###########
FROM alpine/xml as init
COPY . .
RUN cat pom.xml | xq --raw-output .project.artifactId > artifactId.init.output \
&& cat pom.xml | xq --raw-output .project.version > version.init.output \
&& ARTIFACT_ID=$(cat artifactId.init.output) \
&& VERSION=$(cat version.init.output) \
#!/bin/bash
# Definir variáveis de ambiente
ORGANIZATION="minhaorganizacao"
PROJECT="meuprojeto"
VAR_GROUP_NAME="nome_do_variable_group"
VAR_NAME="nome_da_variavel"
# Fazer a requisição para a API de Variable Groups do Azure DevOps e filtrar a resposta para encontrar o Variable Group e a variável com o nome especificado
response=$(curl -s -u ":$(pat)" \
#!/bin/bash
# Definir variáveis de ambiente
ORGANIZATION="minhaorganizacao"
PROJECT="meuprojeto"
VAR_GROUP_NAME="nome_do_variable_group"
VAR_NAME="nome_da_variavel"
# Obter o ID do Variable Group com o nome especificado
VAR_GROUP_ID=$(curl -s -u ":$(pat)" \
- bash: |
echo "##vso[task.setvariable variable=project]${{parameters.project}}"
echo "vso[task.setvariable variable=project]${{parameters.project}}"
echo "##vso[task.setvariable variable=env_dev_k8s_sc]${{parameters.env_dev_k8s_sc}}"
echo "vso[task.setvariable variable=env_dev_k8s_sc]${{parameters.env_dev_k8s_sc}}"
echo "##vso[task.setvariable variable=env_uat_k8s_sc]${{parameters.env_uat_k8s_sc}}"
echo "vso[task.setvariable variable=env_uat_k8s_sc]${{parameters.env_uat_k8s_sc}}"
steps:
- bash: |
currentBranch=$(git branch --show-current)
commitMsgLine=$(git log -1 --oneline $currentBranch)
lastCommitHash=$(git rev-parse --short HEAD)
#Remove the commit # from the message
commitMsg="${commitMsgLine##$lastCommitHash}"
#Remove the extra space before the message body
commitMsg="${commitMsg## }"
title=$commitMsg
FROM python:3.8
RUN pip install fire
@marcosborges
marcosborges / kubectl-jq.sh
Last active February 3, 2021 12:57
Kubectl e Jq
#!/bin/bash
# Lista de deployments que tem o nome inicado com:
kubectl get deployments -n [NAMESPACE] -o json | jq '.items[].metadata.name|startswith("[DEPLOYMENT_NAME]")'
# Lista de deployments que contem em seu nome o termo:
kubectl get deployments -n [NAMESPACE] -o json | jq '.items[].metadata.name|contains("[DEPLOYMENT_NAME]")'
# Lista de deployments que satisfaça o REGEX: