Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
Please comment & let me know if you have a fork / fixes you'd like to include.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def lambda_handler(event, context): | |
| import subprocess | |
| result = subprocess.call("curl -I http://foo.bar", shell=True) | |
| return result | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package test | |
| import io.gatling.core.Predef._ | |
| import io.gatling.core.structure.PopulatedScenarioBuilder | |
| import io.gatling.core.controller.inject.InjectionStep | |
| import io.gatling.http.Predef._ | |
| import io.gatling.jdbc.Predef._ | |
| import scala.concurrent.duration._ | |
| import scala.collection.mutable.ArraySeq | |
| import org.json.JSONArray; | |
| import org.json.JSONObject; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
| <meta name="description" content="[add your bin description]" /> | |
| <meta charset=utf-8 /> | |
| <title>Decimalizer c.2013 - Nadine Whitfield</title> | |
| </head> | |
| <body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class AccountFeeder() extends com.excilys.ebi.gatling.core.feeder.Feeder { | |
| import org.joda.time.DateTime | |
| import scala.util.Random | |
| private val RNG = new Random() | |
| // random number in between [a...b] | |
| def randInt(a:Int, b:Int) = RNG.nextInt(b-a) + a | |
| def daysOfMonth(year:Int, month:Int) = new DateTime(year, month, 1, 0, 0, 0, 000).dayOfMonth().getMaximumValue() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8 /> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Copyright 2011-2012 eBusiness Information, Groupe Excilys (www.excilys.com) | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.excilys.ebi.gatling.core.Predef._ | |
| import com.excilys.ebi.gatling.http.Predef._ | |
| import scala.util.Random | |
| import com.excilys.ebi.gatling.core.feeder.Feeder | |
| class ServiceSimulation extends Simulation { | |
| def apply = { | |
| val random = new Random | |
| random.setSeed(System.currentTimeMillis) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| task runLoadTest(type: JavaExec) { | |
| classpath = sourceSets.main.runtimeClasspath + sourceSets.test.runtimeClasspath + sourceSets.e2eTest.runtimeClasspath | |
| jvmArgs = [ '-Dgatling.core.directory.binaries=./build/classes/e2eTest' ] | |
| // Gatling application | |
| main = "io.gatling.app.Gatling" | |
| // Specify the simulation to run | |
| args = Eval.me("['-s', 'BasicSimulation']") | |
| } |
NewerOlder