library 'first-class-pipeline'

executeFreeleapsPipeline {
  serviceName = 'freeleaps'
  environmentSlug = 'alpha'
  serviceGitBranch = 'dev'
  serviceGitRepo = "https://gitea.freeleaps.mathmast.com/products/freeleaps.git"
  serviceGitRepoType = 'monorepo'
  serviceGitCredentialsId = 'freeleaps-repos-gitea-credentails'
  executeMode = 'on-demand'
  commitMessageLintEnabled = false
  components = [
    [
      name: 'chat',
      root: 'apps/chat',
      language: 'python',
      dependenciesManager: 'pip',
      requirementsFile: 'requirements.txt',
      buildCacheEnabled: true,
      buildAgentImage: 'python:3.10-slim-buster',
      buildArtifacts: ['.'],
      lintEnabled: false,
      sastEnabled: false,
      imageRegistry: 'docker.io',
      imageRepository: 'freeleaps',
      imageName: 'chat',
      imageBuilder: 'dind',
      dockerfilePath: '../chat.Dockerfile',
      imageBuildRoot: '..',
      imageReleaseArchitectures: ['linux/amd64', 'linux/arm64/v8'],
      registryCredentialsId: 'freeleaps-devops-docker-hub-credentials',
      semanticReleaseEnabled: true
    ],
    [
      name: 'freeleaps',
      root: 'apps/freeleaps',
      language: 'python',
      dependenciesManager: 'pip',
      requirementsFile: 'requirements.txt',
      buildCacheEnabled: true,
      buildAgentImage: 'python:3.10-slim-buster',
      buildArtifacts: ['.'],
      lintEnabled: false,
      sastEnabled: false,
      imageRegistry: 'docker.io',
      imageRepository: 'freeleaps',
      imageName: 'backend',
      imageBuilder: 'dind',
      dockerfilePath: '../freeleaps.Dockerfile',
      imageBuildRoot: '..',
      imageReleaseArchitectures: ['linux/amd64', 'linux/arm64/v8'],
      registryCredentialsId: 'freeleaps-devops-docker-hub-credentials',
      semanticReleaseEnabled: true
    ],
    [
      name: 'frontend',
      root: 'frontend',
      language: 'javascript',
      dependenciesManager: 'pnpm',
      pnpmPackageJsonFile: 'package.json',
      buildCacheEnabled: true,
      buildAgentImage: 'node:lts',
      buildCommand: 'NODE_OPTIONS=--max-old-space-size=4096 pnpm -r build',
      buildArtifacts: ['freeleaps/dist', 'nuxt-front/.output/public'],
      lintEnabled: false,
      sastEnabled: false,
      imageRegistry: 'docker.io',
      imageRepository: 'freeleaps',
      imageName: 'frontend',
      imageBuilder: 'dind',
      dockerfilePath: 'Dockerfile',
      imageBuildRoot: '.',
      imageReleaseArchitectures: ['linux/amd64', 'linux/arm64/v8'],
      registryCredentialsId: 'freeleaps-devops-docker-hub-credentials',
      semanticReleaseEnabled: true
    ]
  ]
}