CLI Commands for AutoCode Solution Generator
Just after running the command, be sure it is the latest version and up-to-date.
*Version numbers are representational
1) Createβ
From scratchβ
./genesis create --path {full_or_relative_path_to_new_project}
genesis
command may not be in the system path, so you may need to use./genesis
instead ofgenesis
If the specified path does not exist, it will be created. If you donβt specify a path, it will be created on your current folder with the name of {YourSolutionName}
Some examples:
./genesis create ./
./genesis create --path ./MyUnicornProject
Using an existing configβ
If you've already ran create
command before, you have config.json
file/s in Configs
folder.
When you use that JSON file, you'll be skipping all the questions asked throughout generation process.
./genesis create --from-config {your_config_file_in_Configs_folder.json}
Sample config.json
:
{
"Path": "/PathSpecified/genesis-osx-x64-2019.12.22",
"TemplateType": 1,
"ApplicationName": "My_Application",
"MicroserviceNames": [
"Microservice1"
],
"BFFName": null,
"BFFPort": null,
"GenesisDatabaseType": 2,
"GenesisConnectionStringChoice": 2,
"UseGenesisDBIfExists": false,
"GenesisConnectionString": "User ID=postgres;Password=123456;Host=localhost;Port=5432;Database=GENESIS_DB_NAME;",
"DatabaseTypes": [
2
],
"ConnectionStringChoices": [
2
],
"Ports": [
5051
],
"ConnectionStrings": [
"User ID=postgres;Password=123456;Host=localhost;Port=5432;Database=YOUR_DB_NAME;"
],
"Tables": [
[
"public.SomeTable1",
"public.SomeTable2",
"public.SomeTable3",
"public.SomeTable4",
]
],
"UIChoice": 2,
"UIPort": 3000,
"IdentityPort": 5000,
"AdminSvcPort": 5050,
"NoBuild": false,
"Verbose": false
}
2) Upgradeβ
Upgrades to the latest versions of the frameworks and Nuget packages into specified existing project.
./genesis upgrade --path {full_or_relative_path_to_existing_solution}
You'll be asked:
Upgrade Choice
(1) - (Basic) Only update Nuget packages.
(2) - (Complex) Update & Merge whole solution(s).
3) Updateβ
We recommend making a [complex]
./genesis upgrade
first and then continue withupdate
.
a) Start by running the command:
./genesis update --path {full_or_relative_path_to_existing_solution}
b) Please select projects to proceed.
β― Microservice.TypeLib
β Microservice.DataLib
β― Microservice.API
β― IdentityServer
β― Admin.Type
β― Admin.Data
β― Admin.Svc
β― CoreData
β― CoreSvc
β― CoreType
β― Scheduler.Core
β― Scheduler.API
c) Choose between Code-First or Database-First approaches:
Please select action to proceed.
(1) - Migration (Code-first approach) - Database will be updated according model/context changes
(2) - Scaffold (Database-first approach) - This will create models by database tables
(3) - Skip
Don't worry! Even if you insist to override the project files, Solution Generator will compare the hash values of the old-new files and if there is a difference, the old one is going to be backed up first.
4) Versionβ
Check current version of AutoCode Solution Generator
./genesis --version
Note: To see available functions, run
./genesis create --help
Troubleshootingβ
If you get any error, that's probably you have an older version of the AutoCode Solution Generator working in your machine, causing mismatch between AutoCode Solution Generator and the latest project boilerplate.
So check and download AutoCode Solution Generator's current version.