Skip to content

Instantly share code, notes, and snippets.

View parj's full-sized avatar
💭
I may be slow to respond.

Parjanya Mudunuri parj

💭
I may be slow to respond.
View GitHub Profile
@parj
parj / gradle_push_pull_ant.groovy
Last active October 8, 2015 08:38
Gradle AntTasks for using Ant tasks
/*
Copyright (c) 2011-2013 Parjanya Mudunuri
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
@parj
parj / gradle_firstzero
Created April 27, 2013 20:26
Basic gradle file to download anttasks and run the task within it
repositories {
mavenCentral()
maven {
url "http://oss.sonatype.org/content/groups/public/"
}
}
configurations {
fz
}
@parj
parj / Gradle mustache.java
Created May 30, 2013 20:03
Sample gist to get mustache.java running in gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'com.github.spullara.mustache.java', name: 'compiler', version: '0.8.12'
}
}
class Feature {
@parj
parj / gist:5939457
Created July 6, 2013 10:03
Gradle using SQL driver
import groovy.sql.Sql
repositories {
mavenCentral()
}
configurations {
driver
}
@parj
parj / Dockerfile
Created May 23, 2018 04:49
Kubernetes Jenkins Dockerfile
from jenkins/jenkins:lts
# Distributed Builds plugins
RUN /usr/local/bin/install-plugins.sh ssh-slaves
# Artifacts
@parj
parj / jenkins-deployment.yaml
Created May 23, 2018 04:56
Jenkins deployment for Kubernetes
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: jenkins
spec:
replicas: 1
template:
metadata:
labels:
app: jenkins
@parj
parj / service-account.yml
Created May 23, 2018 05:01
Jenkins service account in Kubernetes
apiVersion: v1
kind: ServiceAccount
metadata:
name: jenkins-robot
namespace: jenkins
@parj
parj / role-readwrite.yml
Created May 23, 2018 05:11
Kubernetes role to read and write to pods for a namespace called Jenkins
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: jenkins-readwrite
namespace: jenkins
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["pods"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
@parj
parj / role-bind-jenkins-robot.yml
Created May 23, 2018 05:15
Bind the jenkins-robot user to the jenkins-readwrite role for Kubernetes
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: read-pods
namespace: jenkins
subjects:
- kind: ServiceAccount
name: jenkins-robot
namespace: default
roleRef:
@parj
parj / install.sh
Created June 24, 2018 07:32
Automated deployment and build
#!/bin/bash
#Install Gogs
docker run --name=gogs -p 10022:22 -p 3000:3000 -v /tmp/gitlab:/data gogs/gogs
#Install Jenkins
docker run -d -p 8080:8080 -p 50000:50000 -v /tmp/jenkins:/var/jenkins_home jenkins
#Install Ansible tower
docker run -t -d -v /tmp/certs:/certs -p 443:443 --privileged -e SERVER_NAME=localhost ybalt/ansible-tower