Skip to content

Instantly share code, notes, and snippets.

View wjimenez5271's full-sized avatar

William Jimenez wjimenez5271

  • San Jose, CA
  • 19:17 (UTC -07:00)
View GitHub Profile
https://docs.google.com/forms/d/e/1FAIpQLSd9PtWDnpF1rrr-pLPPFa01kotD1NecSRYiyY2ozVXx87ixdg/viewform
@wjimenez5271
wjimenez5271 / ci-pipeline.md
Created July 9, 2019 19:06
Creating a Rancher CI Pipeline

Creating a Rancher CI Pipeline

In this lab we will create an automated CI pipeline using Rancher's automated CI tooling. We will need a Github account (personal or enterprise) for this lab,but you can alternatively use Bitbucket or Gitlab.

  1. Setup Authorization with Github In the Rancher UI, navigate to the project of your choice, and then select the "Pipelines" tab (under the main menu bar). Then proceed to select "setup github authorization" . You will be take to a Github page that will require you to sign in and authorize your Rancher install to make API calls.

  2. For purposes of this lab, we're going to use an existing repo that has code in it already. Pipelines require the repo to exist in the github account you have connected, so we are going to fork the repo to our personal/corporate account. Go to rancher/rancher/pipeline-example-go and then click fork

  3. Next back in the Rancher UI under Pipelines, select create "Configure Repositories", and then enable the pipeline-example-go repo we previous

@wjimenez5271
wjimenez5271 / gist:d86144b6f1c21bddc609616b94805dcf
Created July 9, 2019 18:48
# Creating a Rancher CI Pipeline
# Creating a Rancher CI Pipeline
In this lab we will create an automated CI pipeline using Rancher's automated CI tooling. We will need a Github account (personal or enterprise) for this lab,but you can alternatively use Bitbucket or Gitlab.
1. Setup Authorization with Github
In the Rancher UI, navigate to the project of your choice, and then select the "Pipelines" tab (under the main menu bar). Then proceed to select "setup github authorization" . You will be take to a Github page that will require you to sign in and authorize your Rancher install to make API calls.
2. For purposes of this lab, we're going to use an existing repo that has code in it already. Pipelines require the repo to exist in the github account you have connected, so we are going to fork the repo to our personal/corporate account. Go to rancher/rancher/pipeline-example-go and then click fork
2. Next back in the Rancher UI under Pipelines, select create "Configure Repositories", and then enable the pipeline-example-go repo we previous
# see https://v1-8.docs.kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
apiVersion: batch/v1
kind: Job
metadata:
name: sync-pod
spec:
backoffLimit: 0
template:
spec:
volumes:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 8G 0 disk
└─xvda1 202:1 0 8G 0 part /
xvdcz 202:26368 0 80G 0 disk
└─xvdcz1 202:26369 0 80G 0 part
├─docker-docker--pool_tmeta 253:0 0 84M 0 lvm
│ └─docker-docker--pool 253:2 0 79.1G 0 lvm
│ └─docker-202:1-263176-65bb14625307ec7ff98f96a723d565244add1b755486ee7195390cc3b10f7906 253:3 0 10G 0 dm
└─docker-docker--pool_tdata
---> Making bundle: dynbinary (in bundles/1.11.2/dynbinary)
Building: bundles/1.11.2/dynbinary/docker-1.11.2
# github.com/ugorji/go/codec
2016/07/01 18:00:55 writing output: write $WORK/github.com/ugorji/go/codec.a: no space left on device
make: *** [cross] Error 1
@wjimenez5271
wjimenez5271 / read_aws_credentials.py
Created January 13, 2016 22:54
Simple python 2.7 implementation of a config reader for ~/.aws/credentials file
def get_profile_credentials(profile_name):
from ConfigParser import ConfigParser
from ConfigParser import ParsingError
from ConfigParser import NoOptionError
from ConfigParser import NoSectionError
from os import path
config = ConfigParser()
config.read([path.join(path.expanduser("~"),'.aws/credentials')])
try:
aws_access_key_id = config.get(profile_name, 'aws_access_key_id')
21 resp, err := client.CreateImage(create_image_opts)
22 es, ok := err.(ec2.Error)
23 if ok {
24 log.Print(fmt.Sprintf(es.Code))
25 } else {
26 log.Print(fmt.Sprintf("No value for response Code"))
27 }
5 provisioner:
6 name: chef_solo
7 client_rb:
8 node_name: foo-bar01
actions :create
default_action :create
attribute :user, :name_attribute => true, :kind_of => String,
:required => true
attr_accessor :exists