Skip to content

Instantly share code, notes, and snippets.

View ndeloof's full-sized avatar
💭
Preparing a new set of bugs

Nicolas De loof ndeloof

💭
Preparing a new set of bugs
View GitHub Profile
@ndeloof
ndeloof / keybase.md
Created November 14, 2016 15:16
keybase.md

Keybase proof

I hereby claim:

  • I am ndeloof on github.
  • I am ndeloof (https://keybase.io/ndeloof) on keybase.
  • I have a public key whose fingerprint is 06A1 945C 671F 0530 F392 1434 9858 809D 6F8F 6E7E

To claim this, I am signing this object:

---
- build: # stage ('build') { ...
# define the docker image used to run the build
# an implicit volume for current project's git working copy is mounted
image: maven:3.3-jdk-8
# set environment variables, use $$ for credentials injection, as used by http://readme.drone.io/usage/secrets/
environment:
- foo: bar
@ndeloof
ndeloof / Jenkinsfile.groovy
Last active August 2, 2021 00:23
dockerNode without remoting
stage 'build' {
withDocker(image: 'node_js:4.4',
environment: [foo: 'bar'],
volumes: [node_cache: '/node_modules'],
commands: """
npm install
npm test
...
""",
mount -t tmpfs -o size=512M tmpfs /var/lib/docker
modprobe zram
echo $((1024*1024*1024)) > /sys/block/zram0/disksize
mkswap /dev/zram0
swapon -p 10 /dev/zram0
FROM jenkins
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt
@ndeloof
ndeloof / gist:49e1cd84a887b9bb7e02
Created March 3, 2015 13:23
Lombok-enable Jenkins describable
@Describable("publicname")
public class Foo {
@DataBound private String bar;
}
@ndeloof
ndeloof / gist:4ed2f5c8c02f19dc5b6e
Created February 26, 2015 08:21
to stream or not to stream
// What I used to do in Java 6/7
Collection<String> accountIds = new ArrayList<>();
for (GCAccount account : user.getGcAccounts()) {
for (Account sf : account.getSfAccounts()) {
accountIds.add(sf.getId());
}
}
// What I can do in Java 8
Collection<String> accountIds =
@ndeloof
ndeloof / gist:58e75b275fc72e0c7c23
Created January 23, 2015 09:54
Migrate Subversion crendentials
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.plugins.credentials.common.*;
import hudson.security.ACL
import hudson.scm.SubversionSCM
def jenkins = Jenkins.instance
jenkins.allItems.each { job ->
def scm = job.scm;
# OSX Mavericks, Docker 1.3.0
➜ ~ env |grep DOCKER
DOCKER_HOST=tcp://boot2docker:2376
DOCKER_TLS_VERIFY=1
FORWARD_DOCKER_PORTS=1
DOCKER_CERT_PATH=/Users/nicolas/.boot2docker/certs/boot2docker-vm
➜ ~ curl --version
curl 7.30.0 (x86_64-apple-darwin13.0) libcurl/7.30.0 SecureTransport zlib/1.2.5