kubesphere / ks-devops

This is a cloud-native application that focuses on the DevOps area.
https://kubesphere.io/devops/
Apache License 2.0
159 stars 89 forks source link

Support writefile step in pipeline #1026

Open chilianyi opened 1 year ago

chilianyi commented 1 year ago

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