Skip to content

Instantly share code, notes, and snippets.

View kenrachynski's full-sized avatar

Ken Rachynski kenrachynski

View GitHub Profile
@kenrachynski
kenrachynski / example.md
Last active February 22, 2024 16:24
Markdown example

c.f.

git status
git add *
git commit -s -m “GitHub pollutes everything”
public void sayHello(String Name) {
 System.out.println("Hello {}".format(name));
@kenrachynski
kenrachynski / Jenkinsfile
Created November 27, 2019 19:47
Jenkinsfile processing multiple environments
pipeline {
agent any
environment {
COMMITDATE = ""
}
stages {
stage('setup') {
steps {
script {
COMMITDATE = sh(returnStdout: true, script: "git show -s --format=%ci ${GIT_COMMIT}")
@kenrachynski
kenrachynski / README.md
Created July 25, 2019 22:49
Get build agent from downstream pipeline jobs

Getting agent name from a downstream pipeline build

The Jenkins documentation makes a reference to currentBuild.buildVariables for fetching variables from downstream jobs.

for a Pipeline downstream build, any variables set globally on env at the time the build ends. Child Pipeline jobs can use this to report additional information to the parent job by setting variables in env. Note that build parameters are not shown in buildVariables.

It took me a bit to catch on that set globally was the key part. if you want any environment variables, like the NODE_NAME passed back to the parent job, you need to explicitly set them in the child job.

@kenrachynski
kenrachynski / Jenkinsfile
Created May 30, 2019 16:08
pipeline with authentication deploying wildfly application
pipeline {
agent {
label 'aws'
}
environment {
JBOSSADMIN = credentials('jboss-admin')
MAVEN_SETTINGS = credentials('maven-settings-windows')
}
tools {
maven 'Maven35'
@kenrachynski
kenrachynski / Jenkinsfile
Created May 3, 2019 18:11
Jenkins Input to deploy to prod
pipeline {
agent {
label 'aws'
}
tools {
maven 'Maven35'
jdk 'jdk-1.8.0-aws'
}
stages {
stage('Build') {
@kenrachynski
kenrachynski / Jenkinsfile
Last active March 27, 2019 21:55 — forked from slide/Jenkinsfile
groovy var
pipeline {
agent any
environment {
PROJECT = 'myproj'
SITE_PART = 'booking'
TG_BOT_ID_TOKEN = credentials('bot_token')
TG_CHAT_ID__TestChaT = credentials('TG_CHAT_ID__TestChaT')
@kenrachynski
kenrachynski / declarative.groovy
Last active September 27, 2018 16:44
Adding Maven to pipeline
#!/usr/bin/env Groovy
pipeline {
agent any
tools {
maven 'Maven35'
}
stages {
stage('Build') {
sh 'mvn -B -V clean deploy'
@kenrachynski
kenrachynski / LogEvent.java
Created January 25, 2018 18:56
@column(name="keyId") fails to find column keyId
package hello.model;
import javax.persistence.*;
@Entity
@Table(name = "log", catalog = "log")
public class LogEvent {
@Id
@GeneratedValue
private Long id;
@kenrachynski
kenrachynski / build.gradle
Created August 25, 2017 16:41
Gradle 4 exception
//empty file