---
title: script_generator
description: "运行script_generator二进制文件会根据machine.yaml文件中的配置生成script.gitlab和script.jenkins鲲鹏原生开发流水线模板。"
url: https://www.hikunpeng.com/document/detail/zh/nativedevp/userguide/devpipecli/NativeDevelopment_0132.html
sourcePath: /source/zh/nativedevp/userguide/devpipecli/NativeDevelopment_0132.html
indexId: 8828111bf645b25d17d53ecfd4bd7166a82826318b736220f291f288a47b850f70
---
# script_generator

运行script_generator二进制文件会根据machine.yaml文件中的配置生成script.gitlab和script.jenkins鲲鹏原生开发流水线模板。

#### 命令功能

可按machine.yaml配置文件中的有效角色生成script.gitlab和script.jenkins鲲鹏原生开发流水线模板。


#### 命令格式

```
script_generator [-h] [-f YAML_PATH] [--silent]
```

查看工具的使用提示。

```
./script_generator -h
```

回显信息如下：

```
usage: script_generator [-h] [-f YAML_PATH] [--silent]
devkit-pipeline script generator
optional arguments:
-h, --help            show this help message and exit
-f YAML_PATH, --config YAML_PATH
Assign yaml config file path. Default path is 'machine.yaml' in current directory.
--silent              Close debug log.
```


#### 参数说明


**表1 参数说明**

| 参数 | 参数选项 | 参数说明 |
| --- | --- | --- |
| \-h/\-\-help | \- | 可选参数，获取帮助信息。 |
| \-f/\-\-config | YAML\_PATH | 可选参数，machine.yaml文件路径。 |
| \-\-silent | \- | 可选参数，关闭调试日志。 |


#### 使用示例

1. 按照machine.yaml配置文件中的有效角色在“linux”路径下生成script.gitlab和script.jenkins鲲鹏原生开发流水线模板。

```
./script_generator -f ./machine.yaml
```


  machine.yaml与生成的模板内容具体对应关系如下： scanner：软件迁移评估、源码迁移、64位运行模式检查、字节对齐检查、内存一致性检查、向量化检查、构建亲和。 c_builder_gcc：普通编译、GCC for openEuler编译。 c_builder_bisheng_compiler：毕昇编译器编译。 java_builder_jdk8：JDK 8编译。 java_builder_jdk17：JDK 17编译。 compatibility：鲲鹏兼容性测试。 tester：Java性能测试。

2. 在生成的流水线模板文件（script_jenkins、script_gitlab）中进行相应修改，修改后可在流水线中运行。
  基于Jenkins和GitLab流水线的A-FOT工具编译请参见A-FOT工具配置文件参数优化使用说明(https://www.hikunpeng.com/document/detail/zh/nativedevp/userguide/pipeline/NativeDevelopment_0115.html)在鲲鹏服务器中修改配置文件，兼容性测试工具测试请参见安装Compatibility Testing兼容性测试工具(https://www.hikunpeng.com/document/detail/zh/nativedevp/userguide/install/NativeDevelopment_0013.html)在鲲鹏服务器上修改配置文件。

  图1 Jenkins流水线模板

  图2 GitLab流水线模板
