You should install VirtualBox and Vagrant before you start.
You should create a Vagrantfile in an empty directory with the following content:
| def getProjectName() { | |
| return 'JenkinsPipeline' | |
| } | |
| def getJDKVersion() { | |
| return 'jdk1.8.0_101' | |
| } | |
| def getMavenConfig() { | |
| return 'maven-config' |
| #!/bin/bash | |
| #ONE LINE | |
| #sudo wget -Nnv 'https://gist.githubusercontent.com/kydouglas/1f68d69e856fd6d7dc223f8e1f5ae3b3/raw/f8c3b22b9d9c41093150b96c815776956b523d9d/elk.sh' && bash elk.sh && rm -f elk.sh | |
| # Checking whether user has enough permission to run this script | |
| sudo -n true | |
| if [ $? -ne 0 ] | |
| then | |
| echo "This script requires user to have passwordless sudo access" |
| pipeline { | |
| // run on jenkins nodes tha has java 8 label | |
| agent { label 'java8' } | |
| // global env variables | |
| environment { | |
| EMAIL_RECIPIENTS = 'mahmoud.romeh@test.com' | |
| } | |
| stages { | |
| stage('Build with unit testing') { |
| Some Jenkinsfile examples |
You should install VirtualBox and Vagrant before you start.
You should create a Vagrantfile in an empty directory with the following content:
| +---------------------------------------------------------------+ | |
| | * * * PUSH REJECTED BY EVIL DRAGON BUREAUCRATS * * * | | |
| +---------------------------------------------------------------+ | |
| \ | |
| \ ^ /^ | |
| \ / \ // \ | |
| \ |\___/| / \// .\ | |
| \ /V V \__ / // | \ \ *----* | |
| / / \/_/ // | \ \ \ | | |
| @___@` \/_ // | \ \ \/\ \ |
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| $master_cpus = 2 | |
| $master_memory = 2048 | |
| $num_workers = 3 | |
| $worker_cpus = 4 | |
| $worker_memory = 4096 | |
| $common_script = <<-SCRIPT |
Example on how to run locally an AWS Lambda via API Gateway using localstack.
Based on...
| def getProjectName() { | |
| return 'JenkinsPipeline' | |
| } | |
| def getJDKVersion() { | |
| return 'jdk1.8.0_101' | |
| } | |
| def getMavenConfig() { | |
| return 'maven-config' |
| <VirtualHost *:80> | |
| ServerName jenkins.example.com | |
| ServerAdmin webmaster@example.com | |
| RewriteEngine on | |
| RewriteCond %{SERVER_PORT} !^443$ | |
| RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L] | |
| </VirtualHost> | |
| <IfModule mod_ssl.c> | |
| <VirtualHost *:443> |