ks-devops icon indicating copy to clipboard operation
ks-devops copied to clipboard

Support writefile step in pipeline

Open chilianyi opened this issue 1 year ago • 0 comments
trafficstars

What is version of KubeSphere DevOps has the issue?

v3.4.1

How did you install the Kubernetes? Or what is the Kubernetes distribution?

kubekey

Describe this feature

截屏2023-11-23 12 17 13
pipeline {
    agent any

    stages {
        stage('Generate Dockerfile and Build Image') {
            steps {
              writeFile file: 'test', text: '''
              abcdefg
              '''
              
              writeFile file: 'Dockerfile', text: '''
                  FROM nginx:latest
                  ADD test ./
              '''

              sh "docker build -t test:latest ."
            }
        }
    }
}

Additional information

No response

chilianyi avatar Nov 23 '23 04:11 chilianyi