Skip to content

Instantly share code, notes, and snippets.

Avatar

Gabriel Rojas gabrielrojasnyc

View GitHub Profile
View gist:a014bc9e5d5a5d85223b578510237777
FROM microsoft/powershell
LABEL version=lastest
USER root
RUN apt-get update -y
RUN apt-get install wget curl -y
# Import the public repository GPG keys
RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl -o /etc/apt/sources.list.d/microsoft.list https://packages.microsoft.com/config/ubuntu/16.04/prod.list
View summitJenkisfile
node ('Windows2016') {
stage ('Test Pass') {
powershell 'Invoke-OperationValidation -testtype simple'
}
stage ('Test 2'){
powershell 'invoke-pester c:\test_gabe.Tests.ps1 -OutputFormat NunitXML -OutputFile report.xml -EnableExit'
}
}
View summit.Test.ps1
# To simulate failure pester check
Describe 'Service' {
it 'is summit installed' {
get-service -Name Summit | Should be $true
}
}
View DockerfilePowershell
# Microsoft Powershell Ubuntu image
FROM microsoft/powershell
LABEL version=0.1
WORKDIR /tmp
#Update and install Java
RUN apt-get update -y
RUN apt-get install default-jre -y
RUN apt-get upgrade powershell -y
View JenkinsServiceSummit
apiVersion: v1
kind: Service
metadata:
name: jenkins
spec:
type: NodePort
ports:
- port: 8080
targetPort: 8080
name: http-port
View JenkinsDeploymentSummit
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: jenkins-deployment
spec:
replicas: 1
template:
metadata:
labels:
app: jenkins
View DockerfileJenkins
# From the Jenkins supported version
FROM jenkins/jenkins:lts
LABEL version=0.1
#using root for installation
USER root
# Install PowerShellCore
RUN apt-get update -y
View iot.py
import os
import logging #for proper function logging
import boto3
import time
logger = logging.getLogger()
logger.setLevel(logging.INFO)
personal_email = os.environ['email_address']
topic_name = 'aws-iot-button-sns-topic-python'
client_sns = boto3.client('sns')
View lambda_local_to_s3.py
import time
import requests
import smart_open
import logging
print('Loading function')
def lambda_handler(event, context):
start_time = time.time()
uri = 'http://ipv4.download.thinkbroadband.com/100MB.zip'
response = requests.get(uri, stream=True)
View file_go.go
package main
import (
//"io/ioutil"
"fmt"
"log"
"io"
"os"
"net/http"
"time"