Skip to content

Support writefile step in pipeline #1026

Open
@chilianyi

Description

@chilianyi

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

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions