Skip to content

Instantly share code, notes, and snippets.

View aneveux's full-sized avatar
🐝
ʕノ•ᴥ•ʔノ ︵ ┻━┻

Antoine Neveux aneveux

🐝
ʕノ•ᴥ•ʔノ ︵ ┻━┻
View GitHub Profile
@aneveux
aneveux / backport.sh
Created June 10, 2024 20:52 — forked from jglick/backport.sh
Example of setting up a Jenkins plugin backport branch
BASE=1.19 # or whatever; last release compatible with targeted core or other deps
BASETAG=mystuff-${BASE} # or as per http://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#tagNameFormat
FIX=abcd1234 # whatever the backportable fix was, in master or somewhere newer than $BASE
git checkout -b ${BASE}.x $(git log --reverse --ancestry-path --pretty=%H ${BASETAG}..master | head -1)
# or for JEP-305 (“Incrementals”) use: mvn versions:set-property -Dproperty=revision -DnewVersion=${BASE}.1
mvn versions:set -DnewVersion=${BASE}.1-SNAPSHOT -DgenerateBackupPoms=false
git commit -a -m "Prepare for ${BASE}.1"
git push -u origin ${BASE}.x
git cherry-pick -x -m1 $FIX
mvn -B release:{prepare,perform}
@aneveux
aneveux / oc-postgre-backup.sh
Last active September 16, 2020 14:33
Noob-level shell script allowing dumping a pgsql database running on an openshift pod in a file.
#!/bin/sh
# oc-postgre-backup
# creates a backup file for a postgre database running on an openshift pod
# ------------------
# requires:
# - oc - openshift client, allowing connecting to the postgre pod
# - pg_dump - part of the postgresql package, allowing creating the dump file from the database
# ------------------
# arguments:
clic:mvn --maven-reference com.worldline.clic:example.remote-shell.myconfig:1.0.0-SNAPSHOT --generate-pom --maven-command antrun:run -Dpassphrase=mySecretPassphrase -Dusername=myself -Dcommand='uname -a'
clic:mvn --maven-reference com.worldline.clic:example.remote-shell:1.0.0-SNAPSHOT --generate-pom --maven-command antrun:run -Dhost=my-host -Dport=22 -Dkeyfile=/path/to/id_rsa -Dpassphrase=mySecretPassphrase -Dusername=myself -Dcommand='uname -a'
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.worldline.clic</groupId>
<artifactId>example.remote-shell</artifactId>
<version>[1.0.0-SNAPSHOT,)</version>
</parent>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.worldline.clic</groupId>
<artifactId>example.remote-shell</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Remote Shell Example</name>
package com.sample.demo.commands;
import com.sample.demo.Messages;
import com.worldline.clic.commands.AbstractCommand;
import com.worldline.clic.commands.CommandContext;
/**
* Just an example of a command...
*
* @author aneveux
@aneveux
aneveux / plugin.xml
Last active December 27, 2015 18:59
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="com.worldline.clic.commands">
<command
description="Just an example of a command you could develop..."
id="example:hello"
implementation="com.sample.demo.commands.HelloCommand">
</command>
package com.acme.sample.commands;
import com.acme.sample.Messages;
import com.worldline.clic.commands.AbstractCommand;
import com.worldline.clic.commands.CommandContext;
/**
* Just an example of a command...
*
* @author aneveux
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="com.worldline.clic.commands">
<command
description="Just an example of a command you could develop..."
id="example:hello"
implementation="com.acme.sample.commands.HelloCommand">
</command>