Create App
-
Create App using GitHub
- Using argument
- Using file
Use command :
initz create app --name=<appname> --source=github --user=<user> --repo=<repo> --branch=<branch> -s=<true/false> -e=<true/false>
Flags
--name
- Indicates the name of the application.
- Optional
- Default value :
reponame
- Shorthand :
n
--source
- Indicates the platform(GitHub/Azure devops) where your code located.
- required
--user
- Indicates the git user name.
- Optional
- Default : Taken from repo
--repo
- Indicates your GitHub repository.
- required
--branch
- Indicates the branch where your code is located.
- Optional
--setAppSetting
- If you set
setAppSetting
to 'true', you will be able to configure the following:- Port (default value : 8080)
- HTTP path (default value : /)
- App Instance size (default value : Default-2GB RAM|1vCPU)
- Vertical Auto-Scaling (default value : false)
- Number of Instances (default value : min-0 max-1)
- Optional
- Shorthand :
s
--setEnv
- Indicates the environment setting, If you set
setEnv
as 'true' you will be able to configure environments variable for the application. - Optional
- Shorthand : 'e'
Use command :
initz create app -f <app.json/app.yaml> --source github
Example template:
- JSON
- YAML
app.json{
"git_user": "pandey03muskan",
"git_repo": "pandey03muskan/GIT",
"git_branch": "main",
"application_name": "example01",
"azure_org": "",
"azure_org_id": "",
"azure_project": "",
"env_variables": {
"prod": [
{
"type": "secret_ref",
"value": "66fb8cf2843a040d0d90a736"
},
{
"key": "PORT",
"type": "env",
"value": "8080"
}
],
"stg": [
{
"type": "secret_ref",
"value": "66fb8cf2843a040d0d90a738"
},
{
"key": "PORT",
"type": "env",
"value": "8080"
}
],
"test": [
{
"type": "secret_ref",
"value": "66fb8cf2843a040d0d90a737"
},
{
"key": "PORT",
"type": "env",
"value": "8080"
}
]
},
"framework": {
"type": "static",
"name": "index.html",
"out_dir": "",
"build_tool": ""
},
"http_path": "/",
"instance_details": {
"instance_type": "Default",
"vertical_auto_scale": false,
"max": 1,
"min": 0
},
"port": 8080,
"source_code_path": "",
"src_code_provider": "",
"workspace_id": "6694abc5ba97a06326052941"
}app.yamlgituser: pandey03muskan
gitrepo: pandey03muskan/GIT
gitbranch: main
applicationname: example01
azureorg: ""
azureorgid: ""
azureproject: ""
env_variables:
prod:
- type: secret_ref
value: 66fb8cf2843a040d0d90a736
- key: PORT
type: env
value: "8080"
stg:
- type: secret_ref
value: 66fb8cf2843a040d0d90a738
- key: PORT
type: env
value: "8080"
test:
- type: secret_ref
value: 66fb8cf2843a040d0d90a737
- key: PORT
type: env
value: "8080"
framework:
type: static
name: index.html
outdir: ""
buildtool: ""
httppath: /
instancedetails:
instancetype: Default
verticalautoscale: false
max: 1
min: 0
port: 8080
sourcecodepath: ""
srccodeprovider: ""
workspaceid: 6694abc5ba97a06326052941importantThere are two types of environment variables:
- Variables requiring three fields (env, secret):
- type
- key
- value
- Variables requiring two fields (secret_ref):
- type
- secret ID
Ensure that when adding secret_ref, only the two fields,type
andsecret ID
, are included.
You can either use the configuration provided in the file above to create the application or generate your own example configuration to do so.
Generate Configuration:
- JSON
- YAML
app.jsoninitz create app --name=< appname > --source=github --user=< user > --repo=< repo > --branch=< branch > --setAppSetting=< true/false > --setEnv=< true/false > -t json
app.yamlinitz create app --name=< appname > --source=github --user=< user > --repo=< repo > --branch=< branch > --setAppSetting=< true/false > --setEnv=< true/false > -t yaml
-
Create App using Azure Devops
- Using argument
- Using file
initz create app --name=<appname> --source=azure --azure_org=<azure-org-name> --azure_project=<azure-project-name> --repo=<repo> --branch=<branch> --setAppSetting=<true/false> --setEnv=<true/false>
Flags
--name
- Indicates the name of the application.
- Optional
- Default value :
azure_project name
- Shorthand :
n
--source
- Indicates the platform(GitHub/Azure devops) where your code located.
- Possible values :
azure/github
- required
--azure_org
- Indicates the organization in which your project located in the azure devops platform.
- required
--azure_project
- Indicates the Project in the organization in which your code located.
- required
--branch
- Indicates the branch where your code is located.
- Optional
- Default :
main
--setAppSetting
- If you set
setAppSetting
to 'true', you will be able to configure the following:- Port (default value : 8080)
- HTTP path (default value : /)
- App Instance size (default value : Default-2GB RAM|1vCPU)
- Vertical Auto-Scaling (default value : false)
- Number of Instances (default value : min-0 max-1)
- Optional
- Shorthand :
s
--setEnv
- If you set
setEnv
as 'true' you will be able to configure environments variable for the application. - Optional
- Shorthand : 'e'
app --file=<app.json/app.yaml> --source=azure
Example template :
- JSON
- YAML
app.json{
"git_user": "e9f11f90-3509-6614-884e-7c62b0301374",
"git_repo": "pro-2",
"git_branch": "main",
"application_name": "example01",
"azure_org": "Test9813",
"azure_org_id": "ac220d8d-148c-4e99-b8ef-7f0a464e3d10",
"azure_project": "pro-2",
"env_variables": {
"prod": [
{
"type": "secret_ref",
"value": "66fb8cf2843a040d0d90a736"
},
{
"key": "PORT",
"type": "env",
"value": "8080"
}
],
"stg": [
{
"type": "secret_ref",
"value": "66fb8cf2843a040d0d90a738"
},
{
"key": "PORT",
"type": "env",
"value": "8080"
}
],
"test": [
{
"type": "secret_ref",
"value": "66fb8cf2843a040d0d90a737"
},
{
"key": "PORT",
"type": "env",
"value": "8080"
}
]
},
"framework": {
"type": "python",
"name": "Python",
"out_dir": "",
"build_tool": "pip"
},
"http_path": "/",
"instance_details": {
"instance_type": "Default",
"vertical_auto_scale": false,
"max": 1,
"min": 0
},
"port": 8080,
"source_code_path": "",
"src_code_provider": "azure",
"workspace_id": "6694abc5ba97a06326052941"
}app.yamlgituser: e9f11f90-3509-6614-884e-7c62b0301374
gitrepo: pro-2
gitbranch: main
applicationname: example01
azureorg: Test9813
azureorgid: ac220d8d-148c-4e99-b8ef-7f0a464e3d10
azureproject: pro-2
env_variables:
prod:
- type: secret_ref
value: 66fb8cf2843a040d0d90a736
- key: PORT
type: env
value: "8080"
stg:
- type: secret_ref
value: 66fb8cf2843a040d0d90a738
- key: PORT
type: env
value: "8080"
test:
- type: secret_ref
value: 66fb8cf2843a040d0d90a737
- key: PORT
type: env
value: "8080"
framework:
type: python
name: Python
outdir: ""
buildtool: pip
httppath: /
instancedetails:
instancetype: Default
verticalautoscale: false
max: 1
min: 0
port: 8080
sourcecodepath: ""
srccodeprovider: azure
workspaceid: 6694abc5ba97a06326052941You can either use the configuration provided in the file above to create the application or generate your own example configuration to do so.
Generate Configuration :
- JSON
- YAML
app.jsoninitz create app --name=example01 --source=azure --azure_org=<azure-org> --azure_project=<azure-project> --repo=<repo> --branch=<branch> --setAppSetting=<true/false> --setEnv=<true/false> -t json
app.yamlinitz create app --name=example01 --source=azure --azure_org=<azure-org> --azure_project=<azure-project> --repo=<repo> --branch=<branch> --setAppSetting=<true/false> --setEnv=<true/false> -t yaml
If you encounter an error like We don't have access to the given Git Repo. Please check or configure your permission in the GitHub App, it means the repository you are using for deployment is not accessible. To grant the necessary permissions, you need to install Initz on your GitHub account. Refer command for the installation.
initz install git
-
Stage Approval (Test approval/Prod approval)
initz set approverequest --appid <appid>
To create an "App" in a workspace other than the current one, you need to include an additional flag --workspaceid=< workspaceID >
or you can set that particular workspace, Use command :
-
To add workspaceid=< workspaceID > :
initz create app --name=<name> --source=<github/azure> --user=<user> --repo=<repo> --branch=<branch> --port=<port> --workspaceid=<workspaceID>
-
To set the organization :
initz set workspace --workspaceid=<workspaceID>