library 'first-class-pipeline'

executeFreeleapsPipeline {
  serviceName = 'magicleaps'
  environmentSlug = 'prod'
  serviceGitBranch = 'master'
  serviceGitRepo = "https://freeleaps@dev.azure.com/freeleaps/magicleaps/_git/magicleaps"
  serviceGitRepoType = 'monorepo' 
  serviceGitCredentialsId = 'magicleaps-azure-devops-credentials'
  executeMode = 'fully'
  commitMessageLintEnabled = true
  components = [
    [
      name: 'frontend',
      root: 'frontend',
      language: 'javascript',
      dependenciesManager: 'npm',
      npmPackageJsonFile: 'package.json',
      buildCacheEnabled: true,
      buildAgentImage: 'node:lts',
      buildCommand: 'echo "Vue 3 & Webpack cause pod OOM, so we just skip it."',
      buildArtifacts: ['Dockerfile'],
      lintEnabled: false,
      sastEnabled: false,
      imageRegistry: 'docker.io',
      imageRepository: 'sunzhenyucn',
      imageName: 'magicleaps-frontend',
      imageBuilder: 'dind',
      dockerfilePath: 'Dockerfile',
      imageBuildRoot: '.',
      imageReleaseArchitectures: ['linux/amd64', 'linux/arm64/v8'],
      registryCredentialsId: 'magicleaps-dockerhub-credentials',
      semanticReleaseEnabled: true
    ],
    [
      name: 'backend',
      root: 'backend',
      language: 'python',
      dependenciesManager: 'pip',
      buildAgentImage: 'python:3.8-slim-buster',
      buildArtifacts: ['.'],
      buildCacheEnabled: true,
      lintEnabled: false,
      sastEnabled: false,
      imageRegistry: 'docker.io',
      imageRepository: 'sunzhenyucn',
      imageName: 'magicleaps-backend',
      imageBuilder: 'dind',
      dockerfilePath: 'Dockerfile',
      imageBuildRoot: '.',
      imageReleaseArchitectures: ['linux/amd64', 'linux/arm64/v8'],
      registryCredentialsId: 'magicleaps-dockerhub-credentials',
      semanticReleaseEnabled: true
    ]
  ]
}