-
Notifications
You must be signed in to change notification settings - Fork 0
Project CLI Commands
Roi Larrence Amatong edited this page Sep 1, 2021
·
13 revisions
This contains list of useful CLI commands that can be used on the project.
- dotnet new webapi -n name = Create new .NET project.
- dotnet add <PROJECT_DESTINATION> reference <PROJECT_SOURCE> = Add reference project to current project.
- dotnet watch run = Run dotnet project.
- dotnet ef migrations add <MIGRATION_NAME> -c <DB_CONTEXT_NAME> -s ..\ReserbizAPP.API = Specify specific db context if have multiple dbContext in the project.
- dotnet ef database update = Update db based on the latest migration.
- dotnet ef database update -c <DB_CONTEXT_NAME> -s <MAIN_PROJECT> = database update for specific db context if has multiple context db on project.
- dotnet ef database update <MIGRATION_NAME> -c <DB_ONTEXT_NAME> -s <MAIN_PROJECT> = rollback db to a specific migration.
- dotnet ef migrations remove -c <DB_CONTEXT_NAME> = Remove latest migration. Specify specific db context if have multiple dbContext in the project.
- dotnet publish -o D:/Websites/RESERBIZ_WEB_API = publish command to specific path.
- dotnet test - Run test project.
- dotnet ef --version - check dotnet tool version.
- dotnet tool update --global dotnet-ef - Update dotnet tool version.
- dotnet run --environment "<Development | Production>" = Run project with specified environment.
- ns debug = Run the application on debug mode
- ns debug --compileSdk = Run the application on debug mode and on a specifici SDK Version.
- ns clean = Clean project application.
- ns build android --release --key-store-path --key-store-password --key-store-alias --key-store-alias-password = Build a release apk for the application.
- ns test = Run unit tests.
- ns run --env.production = Run application using production environment.
- ns build --env.production = Build the application using the production environment
- ng serve = Run the application.
- ng build --configuration production = build project file in prod mode.
- docker build -t <DOCKER_IMAGE_NAME> . = This generates a docker image based on the content Dockerfile. Specifying Docker image name is recommended.
- docker build -f <PATH_OF_THE_DOCKER_FILE> -t <DOCKER_IMAGE_NAME> . - This is a variety of docker build command that should be run on the solution file directory level so any external class library that are referenced the the project will be included.
- docker run -d -p <INTERNAL_EXPOSED_PORT>:<EXTERNAL_HOST_PORT> --name - This creates an instance of a container for the docker image specified.
- docker stop <DOCKER_CONTAINER_NAME> - Stops the container from running.
- docker cp 'local\file\path' <CONTAINER_NAME>:/file/path/inside/container = Copy file from host to container.
- docker <CONTAINER_NAME> rm -rf /file/path/inside/container = Removes specific file inside container.
- docker-compose --file <DOCKER_COMPOSE_FILE_PATH> up = Create and start containers from specific docker compose file.
- docker-compose stop = Stop and remove resources.
- docker-compose --help = List all available commands.
- docker system prune = performs a prune on containers, images and a few other less-storage-hungry components within Docker.
- Optimize-VHD -Path C:\Users\roi\AppData\Local\Docker\wsl\data\ext4.vhdx -Mode Full = Optimize virtual hard disk (ext4.vhdx) where docker files are stored.
All Rights Reserved. 2019
This is a custom sidebar