Skip to content

Instantly share code, notes, and snippets.

View ismail0352's full-sized avatar

Ismail ismail0352

  • Velotio
View GitHub Profile
@ismail0352
ismail0352 / SetUpWinRM.ps1
Created August 8, 2019 07:18
Setting Up Winrm to configure the windows instance
<powershell>
write-output "Running User Data Script"
write-host "(host) Running User Data Script"
Set-ExecutionPolicy Unrestricted -Scope LocalMachine -Force -ErrorAction Ignore
# Don't set this before Set-ExecutionPolicy as it throws an error
$ErrorActionPreference = "stop"
@ismail0352
ismail0352 / install_windows.ps1
Created August 8, 2019 07:22
user-data to create Windows AMI
# Setting Up machine for Jenkins
#Jenkins root directory
$jenkins_slave_path = "C:\Jenkins"
If(!(test-path $jenkins_slave_path))
{
New-Item -ItemType Directory -Force -Path $jenkins_slave_path
}
# Install Chocolatey for managing installations
@ismail0352
ismail0352 / sg_jenkins_worker_windows.tf
Created August 8, 2019 07:26
Security Group for windows machine
resource "aws_security_group" "dev_jenkins_worker_windows" {
name = "dev_jenkins_worker_windows"
description = "Jenkins Server: created by Terraform for [dev]"
# legacy name of VPC ID
vpc_id = "${data.aws_vpc.default_vpc.id}"
tags {
Name = "dev_jenkins_worker_windows"
env = "dev"
@ismail0352
ismail0352 / jenkins_worker_windows.tf
Created August 8, 2019 07:27
Terraform script for windows machine
# Setting Up Windows Slave
data "aws_ami" "jenkins_worker_windows" {
most_recent = true
owners = ["self"]
filter {
name = "name"
values = ["windows-slave-for-jenkins*"]
}
}
@ismail0352
ismail0352 / jenkins_worker_windows.ps1
Created August 8, 2019 07:31
user-data for Jenkins slave - Windows
<powershell>
function Wait-For-Jenkins {
Write-Host "Waiting jenkins to launch on 8080..."
Do {
Write-Host "Waiting for Jenkins"
Nc -zv ${server_ip} 8080
@ismail0352
ismail0352 / data_vpc.tf
Created August 8, 2019 08:53
default VPC for reference
# lookup for the "default" VPC
data "aws_vpc" "default_vpc" {
default = true
}
# subnet list in the "default" VPC
# The "default" VPC has all "public subnets"
data "aws_subnet_ids" "default_public" {
vpc_id = "${data.aws_vpc.default_vpc.id}"
}
@ismail0352
ismail0352 / provider.tf
Last active August 8, 2019 08:55
provider file for reference
provider "aws" {
region = "us-east-1"
shared_credentials_file = "~/.aws/credentials"
profile = "dev"
}
@ismail0352
ismail0352 / Jenkinsfile
Last active August 26, 2019 11:36
Jenkinsfile for Angular building and testing Angular application in a docker container
node (label: 'build && linux') {
stage('Clean Workspace'){
cleanWs()
}
stage("Main build") {
docker.image('node:10').pull()
docker.image('ismail0352/chrome-node').pull()
stage('Checkout SCM') {
@ismail0352
ismail0352 / Jenkinsfile
Last active February 14, 2023 17:28
Jenkinsfile for Dotnet application
pipeline {
agent { label "build && windows" }
stages {
stage('Clean Workspace'){
steps {
cleanWs()
}
}
stage('Checkout'){
@ismail0352
ismail0352 / test_server_windows.ps1
Created August 27, 2019 12:09
powershell script to configure IIS on "Fresh Server"
# To list all Windows Features: dism /online /Get-Features
# Get-WindowsOptionalFeature -Online
# LIST All IIS FEATURES:
# Get-WindowsOptionalFeature -Online | where FeatureName -like 'IIS-*'
# NetFx dependencies
dism /online /Enable-Feature /FeatureName:NetFx4 /All
# ASP dependencies
dism /online /enable-feature /all /featurename:IIS-ASPNET45