Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
Jenkins Pipeline Docker-Angular CI Project

I made a pipeline script to be able to run a project that I pulled from github but somehow dockerfile is not working properly and after I build the project successfully I can just see the nginx screen and nothing beyond that. Here is my script : any help is highly appreciated!

def cal = Calendar.instance
def dateFormat = 'YYYYMMDD-hhmmss'
def timeZone = TimeZone.getTimeZone('GMT+03:00')
def timeStamp = Calendar.getInstance().getTime().format('YYYYMMDD-hhmmss',TimeZone.getTimeZone('GMT+03:00'))


pipeline {
    agent {
        node {
            label 'master'
            customWorkspace "${params.workingDir}"
        }
    }
    stages {
        stage('removeOldFiles') {
            steps {
                
                powershell " Remove-Item * -Recurse -Force"
            }
        }
        stage('gitClone') {
            steps {
                
                powershell "git clone https://github.com/formio/angular.git ./"
            }
        }
        stage('removeUnnecessaryFiles') {
            steps {
                powershell "Remove-Item Dockerfile -Recurse -Force"
            }
        }
        stage('createDockerFile') {
            steps {
                powershell """
                echo 'FROM nginx:latest' > Dockerfile.tmp 
                echo 'COPY ./dist/angular-formio/ /usr/share/nginx/html' >> Dockerfile.tmp
                echo 'EXPOSE ${params.exposePort}' >> Dockerfile.tmp
                
                """
                powershell "Get-Content .\\Dockerfile.tmp | Set-Content -Encoding utf8 Dockerfile"
            }
        }
        stage('buildProject') {
            steps {
                
                powershell """
                Remove-Item package-lock.json -Recurse -Force 
                npm install
                npm run ng build
                """
                
            }
        }
        stage('buildImage') {
             steps {

                powershell "docker image build -t ${params.imageName}${timeStamp} ."
            } 
        }
        stage('runContainer') {
             steps {

                powershell "docker container run -d -it --name ${params.containerName} -p 22900:${params.exposePort} ${params.imageName}${timeStamp}" 

             } 
        }
     
    }
}
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!