The initialization capability of SCF CLI allows you to quickly create a simple template project for further development. The newly created template project has the required code and configuration file. It can be directly packaged or further modified for deployment.
Initialize a project by running the scf init
command.
The parameters supported by the scf init
command are as follows:
Parameter | Short Form | Required | Description | Example |
---|---|---|---|---|
name | -n | No | Name of the generated project, which is demo by default if left blank. |
test |
runtime | -r | No | Runtime environment of the generated project. Value range: nodejs6.10, python2.7, nodejs 8.9, python3.6, php5, php7, go1. Default value: python3.6. | python2.7 |
output-dir | -o | No | Specifies the directory generated by the project, which is the current directory by default. | /root/scf/code |
location | -l | No | Specifies the path to an existing project, which can be git, mercurial, http(s), zip, or path. The project must be generated by cookiecutter. | - |
Run the following command to create a project named testproject
for Python 2.7 in the /Users/xxx/code/scf
directory.
$ scf init --runtime python2.7 --name testproject --output-dir /Users/xxx/code/scf/
[+] Initializing project...
Template: gh:NevenMoore/demo-python
Output-Dir: /Users/xxx/code/scf/
Project-Name: testproject
"Runtime": "Python2.7"
[*] Project initialization is complete
$ tree /Users/xxx/code/scf/testproject
/Users/xxx/code/scf/testproject
├── README.md
├── main.py
└── template.yaml
1 directory, 3 files
Was this page helpful?