Posts

Showing posts with the label vsts

Git clone

Moving repository between TFS servers was very challenging task. It was possible but very complicated and almost every time I've seen it done in companies it ended up in history and branching lost. Recently I was planning moving git repository between VSTS accounts. Normal situation project starts as POC and ends up as always working solution. In git there is no problem at all to move repository with all the history and branches in 3 lines. And that's really it. And the fun part is that it's fast because we don't pull all the code but only object definitions. Update: The mirror can be maintained in sync thanks to command: git remote update and again git push --mirror https://yourNewAddress.visualstudio.com/defaultCollection/_git/newProjectName

Creating code first database delopyment - Migrate.exe and VSTS

Image
Creating database deployment. My case is EF 6 (in core there would be also possibility to create sql script great article here ) It should be so simple. As a developer you just go to Package Management Console and run Update-Database. Everything is just happening. Well not that everything. You have to set default project to project that should be use to find your code first migrations.  You have to set startup project to one that contains config file with database connection string.  And you have to have valid connection string If you don't have the startup project set right you get 'enigmatic' exception, that I will address later. System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, ...

Set output variable in a Powershell VSTS Build Task

Image
I have value in my artifact files. I set it in  this post . So now I can use it. I will get it almost the same way - using powershell.

VSTS build variable publish as artifact

Image
Powershell is a powerful tool. It's easy to create file in the fly, read from file, call some API. It's easy and flexible. I decided that I want to use all those tree operations in one of my VSTS pipelines. The scenario is: - take variable filled while build queuing - write it's value to text file that will be available as artifact - use artifact file value (read the file) - set Release variable with file content - use release variable for API call (or any other use).

Azure Tomcat 7. Release

Image
Release the Kraken! Finally that I have ready infrastructure and I've shown the internals through Ftp, I can make the release. Release definition you can find here . This is very simple definition because it contains only one task -> copy WAR file to Azure using Ftp.

Azure and Java. The build

Image
Backstory I already told so now some pure devops. The Java Hello World. I found first site that was simple index page with greetings. I forked it and added my own text just to be sure that's the page I'm looking for. You can get the repository here . Creating build definition is very simple because it's almost whole template. The only thing I change is removing restriction on published files types. I want to use .war not .jar in future release definition. Ready definition you can get here , or create it like shown below. Additionally I also created Hello World Asp MVC application and build for it. I will use it as side by side solution to show more options. Repo and build definition .

Unit Tests and VSTS. How to configure team services build with different testing frameworks.

Image
Configuring build just to check if code is compiling - it's boring and obvious, just create build, choose repository and add build solution task. That's it. This kind of build is useful for checking code integrity eg. after automatic merge. But it's much better to have also unit tests and run them, you can be more or less sure that when tests are green then the merge didn't broke anything vital.

First build with Vsts and GitHub

Image
I'm going to create simple build with different test frameworks the repository is already available on my GitHub . So Vsts will contain build definition and GitHub contains the code. I need to make a connection between them.

Visual Studio Team Services - VSTS in few word

GitHub is great. I have a GitHub account and I'm planning to share all source code for this blog on GitHub, especially that public repoes are free on GitHub. But I also have a Vsts account, well to be honest a few of them for different purposes, but in the end one is my main directory and others are just for fun, experiments or other strange stuff. Why I don't have all in GitHub? Vsts has no capacity restriction on it's content so I can have everything there, and the most important detail is that Vsts is free and it is private. No one not-invited can see my code collection, and not all code should be public. I also store file like old emails that felt right to be archived somewhere, or some documentation file related to very old projects like my master thesis (this really should not be seen by public anymore :D ). This is my private space for all my code at least since 2012.