Remove oss pipelines as they were moved
OSS pipelines were moved into oss/jenkins/pipelines and can be removed
from mk/mk-pipelines.
Change-Id: I51132faa1f38d49dfa7ff5ae3974109c6ddd95cc
diff --git a/docker-build-to-jfrog.groovy b/docker-build-to-jfrog.groovy
deleted file mode 100644
index b16dc06..0000000
--- a/docker-build-to-jfrog.groovy
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * Docker image build pipeline with push to JFrog
- * IMAGE_NAME - Image name
- * IMAGE_TAGS - Tag list for image, separated by space
- * CONTEXT_PATH - Path to build context directory
- * CREDENTIALS_ID - gerrit credentials id
- * DOCKERFILE_PATH - path to dockerfile in repository
- * DOCKER_REGISTRY - url to registry
- * PROJECT_NAMESPACE - in which namespace will be stored
-**/
-def artifactory = new com.mirantis.mcp.MCPArtifactory()
-def common = new com.mirantis.mk.Common()
-def gerrit = new com.mirantis.mk.Gerrit()
-
-
-node("docker") {
- def artifactoryServer = Artifactory.server("mcp-ci")
- def buildInfo = Artifactory.newBuildInfo()
-
- def projectNamespace = "mirantis/${PROJECT_NAMESPACE}"
-
- def dockerRepository = DOCKER_REGISTRY
- def docker_dev_repo = "docker-dev-local"
- def docker_prod_repo = "docker-prod-local"
- def dockerFileOption
-
- def buildTag = "oss-ci-docker-${BUILD_NUMBER}-${GERRIT_CHANGE_NUMBER}-${GERRIT_PATCHSET_NUMBER}"
-
- if (DOCKERFILE_PATH.trim() == ''){
- dockerFileOption = ''
- }
- else {
- dockerFileOption = "--file ${DOCKERFILE_PATH}"
- }
- def buildCmd = "docker build --tag ${buildTag} ${dockerFileOption} --rm ${CONTEXT_PATH}"
-
- def imageTagsList = IMAGE_TAGS.tokenize(" ")
- def workspace = common.getWorkspace()
-
- gerritChange = gerrit.getGerritChange(GERRIT_NAME, GERRIT_HOST, GERRIT_CHANGE_NUMBER, CREDENTIALS_ID)
-
- try{
- stage("checkout") {
- gerrit.gerritPatchsetCheckout([
- credentialsId : CREDENTIALS_ID,
- withWipeOut : true,
- ])
- }
- stage("build image"){
- sh "${buildCmd}"
- imageTagsList << "${GERRIT_CHANGE_NUMBER}_${GERRIT_PATCHSET_NUMBER}"
- for (imageTag in imageTagsList) {
- sh "docker tag ${buildTag} ${dockerRepository}/${projectNamespace}/${IMAGE_NAME}:${imageTag}"
- }
- }
- stage("publish image"){
- if (gerritChange.status != "MERGED"){
- for (imageTag in imageTagsList) {
- artifactory.uploadImageToArtifactory(artifactoryServer,
- dockerRepository,
- "${projectNamespace}/${IMAGE_NAME}",
- imageTag,
- docker_dev_repo,
- buildInfo)
- currentBuild.description = "image: ${IMAGE_NAME}:${imageTag}<br>"
- }
- } else {
- def properties = [
- 'com.mirantis.gerritChangeId': "${GERRIT_CHANGE_ID}",
- 'com.mirantis.gerritPatchsetNumber': "${GERRIT_PATCHSET_NUMBER}",
- 'com.mirantis.gerritChangeNumber' : "${GERRIT_CHANGE_NUMBER}"
- ]
- // Search for an artifact with required properties
- def artifactURI = artifactory.uriByProperties(artifactoryServer.getUrl(),
- properties)
- // Get build info: build id and job name
- if ( artifactURI ) {
- def buildProperties = artifactory.getPropertiesForArtifact(artifactURI)
- //promote docker image
- artifactory.promoteDockerArtifact(artifactoryServer.getUrl(),
- docker_dev_repo,
- docker_prod_repo,
- "${projectNamespace}/${IMAGE_NAME}",
- buildProperties.get('com.mirantis.targetTag').join(','),
- 'latest')
- } else {
- throw new RuntimeException("Artifacts were not found, nothing to promote")
- }
- }
- }
- } catch (Throwable e) {
- currentBuild.result = 'FAILURE'
- common.errorMsg("Build failed due to error: ${e}")
- throw e
- } finally {
- common.sendNotification(currentBuild.result, "",["slack"])
- }
-}
diff --git a/test-devops-portal-pipeline.groovy b/test-devops-portal-pipeline.groovy
deleted file mode 100644
index 64e18f7..0000000
--- a/test-devops-portal-pipeline.groovy
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
-* OSS - The DevOps Portal Testing Pipeline
-* CREDENTIALS_ID - gerrit credentials id
-**/
-
-gerrit = new com.mirantis.mk.Gerrit()
-common = new com.mirantis.mk.Common()
-
-def getProjectName(gerritRef, defaultGitRef) {
- def refSpec
- if (gerritRef) {
- refSpec = gerritRef
- } else {
- refSpec = defaultGitRef
- }
- def refValue = refSpec.tokenize('/').takeRight(2).join('')
- return "oss${BUILD_NUMBER}${refValue}"
-}
-
-def executeCmd(user, project, cmd) {
- common.infoMsg("Starting command: ${cmd}")
- wrap([$class: 'AnsiColorBuildWrapper']) {
- // Docker sets HOME=/ ignoring that it have to be HOME=/opt/workspace,
- // as `docker-compose exec` does not support to pass environment
- // variables, then `docker exec` is used.
- sh("docker exec --user=${user} --env=HOME=/opt/workspace ${project}_devopsportal_1 ${cmd}")
- }
- common.successMsg("Successfully completed: ${cmd}")
-}
-
-def gerritRef
-try {
- gerritRef = GERRIT_REFSPEC
-} catch (MissingPropertyException e) {
- gerritRef = null
-}
-
-def defaultGitRef, defaultGitUrl
-try {
- defaultGitRef = DEFAULT_GIT_REF
- defaultGitUrl = DEFAULT_GIT_URL
-} catch (MissingPropertyException e) {
- defaultGitRef = null
- defaultGitUrl = null
-}
-def checkouted = false
-
-node("vm") {
- def composePath = 'docker/stack/docker-compose.yml'
- def projectName
- def jenkinsUser
-
- try {
- stage('Checkout Source Code') {
- if (gerritRef) {
- // job is triggered by Gerrit
- checkouted = gerrit.gerritPatchsetCheckout ([
- credentialsId : CREDENTIALS_ID,
- withWipeOut : true,
- ])
- } else if(defaultGitRef && defaultGitUrl) {
- checkouted = gerrit.gerritPatchsetCheckout(defaultGitUrl, defaultGitRef, "HEAD", CREDENTIALS_ID)
- }
- if(!checkouted){
- throw new Exception("Cannot checkout gerrit patchset, GERRIT_REFSPEC and DEFAULT_GIT_REF is null")
- }
- }
-
- projectName = getProjectName(gerritRef, defaultGitRef)
-
- stage('Setup Up Stack') {
- sh("docker-compose --file ${composePath} --project-name=${projectName} pull")
- sh("docker-compose --file ${composePath} --project-name=${projectName} up -d --force-recreate")
- common.successMsg("Stack with the ${projectName} is started.")
- }
-
- def jenkinsUID = common.getJenkinsUid()
- def jenkinsGID = common.getJenkinsGid()
-
- jenkinsUser = "${jenkinsUID}:${jenkinsGID}"
-
- stage('Print Environment Information') {
- sh("docker-compose version")
- sh("docker version")
- executeCmd(jenkinsUser, projectName, "npm config get")
- executeCmd(jenkinsUser, projectName, "env")
- executeCmd(jenkinsUser, projectName, "ls -lan")
- }
-
- stage('Install Dependencies') {
- executeCmd(jenkinsUser, projectName, "npm install")
- }
- stage('Run Linter Tests') {
- executeCmd(jenkinsUser, projectName, "npm run lint")
- }
- stage('Run Unit Tests') {
- timeout(4) {
- executeCmd(jenkinsUser, projectName, "npm run test:unit")
- }
- }
- stage('Run Function Tests') {
- timeout(20) {
- try {
- executeCmd(jenkinsUser, projectName, "npm run test:functional")
- } catch (err) {
- archiveArtifacts(
- artifacts: "test_output/**/*.png",
- allowEmptyArchive: true,
- )
- throw err
- }
- }
- }
- } catch (err) {
- currentBuild.result = 'FAILURE'
- common.errorMsg("Build failed due to error: ${err}")
- throw err
- } finally {
- common.sendNotification(currentBuild.result, "" ,["slack"])
- stage('Cleanup') {
- wrap([$class: 'AnsiColorBuildWrapper']) {
- sh("docker-compose -f ${composePath} -p ${projectName} down")
- }
- }
- }
-}
-