Skip to content

Instantly share code, notes, and snippets.

View martinda's full-sized avatar
:octocat:
Coding, coding, coding.

Martin d'Anjou martinda

:octocat:
Coding, coding, coding.
  • Ottawa, Canada
View GitHub Profile
@martinda
martinda / build.gradle
Last active March 3, 2024 02:38
List artifacts of dependencies using Gradle
// build.gradle
void printArtifacts(Set<ResolvedArtifact> resolvedArtifacts, int level) {
println(" "*level + "Artifacts:")
for (def resolvedArtifact in resolvedArtifacts) {
println(" " * level + resolvedArtifact)
}
}
void printDependencies(ResolvedDependency parent, Set<ResolvedDependency> resolvedDependencies, int level) {
if (resolvedDependencies.size() == 0) return
@martinda
martinda / customJenkinsDistro.log
Created July 12, 2020 12:17
Custom Jenkins distro log
$ git pull upstream master
$ git checkout master
$ mvn clean test package
$ docker-compose up -d --build
$ docker-compose up
Starting cds_front-end ...
Starting cds_front-end ... done
Attaching to custom-distribution-service_app-server_1, cds_front-end
app-server_1 |
app-server_1 | . ____ _ __ _ _
@martinda
martinda / jenkins.log
Created November 18, 2019 15:56
Jenkins plugin installation manager Git 4.0.0 fails with matrix 1.4 says it needs 1.14+
File containing list of plugins to be downloaded: plugins.yml
Reading in plugins from plugins.yml
Plugin download location: /data/jenkins/core/plugins
No CLI option or environment variable set for update center, using default of https://updates.jenkins.io
No CLI option or environment variable set for experimental update center, using default of https://updates.jenkins.io/experimental
No CLI option or environment variable set for incrementals mirror, using default of https://repo.jenkins-ci.org/incrementals
Will use war file: jenkins.war
Downloading plugin pipeline-milestone-step from url: https://updates.jenkins.io/download/plugins/pipeline-milestone-step/1.3.1/pipeline-milestone-step.hpi
@martinda
martinda / maven.txt
Created October 16, 2019 14:31
Upgrade external-workspace-manager pom.xml
Require upper bound dependencies error for org.jenkins-ci.plugins:structs:1.18 paths to dependency are:
+-org.jenkins-ci.plugins:external-workspace-manager:1.2.1-SNAPSHOT
+-org.jenkins-ci.plugins.workflow:workflow-step-api:2.20
+-org.jenkins-ci.plugins:structs:1.18
and
+-org.jenkins-ci.plugins:external-workspace-manager:1.2.1-SNAPSHOT
+-org.jenkins-ci.plugins.workflow:workflow-cps:2.73
+-org.jenkins-ci.plugins:structs:1.20
and
+-org.jenkins-ci.plugins:external-workspace-manage
@martinda
martinda / Jenkinsfile
Created October 11, 2019 18:47
Jenkinsfile 2.150.x backward compatibility issue
// With Jenkins 2.138.4
def extWorkspace
stage('Allocate Workspace') {
extWorkspace = exwsAllocate 'diskpool1' // Selected Disk ID 'd1' from the Disk Pool ID 'diskpool1'
// The path on Disk is: test-exws/8
}
node() { // Running on Jenkins in /localdisk/martin/jenkins/jenkins/workspace/test-exws
exws(extWorkspace) { // Running in /localdisk/martin/diskpool1/test-exws/8
Sun Mar 3 15:44:28 2019 WARNING: Using --management on a TCP port WITHOUT passwords is STRONGLY discouraged and considered insecure
Sun Mar 3 15:44:28 2019 WARNING: Using --management on a TCP port WITHOUT passwords is STRONGLY discouraged and considered insecure
Sun Mar 3 15:44:28 2019 WARNING: file '/tmp/openvpncl/ta.key' is group or others accessible
Sun Mar 3 15:44:28 2019 WARNING: file '/tmp/openvpncl/credentials' is group or others accessible
Sun Mar 3 15:44:28 2019 OpenVPN 2.4.6 arm-unknown-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Oct 10 2018
Sun Mar 3 15:44:28 2019 library versions: OpenSSL 1.1.1 11 Sep 2018, LZO 2.09
Sun Mar 3 15:44:28 2019 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:16
Sun Mar 3 15:44:28 2019 WARNING: --ping should normally be used with --ping-restart or --ping-exit
Sun Mar 3 15:44:28 2019 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Sun Mar 3 15:44:28 2019 NOTE: --fast-i
@martinda
martinda / jenkins.yaml
Last active November 26, 2018 01:43
Jenkins configuration as Code Credentials example
jenkins:
# There can be elements here that refer to the credential id below
# Credentials is a root element (do not indent it)
credentials:
system:
domainCredentials:
- credentials:
-usernamePassword:
scope: "SYSTEM"
@martinda
martinda / backgroundBashFunction.bash
Created November 23, 2018 14:27
How to kill a bash function and what it runs
#!/bin/bash
set -o xtrace
function task {
cat /dev/random >/dev/null
}
task & pid=$!
sleep 1
ps -fH
kill $pid
@martinda
martinda / queueItemParamTest.groovy
Last active April 26, 2018 14:57
Test jenkins-rest QueueItem parameters
Grab(group='com.cdancy', module='jenkins-rest', version='0.0.6')
import com.cdancy.jenkins.rest.JenkinsClient
import com.cdancy.jenkins.rest.domain.queue.QueueItem
import com.cdancy.jenkins.rest.features.JobsApi
import com.google.common.collect.Lists
JenkinsClient client = JenkinsClient.builder().build();
String jobXml = '''
@martinda
martinda / testcontainer.log
Created October 18, 2017 11:53
./mvnw -pl modules/jdbc-test test
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestContainers :: JDBC :: Tests 0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jdbc-test ---