Skip to content

Setup development environment

Rodel E. Dagumampan edited this page May 3, 2020 · 31 revisions

Welcome

Hi, I am Rodel Dagumampan, maintainer of yuniql and welcome to yuniql contributor page. I am hoping you will have a light and easy start and I'll try to support you in getting started.

If this is your first time to participate in an open source initiative, you may look at issues labeled as first timer friendly issues. If you found an interesting case, you can fork this repository, clone to your dev machine, create a local branch, and make Pull Requests (PR) so I can review and merge your changes. This page best describe the process https://github.com/firstcontributions/first-contributions/blob/master/README.md#tutorials-using-other-tools.

Solution Structure

Yuniql solution can be built from main solution file Yuniql.sln. When running platform tests, you need to set required environment variables first. The table describe the purpose of each directory.

Solution/Directory Description
Yuniql.sln The main solution to build Yuniql CLI with default support for SqlServer. The unit tests and extensibility interfaces for building plugins are here.
yuniql-extensibility Interfaces to implement to support a database platform. Yuniql.SqlServer, Yuniql.PostgreSql, and Yuniql.MySql all implements the interface.
yuniql-core Holds main execution engine for running database migrations.
yuniql-platforms Specific DB platform implementation are placed here. Each directory is compiled as nuget package.
yuniql-tests Contains unit tests and platform verification test projects.
yuniql-cli When built, produces the compatible yuniql.exe file or publishes .DLLs for Linux clients.
Solution/Directory Description
yuniql-aspnetcore Produces Yuniql.AspNetCore nuget package for use in .NET Core WebApp, WebApi and Worker projects.
yuniql-distribution Holds distribution of yuniql via Chocolatey or other distribution channels.
yuniql-azure-pipelines Products packages for Azure DevOps Marketplace.

Build the Solution

1. Install prerequisites

2. Fork this repository into your GitHub account

cd c:\temp
git clone {your-forked-repo-url-here}.git

3. Build the code

cd c:\temp\yuniql\yuniql-cli
dotnet build

4. Publish as an executable yuniql.exe

cd c:\temp\yuniql\yuniql-cli
dotnet publish -c release -r win-x64 /p:publishsinglefile=true /p:publishtrimmed=true

5. Run with CLI

Prepare your target database, here we use SqlServer on Docker

docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=P@ssw0rd!" -p 1400:1433 -d mcr.microsoft.com/mssql/server:2017-latest
SETX YUNIQL_CONNECTION_STRING "Server=localhost,1400;Database=helloyuniql;User Id=SA;Password=P@ssw0rd!"

Run migrations

cd C:\temp\yuniql\yuniql-cli\bin\release\netcoreapp3.0\win-x64\publish\

yuniql run -a -p "c:\temp\yuniql\samples\basic-sqlserver-sample"
yuniql info

Run Platform Tests

https://github.com/rdagumampan/yuniql/blob/master/yuniql-tests/platform-tests/README.md

Found bugs?

Help us improve further please create an issue.