Skip to content

Commit

Permalink
Jenkins promotion fix (#22)
Browse files Browse the repository at this point in the history
* Jenkins release pipeline fix

Signed-off-by: Radek Felcman <radek.felcman@oracle.com>
  • Loading branch information
rfelcman authored Apr 20, 2023
1 parent 5d54e1d commit 08b4b32
Showing 1 changed file with 10 additions and 92 deletions.
102 changes: 10 additions & 92 deletions etc/jenkins/release.groovy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved.
// Copyright (c) 2020, 2023 Oracle and/or its affiliates. All rights reserved.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -24,127 +24,45 @@

pipeline {

agent {
kubernetes {
label 'el-master-agent-pod'
yaml """
apiVersion: v1
kind: Pod
spec:
volumes:
- name: tools
persistentVolumeClaim:
claimName: tools-claim-jiro-eclipselink
- name: volume-known-hosts
configMap:
name: known-hosts
- name: settings-xml
secret:
secretName: m2-secret-dir
items:
- key: settings.xml
path: settings.xml
- name: toolchains-xml
configMap:
name: m2-dir
items:
- key: toolchains.xml
path: toolchains.xml
- name: settings-security-xml
secret:
secretName: m2-secret-dir
items:
- key: settings-security.xml
path: settings-security.xml
- name: m2-repo
emptyDir: {}
containers:
- name: jnlp
resources:
limits:
memory: "1Gi"
cpu: "1"
requests:
memory: "1Gi"
cpu: "500m"
- name: el-build
resources:
limits:
memory: "2Gi"
cpu: "2"
requests:
memory: "2Gi"
cpu: "1.5"
image: tkraus/el-build:1.1.8
volumeMounts:
- name: tools
mountPath: /opt/tools
- name: volume-known-hosts
mountPath: /home/jenkins/.ssh
- name: settings-xml
mountPath: /home/jenkins/.m2/settings.xml
subPath: settings.xml
readOnly: true
- name: toolchains-xml
mountPath: /home/jenkins/.m2/toolchains.xml
subPath: toolchains.xml
readOnly: true
- name: settings-security-xml
mountPath: /home/jenkins/.m2/settings-security.xml
subPath: settings-security.xml
readOnly: true
- name: m2-repo
mountPath: /home/jenkins/.m2/repository
tty: true
command:
- cat
"""
}
}
agent any

tools {
jdk 'openjdk-jdk11-latest'
maven 'apache-maven-latest'
}

environment {
DDLPARSER_DIR="${WORKSPACE}/oracleddlparser"
DDLPARSER_DIR = "${WORKSPACE}/oracleddlparser"
}

stages {
// Initialize build environment
stage('Init') {
steps {
container('el-build') {
git branch: GIT_BRANCH_RELEASE, credentialsId: SSH_CREDENTIALS_ID, url: GIT_REPOSITORY_URL
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) {
sh label: '', script: '''
git branch: GIT_BRANCH_RELEASE, credentialsId: SSH_CREDENTIALS_ID, url: GIT_REPOSITORY_URL
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) {
sh label: '', script: '''
gpg --batch --import "${KEYRING}"
for fpr in $(gpg --list-keys --with-colons | awk -F: \'/fpr:/ {print $10}\' | sort -u);
do
echo -e "5\\ny\\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust;
done'''
}
// Git configuration
sh '''
}
// Git configuration
sh '''
git config --global user.name "${GIT_USER_NAME}"
git config --global user.email "${GIT_USER_EMAIL}"
'''
}
}
}
// Perform release
stage('Build and release Oracle DDL Parser') {
steps {
git branch: GIT_BRANCH_RELEASE, credentialsId: SSH_CREDENTIALS_ID, url: GIT_REPOSITORY_URL
sshagent([SSH_CREDENTIALS_ID]) {
container('el-build') {
sh '''
sh '''
etc/jenkins/release.sh "${DDLPARSER_VERSION}" "${NEXT_DDLPARSER_VERSION}" "${DRY_RUN}" "${OVERWRITE}"
'''
}
}
}
}
Expand Down

0 comments on commit 08b4b32

Please sign in to comment.