Skip to content

Instantly share code, notes, and snippets.

View ardeshir's full-sized avatar
🎯
Focusing

sepahsalar ardeshir

🎯
Focusing
View GitHub Profile
@ardeshir
ardeshir / deployment-tool-ansible-puppet-chef-salt.md
Created August 11, 2016 15:31 — forked from jaceklaskowski/deployment-tool-ansible-puppet-chef-salt.md
Choosing a deployment tool - ansible vs puppet vs chef vs salt

Requirements

  • no upfront installation/agents on remote/slave machines - ssh should be enough
  • application components should use third-party software, e.g. HDFS, Spark's cluster, deployed separately
  • configuration templating
  • environment requires/asserts, i.e. we need a JVM in a given version before doing deployment
  • deployment process run from Jenkins

Solution

@ardeshir
ardeshir / pre-commit
Created December 3, 2016 04:19 — forked from jamtur01/pre-commit
A Terraform validation and formatting pre-commit hook
#!/usr/bin/env bash
set -e
# Formats any *.tf files according to the hashicorp convention
files=$(git diff --cached --name-only)
for f in $files
do
if [ -e "$f" ] && [[ $f == *.tf ]]; then
#terraform validate `dirname $f`
terraform fmt $f
@ardeshir
ardeshir / README.md
Created March 30, 2017 19:48 — forked from sapessi/README.md
Continuous deployment of React websites to Amazon S3

Continuous deployment of React websites to Amazon S3

This sample includes a continuous deployment pipiline for websites built with React. We use AWS CodePipeline, CodeBuild, and SAM to deploy the application. To deploy the application to S3 using SAM we use a custom CloudFormation resource.

Files included

  • buildspec.yml: YAML configuration for CodeBuild, this file should be in the root of your code repository
  • configure.js: Script executed in the build step to generate a config.json file for the application, this is used to include values exported by other CloudFormation stacks (separate services of the same application).
  • index.js: Custom CloudFormation resource that publishes the website to an S3 bucket. As you can see from the buildspec and SAM template, this function is located in a s3-deployment-custom-resource sub-folder of the repo
  • app-sam.yaml: Serverless Application model YAML file. This configures the S3 bucket and the cu
@ardeshir
ardeshir / Deploy-Windows-Service-Via-MSBuild.proj.xml
Created May 23, 2017 15:26 — forked from mrchief/Deploy-Windows-Service-Via-MSBuild.proj.xml
MSBuild Script to deploy Windows Service to remote or local machine
<Project DefaultTargets="CopyOutputs;DeployService" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<!-- These settings control what the service's name, description etc appear in services.msc task panel. -->
<PropertyGroup Label="ServiceMetaData">
<ServiceName>ShinyNewService</ServiceName>
<ServiceDisplayName>Shiny New Service</ServiceDisplayName>
<ServiceDescription>A shiny new service, that changes the world for the greater good.</ServiceDescription>
</PropertyGroup>
<Choose>
@ardeshir
ardeshir / java-8-ami.md
Created July 7, 2017 18:15 — forked from rtfpessoa/java-8-ami.md
[Guide] Install Oracle Java (JDK) 8 on Amazon EC2 Ami
---
# tasks file for app_service_setup
#
- block:
- name: Deploy application service script
template:
src: service.j2
dest: /etc/init.d/app-{{ app_name }}
owner: root
group: root
---
# tasks file for app_service_setup
#
- block:
- name: Deploy application service script
template:
src: service.j2
dest: /etc/init.d/app-{{ app_name }}
owner: root
group: root
@ardeshir
ardeshir / story.md
Created September 14, 2017 19:38 — forked from posener/go-shebang-story.md
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@ardeshir
ardeshir / fix-kube-dashboard.md
Created September 25, 2017 18:52 — forked from initcron/fix-kube-dashboard.md
Fix kubernetes Dashboard
kubectl apply -f https://gist.githubusercontent.com/initcron/db8f1bbb5a884a91032cf53cd496a395/raw/aad04d509a751b2ea0cfbf3dbaa6330a1b37699d/dash-svc.yml
kubectl describe svc kdash  -n kube-system

Project 1 : Build a Docker Image for Sysfoo

Link to Application Source: https://github.com/schoolofdevops/sysfoo

Description:

Sysfoo is a java based web application, which uses maven as a build tool. The build specifications are provided with pom.xml in the root directory of the project. Your job is to write a dockerfile to build and package the sysfoo application.