Expand my Community achievements bar.

SOLVED

Build only ui.apps via Jenkins

Avatar

Level 5

Hi, I've my Jenkins setup with my github repo, so when I click on Build Now it will build the entire project like core, ui.apps, ui.content etc. Now, my requirement is to modify the configuration so as to only build the ui.apps part from Jenkins. Can someone please help me with what changes I need to do? Attached is the
configuration of the Jenkins job.


screencapture-localhost-8080-job-AEM-Local-Author-configure-2023-12-15-19_06_40.png

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @arindam6600 

Please check this https://plugins.jenkins.io/git/#plugin-content-checkout-to-a-sub-directory 

 

Also here is the sample file yaml file 

pipeline {
    agent any

    stages {
        stage('Checkout from Git') {
            steps {
                script {
                    // Define your Git repository URL
                    def gitRepoUrl = '<your-git-repo-url>'
                    
                    // Checkout the master branch
                    checkout([$class: 'GitSCM', branches: [[name: '*/master']], userRemoteConfigs: [[url: gitRepoUrl]]])
                }
            }
        }

        stage('Navigate to Subfolder') {
            steps {
                script {
                    // Define your subfolder name
                    def subfolderName = '<subfolder-name>'
                    
                    // Change directory to the subfolder
                    dir(subfolderName) {
                        // Additional steps within the subfolder if needed
                    }
                }
            }
        }

        stage('Run Maven Clean') {
            steps {
                script {
                    // Run 'mvn clean' command
                    sh 'mvn clean'
                }
            }
        }
    }
}

  



Arun Patidar

View solution in original post

3 Replies

Avatar

Community Advisor

@arindam6600 

 

The image is blury. 

I have not worked on Jenkins, but in general, if you want to build ui.apps, you can go to that folder and execute mvn clean install


Aanchal Sikka

Avatar

Level 5

Yes, this I'm aware of this. But the use case is to do it via Jenkins.

Avatar

Correct answer by
Community Advisor

Hi @arindam6600 

Please check this https://plugins.jenkins.io/git/#plugin-content-checkout-to-a-sub-directory 

 

Also here is the sample file yaml file 

pipeline {
    agent any

    stages {
        stage('Checkout from Git') {
            steps {
                script {
                    // Define your Git repository URL
                    def gitRepoUrl = '<your-git-repo-url>'
                    
                    // Checkout the master branch
                    checkout([$class: 'GitSCM', branches: [[name: '*/master']], userRemoteConfigs: [[url: gitRepoUrl]]])
                }
            }
        }

        stage('Navigate to Subfolder') {
            steps {
                script {
                    // Define your subfolder name
                    def subfolderName = '<subfolder-name>'
                    
                    // Change directory to the subfolder
                    dir(subfolderName) {
                        // Additional steps within the subfolder if needed
                    }
                }
            }
        }

        stage('Run Maven Clean') {
            steps {
                script {
                    // Run 'mvn clean' command
                    sh 'mvn clean'
                }
            }
        }
    }
}

  



Arun Patidar