-
Open a browser
# start an instance of firefox with selenium-webdriver $browser_type = 'firefox' $host = 'http://localhost:4444/wd/hub'
$capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => $browser_type);
| <?php | |
| /* | |
| * Creates a VERSION file if not exists in current directory. | |
| * Version should be in the format. {Major.Minor.Patch} | |
| * Patch has a suffix -dev for non release version | |
| * Usage: | |
| * php bumpversion.php [options] | |
| * options: | |
| * --version [part] (required) |
| MAX_BUILDS = 10 // max builds to keep | |
| def jobs = Jenkins.instance.items; | |
| for (job in jobs) { | |
| println "Job: " + job.name | |
| try { | |
| if(job instanceof jenkins.branch.MultiBranchProject) { | |
| println "Multibranch" | |
| job = job.getJob("master") |
| def docker_images = ["python:2.7.14", "python:3.5.4", "python:3.6.2"] | |
| def get_stages(docker_image) { | |
| stages = { | |
| docker.image(docker_image).inside { | |
| stage("${docker_image}") { | |
| echo 'Running in ${docker_image}' | |
| } | |
| stage("Stage A") { | |
| switch (docker_image) { |
| import org.apache.commons.io.FileUtils | |
| import org.sonatype.nexus.repository.storage.Asset | |
| import org.sonatype.nexus.repository.storage.Component; | |
| import org.sonatype.nexus.repository.storage.Query | |
| import org.sonatype.nexus.repository.storage.Query.Builder; | |
| import org.sonatype.nexus.repository.storage.StorageFacet | |
| def repo = repository.repositoryManager.get('releases') | |
| StorageFacet storageFacet = repo.facet(StorageFacet) |
| <?php | |
| class Category { | |
| public static $HAM = 'ham'; | |
| public static $SPAM = 'spam'; | |
| } | |
| ?> |
| import org.sonatype.nexus.repository.storage.StorageFacet; | |
| import org.sonatype.nexus.repository.storage.Query; | |
| import org.joda.time.DateTime; | |
| import org.joda.time.format.DateTimeFormat; | |
| def fmt = DateTimeFormat.forPattern('yyyy-MM-dd HH:mm:ss'); | |
| [ | |
| 'releases' | |
| ].each { reponame -> | |
| // Get a repository |
| #!/bin/sh | |
| cd ../ | |
| B2_BUCKET_NAME="example-com" | |
| INSTALL_NAME="example.com" | |
| SQL_FILE=database_backup.sql | |
| UPLOADS_FILE=uploads_backups.tar.gz | |
| UPLOADS_DIR=/srv/www/$INSTALL_NAME/shared/ |
| # Stop all containers | |
| docker stop `docker ps -qa` | |
| # Remove all containers | |
| docker rm `docker ps -qa` | |
| # Remove all images | |
| docker rmi -f `docker images -qa ` | |
| # Remove all volumes |
| # Taxonomy terms: | |
| - https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_taxonomy_term-php | |
| # Menu links: | |
| - https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_menu_link-php | |
| # File items: | |
| - https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_file-php | |
| # Nodes: |