Skip to content

Instantly share code, notes, and snippets.

View icheko's full-sized avatar

Jose Pacheco icheko

View GitHub Profile
@icheko
icheko / curl.sh
Created September 13, 2021 23:18
curl -X GET 'URL' -s -o response.json -w "%{http_code}"
// load shared library via @Library or other methods
pipeline {
agent {
kubernetes {
yaml mergePodTemplates('node-10,sonar-scanner,veracode')
}
}
stages {
stage('Build App'){
steps {
// load shared library via @Library or other methods
pipeline {
agent {
kubernetes {
yaml libraryResource('node-10.yaml')
}
}
stages {
stage('Build App'){
steps {
// load library via @Library or other method
pipeline {
agent {
kubernetes {
yaml libraryResource('node-10.yaml')
}
}
...
}
apiVersion: v1
kind: ConfigMap
metadata:
name: kube-monkey-config-map
namespace: kube-system
data:
config.toml: |
[debug]
enabled = true
schedule_immediate_kill = true
kind: Deployment
apiVersion: apps/v1
metadata:
name: webapp
namespace: my-super-cool-app
labels:
kube-monkey/enabled: enabled
kube-monkey/identifier: my-super-cool-app
kube-monkey/kill-mode: fixed
kube-monkey/kill-value: '1'
library identifier: 'icheko-jenkins-shared-lib@master',
retriever: modernSCM([
$class: 'GitSCMSource',
id: '13ebda5f-2be5-4751-83d4-4d4500603cc5',
remote: 'https://github.com/icheko/jenkins-shared-lib',
traits: [[$class: 'jenkins.plugins.git.traits.BranchDiscoveryTrait']]
]) _
pipeline {
agent any
dir >> jenkins-runner --heroku-auth
HEROKU_AUTH: -e HEROKU_AUTH_NETRC=/Users/jose.s.pacheco/.netrc:/root/.netrc
INCLUDING JENKINS FLAGS: --runHome /workspace/jenkins
Cleaning jenkins dir
-----------------------
...
Started
Running in Durability level: PERFORMANCE_OPTIMIZED
/*
This function is used to mount the Heroku .netrc
file into the heroku-cli container. The value of the
env variable should be of the form:
/Users/jose.s.pacheco/.netrc:/root/.netrc
On production env.USER is defined as cloudbees so it
returns the production .netrc file
*/
function jenkins-runner(){
while test $# -gt 0; do
case "$1" in
-h|--help)
echo " "
echo "jenkins-runner [options]"
echo " "
echo "options:"
echo "-h, --help show brief help"