@Library("ogury-jenkins-lib@v4.0.2")

def multiAZ = true

def clusters = pipelineUtils.getClusters(multiAZ)
def projectName = pipelineUtils.getProjectName()
def podLabel = pipelineUtils.getPodLabel()
def confMap = pipelineUtils.getConf()

def ogury_env = confMap["environment"]
def dockerTag = confMap["dockerTag"]
def deploy = confMap["deploy"]
def secretNames = [:]

pipeline {
    agent {
        kubernetes {
            label "${podLabel}"
            defaultContainer 'test'
            yamlFile 'PodTemplate.yaml'
        }
    }
    stages {
        stage("Compile") {
            steps {
                sh '''
                apt-get update -y
                apt-get install -y autoconf automake libtool curl make g++ unzip

                curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.0/protoc-3.15.0-linux-x86_64.zip
                mkdir /protoc
                mkdir /proto
                unzip protoc-3.15.0-linux-x86_64.zip -d /protoc
                '''

                sh '/protoc/bin/protoc -I . --cpp_out=/proto $(find . -name \'*.proto\')'
            }
        }
    }
}
