Skip to content

Commit

Permalink
jenkinsfile changes
Browse files Browse the repository at this point in the history
  • Loading branch information
risc () committed May 2, 2022
1 parent a2d1bdc commit 73b726d
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 67 deletions.
56 changes: 0 additions & 56 deletions eks/bitbucket/Jenkinsfile

This file was deleted.

53 changes: 53 additions & 0 deletions eks/github/staging/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
pipeline {
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
skipStagesAfterUnstable()
disableConcurrentBuilds()
}
agent {
kubernetes {
inheritFrom 'c8y-hugo'
defaultContainer 'default'
}
}
environment {
YUM_SRV = 'staging-resources.cumulocity.com'
YUM_USR = 'hudson'
YUM_DEST_DIR = '/var/www/staging-resources/staticpage-guides/guides/'
HUGO_PARAMS = ""
}
stages {
stage('Checkout') {
steps {
checkout([
$class: 'GitSCM', branches: [[name: 'master']],
extensions: [[$class: 'CleanCheckout']],
userRemoteConfigs: [[url: '[email protected]:SoftwareAG/c8y-docs.git', credentialsId:'jenkins-master']] ])
}
}
stage('Build') {
steps {
sh '''bash --login
python /stageScanner.py
echo \"Starting hugo with params ${HUGO_PARAMS}\"
ls
hugo ${HUGO_PARAMS}
'''
}
}
stage('Deploy') {
steps {
sshagent(['jenkins-master']) {
sh '''bash --login
python /docsRepoScannerForStaging.py ./
pwd
ls
cp output.json ./public/releases.json
echo "rsync -e 'ssh -o StrictHostKeyChecking=no' -avh ./public/* ${YUM_USR}@${YUM_SRV}:${YUM_DEST_DIR} --delete"
rsync -e 'ssh -o StrictHostKeyChecking=no' -avh ./public/* ${YUM_USR}@${YUM_SRV}:${YUM_DEST_DIR} --delete
'''
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,34 @@ pipeline {
}
agent {
kubernetes {
inheritFrom 'c8y-ubuntu-hugo-deploy:latest'
defaultContainer 'hugo'
inheritFrom 'c8y-hugo'
defaultContainer 'default'
}
}
parameters {
string(defaultValue: 'release/r10.4.6-BB', description: 'branch/revison', name: 'BRANCH')
}
environment {
YUM_SRV = 'yum.cumulocity.com'
YUM_SRV = 'staging-resources.cumulocity.com'
YUM_USR = 'hudson'
YUM_DEST_DIR = '/var/www/staticpage-guides/guides/'
YUM_DEST_DIR = '/var/www/staging-resources/staticpage-guides/guides/'
HUGO_PARAMS = ""
}

stages {
stage('Checkout') {
steps {
git branch: "${params.BRANCH}", credentialsId: "jenkins-master", url:'ssh://git@bitbucket.org/m2m/c8y-docs/'
git branch: "${params.BRANCH}", credentialsId: "jenkins-master", url:'git@github.com:SoftwareAG/c8y-docs.git'
}
}
stage('Build') {
steps {
sh '''bash --login
python /stageScanner.py
if [ -f "properties.json" ]
then
DOC_VERSION=$( jq -r '.name' < properties.json )
hugo ${HUGO_PARAMS} -d ./${DOC_VERSION}
hugo ${HUGO_PARAMS} -d ./${DOC_VERSION}
else
echo "Properties not found."
exit 1
Expand All @@ -51,4 +52,4 @@ pipeline {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ pipeline {
defaultContainer 'default'
}
}

environment {
YUM_SRV = 'yum.cumulocity.com'
YUM_SRV = 'staging-resources.cumulocity.com'
YUM_USR = 'hudson'
YUM_DEST_DIR = '/var/www/staticpage-guides/guides'
YUM_DEST_DIR = '/var/www/staging-resources/staticpage-guides/guides/'
HUGO_PARAMS = ""
}

stages {
stage('Checkout') {
steps {
git branch: "master", credentialsId: "jenkins-master", url:'ssh://git@bitbucket.org/m2m/c8y-docs/'
git branch: "master", credentialsId: "jenkins-master", url:'git@github.com:SoftwareAG/c8y-docs.git'
}
}
stage('Deploy') {
Expand All @@ -35,4 +36,4 @@ pipeline {
}
}
}
}
}

0 comments on commit 73b726d

Please sign in to comment.