Jenkins pipeline for angular application
Jagan Rajagopal AWS Certified Solution Associate ,Aws Coach Jagan ,Azure ,Terraform
AWS Certified Solution Architect | 6K Followers | Aws Coach Jagan Certified AWS Solutions Architect | Freelance on Cloud | DevOps Expert | Azure Solution Architect | Terraform | Gitlab | Devops | Kubernetes | IAC
To create a Jenkins pipeline that builds an Angular application, you can follow these steps. We'll assume you already have Jenkins set up on your server:
pipeline {
agent any
stages {
stage('Checkout') {
steps {
// Check out the source code from your repository
checkout scm
}
}
stage('Install Dependencies') {
steps {
// Use Node.js and npm installed on the Jenkins agent
sh 'npm install'
}
}
stage('Build Angular App') {
steps {
// Build the Angular app
sh 'npm run build'
}
}
}
post {
success {
// Define post-build actions, if needed
// For example, you can archive the build artifacts
archiveArtifacts(allowEmptyArchive: true, artifacts: 'dist/**')
}
}
}
pipeline { agent any stages { stage('Checkout') { steps { // Check out the source code from your repository checkout scm } } stage('Install Dependencies') { steps { // Use Node.js and npm installed on the Jenkins agent sh 'npm install' } } stage('Build Angular App') { steps { // Build the Angular app sh 'npm run build' } } } post { success { // Define post-build actions, if needed // For example, you can archive the build artifacts archiveArtifacts(allowEmptyArchive: true, artifacts: 'dist/**') } } }
领英推荐
This pipeline script is a basic example, and you can extend it to include additional stages or post-build actions according to your specific requirements, such as deploying the built Angular app to a web server or running tests. Make sure to configure Jenkins agents with Node.js and npm installed to successfully build your Angular application.
#jenkins #devops #cicd #angularapplication
??? Your post provides valuable information on streamlining the development pipeline. Automation is key in modern software development, and Jenkins plays a crucial role. Thanks for sharing your knowledge and helping us stay updated on these important practices: to get further details: https://www.dhirubhai.net/feed/update/urn:li:activity:7108363860008443904