diff --git a/eks/bitbucket/Jenkinsfile b/eks/bitbucket/Jenkinsfile deleted file mode 100644 index 41eb8d933e..0000000000 --- a/eks/bitbucket/Jenkinsfile +++ /dev/null @@ -1,56 +0,0 @@ -properties([ - buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '5')), - disableConcurrentBuilds() -]) - -podTemplate( - imagePullSecrets: ['ci-registry-pull'], - containers: [ - containerTemplate(name:'hugo', image:'registry.stage.c8y.io/ci/c8y-ubuntu-hugo-deploy:latest', ttyEnabled:true,command: 'cat', - envVars:[ - containerEnvVar(key:'YUM_SRV', value: 'yum.cumulocity.com'), - containerEnvVar(key:'YUM_USR', value: 'hudson'), - containerEnvVar(key:'YUM_DEST_DIR', value: '/var/www/staticpage-guides/guides/'), - ] - ) - ],yaml: """ - spec: - securityContext: - fsGroup: 1000 - """ -) -{ -node(POD_LABEL) { - def HUGO_PARAMS = "" - stage('Checkout') { - container('docker') { - checkout([ - $class: 'GitSCM', branches: [[name: 'carbon_migration']], - extensions: [[$class: 'CleanCheckout']], - userRemoteConfigs: [[url: 'git@bitbucket.org:m2m/c8y-docs.git',credentialsId:'jenkins-master']] ]) - } - } - stage('Build') { - container('hugo') { - - sh '''echo \"Starting hugo with params ${HUGO_PARAMS}\" - ls - hugo ${HUGO_PARAMS}''' - } - } - stage('Deploy') { - container('hugo') { - sshagent(['jenkins-master']) { - sh '''bash --login - python /docsRepoScanner.py ./ - pwd - ls - cp output.json ./public/releases.json - echo "Disabled 'rsync -avh ./public/* ${YUM_USR}@${YUM_SRV}:${YUM_DEST_DIR} --delete'" - ''' - sh "rsync -e 'ssh -o StrictHostKeyChecking=no' -avh ./public/* ${env.YUM_USR}@${env.YUM_SRV}:${YUM_DEST_DIR} --delete" - } - } - } - } -} diff --git a/eks/github/staging/Jenkinsfile b/eks/github/staging/Jenkinsfile new file mode 100644 index 0000000000..947bc6b527 --- /dev/null +++ b/eks/github/staging/Jenkinsfile @@ -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: 'git@github.com: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 + ''' + } + } + } + } +} diff --git a/eks/bitbucket/Manual_release.Jenkinsfile b/eks/github/staging/Manual_release.Jenkinsfile similarity index 76% rename from eks/bitbucket/Manual_release.Jenkinsfile rename to eks/github/staging/Manual_release.Jenkinsfile index b68a3a52cb..41fe697768 100644 --- a/eks/bitbucket/Manual_release.Jenkinsfile +++ b/eks/github/staging/Manual_release.Jenkinsfile @@ -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 @@ -51,4 +52,4 @@ pipeline { } } } -} \ No newline at end of file +} diff --git a/eks/bitbucket/Rebuild_indexes.Jenkinsfile b/eks/github/staging/Rebuild_indexes.Jenkinsfile similarity index 80% rename from eks/bitbucket/Rebuild_indexes.Jenkinsfile rename to eks/github/staging/Rebuild_indexes.Jenkinsfile index 13d398cde2..dc49e84b17 100644 --- a/eks/bitbucket/Rebuild_indexes.Jenkinsfile +++ b/eks/github/staging/Rebuild_indexes.Jenkinsfile @@ -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') { @@ -35,4 +36,4 @@ pipeline { } } } -} \ No newline at end of file +}