This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/otomato-gh/jenkins-playground.git | |
cd jenkins-playground | |
./setup.sh | |
cd non-docker | |
./setup_jenkins.sh | |
####### | |
Go to <your machine public IP>:8080 | |
Follow the instructions to find and set the password and install the plugins | |
##### | |
Fork https://github.com/otomato-gh/bunsysinfo to your own github account. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl get node -oyaml | yq '.items[].status.addresses[] | select(.type=="ExternalIP") | .address') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from airflow import DAG | |
from datetime import datetime, timedelta | |
from airflow.providers.postgres.hooks.postgres import PostgresHook | |
from airflow.operators.python import PythonOperator | |
# Change these to your identifiers, if needed. | |
POSTGRES_CONN_ID = "postgres_default" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from airflow.operators.python_operator import ShortCircuitOperator | |
from airflow.operators.dummy_operator import DummyOperator | |
from airflow.models import DAG | |
import airflow.utils.helpers | |
from airflow.operators.bash_operator import BashOperator | |
import random | |
args = { | |
'owner': 'antweiss', | |
'start_date': airflow.utils.dates.days_ago(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from textwrap import dedent | |
# ... | |
templated_command = dedent( | |
""" | |
{% for i in range(5) %} | |
echo "{{ ds }}" #a variable (datestamp) | |
echo "{{ macros.ds_add(ds, 7)}}" #a built-in macro | |
{% endfor %} | |
""" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from airflow import DAG | |
from airflow.operators.python import PythonOperator | |
from airflow.utils.dates import days_ago | |
import time | |
with DAG( | |
'second', | |
start_date=days_ago(0), | |
description='Our new little DAG', | |
tags=['second'] | |
) as dag: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ZipOperator(BaseOperator): | |
""" | |
An operator which takes in a path to a file and zips the contents to a location you define. | |
:param path_to_file_to_zip: Full path to the file you want to Zip | |
:type path_to_file_to_zip: string | |
:param path_to_save_zip: Full path to where you want to save the Zip file | |
:type path_to_save_zip: string | |
""" | |
template_fields = ('path_to_file_to_zip', 'path_to_save_zip') | |
template_ext = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#assign to an env variable: | |
export ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl get pod my-pod -ojson | jq ".spec.containers[] | .image" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#the verbosity 0 prints out plain json and then we can parse out addon names | |
eksctl utils describe-addon-versions --cluster my-cluster --region=my-region --verbose 0 | jq -r '.Addons[] | .AddonName' |
NewerOlder