Skip to content

Commit 73b726d

Browse files
author
risc ()
committed
jenkinsfile changes
1 parent a2d1bdc commit 73b726d

File tree

4 files changed

+66
-67
lines changed

4 files changed

+66
-67
lines changed

eks/bitbucket/Jenkinsfile

Lines changed: 0 additions & 56 deletions
This file was deleted.

eks/github/staging/Jenkinsfile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
pipeline {
2+
options {
3+
buildDiscarder(logRotator(numToKeepStr: '5'))
4+
skipStagesAfterUnstable()
5+
disableConcurrentBuilds()
6+
}
7+
agent {
8+
kubernetes {
9+
inheritFrom 'c8y-hugo'
10+
defaultContainer 'default'
11+
}
12+
}
13+
environment {
14+
YUM_SRV = 'staging-resources.cumulocity.com'
15+
YUM_USR = 'hudson'
16+
YUM_DEST_DIR = '/var/www/staging-resources/staticpage-guides/guides/'
17+
HUGO_PARAMS = ""
18+
}
19+
stages {
20+
stage('Checkout') {
21+
steps {
22+
checkout([
23+
$class: 'GitSCM', branches: [[name: 'master']],
24+
extensions: [[$class: 'CleanCheckout']],
25+
userRemoteConfigs: [[url: '[email protected]:SoftwareAG/c8y-docs.git', credentialsId:'jenkins-master']] ])
26+
}
27+
}
28+
stage('Build') {
29+
steps {
30+
sh '''bash --login
31+
python /stageScanner.py
32+
echo \"Starting hugo with params ${HUGO_PARAMS}\"
33+
ls
34+
hugo ${HUGO_PARAMS}
35+
'''
36+
}
37+
}
38+
stage('Deploy') {
39+
steps {
40+
sshagent(['jenkins-master']) {
41+
sh '''bash --login
42+
python /docsRepoScannerForStaging.py ./
43+
pwd
44+
ls
45+
cp output.json ./public/releases.json
46+
echo "rsync -e 'ssh -o StrictHostKeyChecking=no' -avh ./public/* ${YUM_USR}@${YUM_SRV}:${YUM_DEST_DIR} --delete"
47+
rsync -e 'ssh -o StrictHostKeyChecking=no' -avh ./public/* ${YUM_USR}@${YUM_SRV}:${YUM_DEST_DIR} --delete
48+
'''
49+
}
50+
}
51+
}
52+
}
53+
}

eks/bitbucket/Manual_release.Jenkinsfile renamed to eks/github/staging/Manual_release.Jenkinsfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,34 @@ pipeline {
55
}
66
agent {
77
kubernetes {
8-
inheritFrom 'c8y-ubuntu-hugo-deploy:latest'
9-
defaultContainer 'hugo'
8+
inheritFrom 'c8y-hugo'
9+
defaultContainer 'default'
1010
}
1111
}
1212
parameters {
1313
string(defaultValue: 'release/r10.4.6-BB', description: 'branch/revison', name: 'BRANCH')
1414
}
1515
environment {
16-
YUM_SRV = 'yum.cumulocity.com'
16+
YUM_SRV = 'staging-resources.cumulocity.com'
1717
YUM_USR = 'hudson'
18-
YUM_DEST_DIR = '/var/www/staticpage-guides/guides/'
18+
YUM_DEST_DIR = '/var/www/staging-resources/staticpage-guides/guides/'
1919
HUGO_PARAMS = ""
2020
}
2121

2222
stages {
2323
stage('Checkout') {
2424
steps {
25-
git branch: "${params.BRANCH}", credentialsId: "jenkins-master", url:'ssh://git@bitbucket.org/m2m/c8y-docs/'
25+
git branch: "${params.BRANCH}", credentialsId: "jenkins-master", url:'git@github.com:SoftwareAG/c8y-docs.git'
2626
}
2727
}
2828
stage('Build') {
2929
steps {
3030
sh '''bash --login
31+
python /stageScanner.py
3132
if [ -f "properties.json" ]
3233
then
3334
DOC_VERSION=$( jq -r '.name' < properties.json )
34-
hugo ${HUGO_PARAMS} -d ./${DOC_VERSION}
35+
hugo ${HUGO_PARAMS} -d ./${DOC_VERSION}
3536
else
3637
echo "Properties not found."
3738
exit 1
@@ -51,4 +52,4 @@ pipeline {
5152
}
5253
}
5354
}
54-
}
55+
}

eks/bitbucket/Rebuild_indexes.Jenkinsfile renamed to eks/github/staging/Rebuild_indexes.Jenkinsfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ pipeline {
99
defaultContainer 'default'
1010
}
1111
}
12+
1213
environment {
13-
YUM_SRV = 'yum.cumulocity.com'
14+
YUM_SRV = 'staging-resources.cumulocity.com'
1415
YUM_USR = 'hudson'
15-
YUM_DEST_DIR = '/var/www/staticpage-guides/guides'
16+
YUM_DEST_DIR = '/var/www/staging-resources/staticpage-guides/guides/'
1617
HUGO_PARAMS = ""
1718
}
1819

1920
stages {
2021
stage('Checkout') {
2122
steps {
22-
git branch: "master", credentialsId: "jenkins-master", url:'ssh://git@bitbucket.org/m2m/c8y-docs/'
23+
git branch: "master", credentialsId: "jenkins-master", url:'git@github.com:SoftwareAG/c8y-docs.git'
2324
}
2425
}
2526
stage('Deploy') {
@@ -35,4 +36,4 @@ pipeline {
3536
}
3637
}
3738
}
38-
}
39+
}

0 commit comments

Comments
 (0)