Skip to content

Instantly share code, notes, and snippets.

View gabrielrojasnyc's full-sized avatar

Gabriel Rojas gabrielrojasnyc

View GitHub Profile
@gabrielrojasnyc
gabrielrojasnyc / file_go_no.go
Created October 22, 2017 22:28
file_go_no.go
package main
import (
"fmt"
"log"
"io"
"os"
"net/http"
"time"
)
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')
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
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'
}
}
# To simulate failure pester check
Describe 'Service' {
it 'is summit installed' {
get-service -Name Summit | Should be $true
}
}
# 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
apiVersion: v1
kind: Service
metadata:
name: jenkins
spec:
type: NodePort
ports:
- port: 8080
targetPort: 8080
name: http-port
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: jenkins-deployment
spec:
replicas: 1
template:
metadata:
labels:
app: jenkins
# 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
@gabrielrojasnyc
gabrielrojasnyc / lambda_local_to_s3.py
Last active October 24, 2017 03:48
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)