Przejdź do głównej zawartości

dot net core i ciągłe wdrażanie aplikacji w VSTS

Dzisiaj opowiem o tym jak możemy skonfigurować ciągłe wdrożenie naszej aplikacji za pomocą Visual Studio Team Services.
Moim celem będzie automatyzacja procesu wdrożenia aby przebiegał on w następujący sposób:

1. Programista wykonuje zmianę w kodzie i wysyła swoje zmiany do repozytorium git
2. Serwer ciągłej integracji wykrywa zmianę w systemie git i wykonuje następujące czynności:
- pobranie projektu z gita
- zbudowanie projektu
- ewentualne uruchomienie testów jednostkowych, integracyjnych i systemowych
- przygotowanie projektu do umieszczenia na docelowym serwerze
- skopiowanie projektu na docelowy serwer.


Naszym celem jest ograniczenie pracy programisty do punktu pierwszego.
Cała reszta, tj. punkt 2 zostaje wykonana przez serwer ciągłej integracji.
Serwerem tym może być Jenkins, TeamCity, albo VSTS. O tym właśnie dzisiaj opowiemy.
Co należy zrobić aby go skonfigurować? Po pierwsze wejść tu: https://www.visualstudio.com/pl/
Na początku konfigurujemy projekt, dodajemy nowe repozytorium gita, a następnie definiujemy tak zwanego builda.
Build zasadniczo skłąda sie z kroków które dowolnie definiujemy.
Oto jak ja to zrobiłem dla projektu asp.net core MVC, który wdrażamy na linuxie(bo dzięki nowej wersji .NETa teraz my programiści .NET nie musimy już ograniczać się do Windowsa):

Finalny widok naszego builda:




Definicje poszczególnych kroków


1 - Pobranie projektu z gita




2 - instalacja bowera



3 - dodanie bowera do zmiennej środowiskowej $PATH



Zauważmy, że mimo iż wdrażamy aplikacje na serwerze z linuxem to samo budowanie projektu przebiega na środowisku Windows.

4 - wyświetlenie wersji bowera



Ten krok jest opcjonalny. Chcę jedynie pokazać możliwości jakie daje nam wiersz poleceń.

5 - pobranie pakietów wykorzystywanych przez projekt




6 - przygotowanie projektu do wdrożenia



7 - skopiowanie plików na serwer linux



8 - uruchomienie serwera Kestrel na maszynie z linuxem

Komentarze

  1. Na coś takiego czekałem! Świetny krok M$. Dzięki takiemu podejściu bede mógł wykorzystać swoje stare nawyki administracyjne związane właśnie z systemem Linux :-)

    OdpowiedzUsuń

Prześlij komentarz

Popularne posty z tego bloga

Connect to Azure from command line on Windows

When working with Azure we could go two ways: 1) using Azure portal and work in UI from your web browser 2) Connect to Azure from command line and run commands by typing in text in CMD. I already wrote about option 1 but today I'll show you how to start with option 2 which is Command line. First we need to download MSI installer from Microsoft website After sucessfull instalation you're ready to test az command. Open CMD and type in 'az' Now let's log in with your Azure credentials. Just type in "az login" in cmd. You should be redirected from command line to web browser and prompted for username and account in web browser. When you confirm your identity you'll be presented the screen like this in command line:

Learning e24cloud.com API

Today I'll show you how to use API in order to create virtual server in the cloud directly from your code. We're going write a script in PHP language and use Amazon SDK API to connect with e24cloud.com, which is the biggest and most modern hosting provider in Poland. First we need to install Amazon SDK http://docs.aws.amazon.com/aws-sdk-php/v3/guide/getting-started/installation.html One important note: We can use the latest version of amazon SDK but we also need to do one trick. We'll use signatureV2 instead ov Signaturev4 as e24cloud doesn't support SitnatureV4 yet. You can download it here: https://github.com/aws/aws-sdk-php-v3-bridge We need to download SDK and the bridge which allows us to use Signaturev2 to the same folder, so that require instruction work seamlessly in the form that I provided in the example below. Then go to your admin panel in e24cloud.com to find two values: a key and a secret. In the following code you need to paste those 2 values. ...

Up and running with Laravel

Today I'll show you how to start working with Laravel - a modern PHP framework. After reading this article you'll be able to: - Install XAMPP - Configure Virtual Hosts on Apache - Create your first application in Laravel - Run the application - Start coding As a first step I encourage you to visit Laravel.com to get some background knowledge about Laravel. Laravel is a PHP framework which is build on top of the MVC pattern (MVC stands for Model View Controller). You can find general explanation of MVC design pattern with some code examples written in Java here . I assume that you've already installed XAMPP which has version for Linux, Windows and OS X. Personally I'm using Windows in this tutorial but on each operating system it should work similarly. You can get the installer of XAMPP from this page: https://www.apachefriends.org/pl/index.html. When installer prompts you which options you want to install, you need to select Apache and you are free to...