Skip to content

Instantly share code, notes, and snippets.

View VireshDoshi's full-sized avatar
💭
working

Viresh Doshi VireshDoshi

💭
working
  • London
View GitHub Profile
@VireshDoshi
VireshDoshi / packer.json
Created February 26, 2018 09:23
packer file for creating an AMI image with ansible provisioning
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"provisioners": [
{
"type": "shell",
"execute_command": "echo 'ubuntu' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
@VireshDoshi
VireshDoshi / ansible-playbook.yml
Created February 26, 2018 09:31
ansible playbook used by packer AMI provisioner creation
---
- hosts: all
tasks:
- name: Install the gpg key for nodejs LTS
become: true
apt_key:
url: "http://deb.nodesource.com/gpgkey/nodesource.gpg.key"
state: present
@VireshDoshi
VireshDoshi / main.tf
Created February 26, 2018 09:32
Terraform script to build out the AWS environment for a node app
variable "access_key" {}
variable "secret_key" {}
provider "aws" {
access_key = "${var.access_key}"
secret_key = "${var.secret_key}"
region = "us-east-1"
}
data "aws_ami" "node_app_ami" {
@VireshDoshi
VireshDoshi / Jenkinsfile.groovy
Last active February 26, 2018 09:37
Jenkins Pipeline script to build the AMI image and push to AWS
pipeline {
agent {
docker {
image 'vireshdoshi/jen-build-node-app-aws:latest'
}
}
stages {
stage('Checkout and Build') {
steps {
sh 'git clone https://github.com/VireshDoshi/node-app .'
@VireshDoshi
VireshDoshi / Jenkinsfile.groovy
Last active August 26, 2024 14:41
Deploy to AWS Jenkinsfile
pipeline {
agent {
docker {
image 'vireshdoshi/jen-build-node-app-aws:latest'
}
}
stages {
stage('pre-setup') {
steps {
sh 'echo "setup actions go here"'
@VireshDoshi
VireshDoshi / docker-compose.yml
Last active March 9, 2018 09:30
concourse ci docker compose file
version: '3'
services:
concourse-db:
image: postgres:9.6
environment:
POSTGRES_DB: concourse
POSTGRES_USER: concourse
POSTGRES_PASSWORD: changeme
PGDATA: /database
(bdd_env1) [vdo023@localhost concourse]$ docker-compose up -d
Creating network "concourse_default" with the default driver
Pulling concourse-db (postgres:9.6)...
9.6: Pulling from library/postgres
4176fe04cefe: Pull complete
b3acc6da98ed: Pull complete
ef28401016a4: Pull complete
f53d3f24be68: Pull complete
faa03ed01c16: Pull complete
2bd2f4dc2cd2: Pull complete
@VireshDoshi
VireshDoshi / bash
Created March 7, 2018 14:35
fly install commands
$ wget https://github.com/concourse/concourse/releases/download/v3.9.1/fly_linux_amd64
$ sudo install ./fly_linux_amd64 /usr/local/bin/fly
$ fly --version
@VireshDoshi
VireshDoshi / hello.yml
Created March 8, 2018 09:49
concourse hello world pipeline
jobs:
- name: hello-world
plan:
- task: say-hello
config:
platform: linux
image_resource:
type: docker-image
source: {repository: ubuntu}
run:
@VireshDoshi
VireshDoshi / bash.sh
Last active March 8, 2018 14:05
commands to run a concourse pipeline
$ fly -t lite login -c http://localhost:8082
$ fly -t lite set-pipeline -p hello -c hello.yml
$ fly -t lite unpause-pipeline -p hello
$ fly -t lite pipelines
$ fly -t lite tj -j hello/hello-world