From f97b04ebb603392956d24ba3deafa452b164adc5 Mon Sep 17 00:00:00 2001
From: s426226
Date: Thu, 3 Dec 2020 13:24:47 +0100
Subject: [PATCH] Add jenkinsfile
---
.Jenkinsfile | 19 ++++++++
Serwer/Serwer.sln | 25 ++++++++++
Serwer/Serwer/Controllers/ValuesController.cs | 45 +++++++++++++++++
Serwer/Serwer/Program.cs | 24 ++++++++++
Serwer/Serwer/Properties/launchSettings.json | 30 ++++++++++++
Serwer/Serwer/Serwer.csproj | 13 +++++
Serwer/Serwer/Startup.cs | 48 +++++++++++++++++++
Serwer/Serwer/appsettings.Development.json | 9 ++++
Serwer/Serwer/appsettings.json | 8 ++++
9 files changed, 221 insertions(+)
create mode 100644 .Jenkinsfile
create mode 100644 Serwer/Serwer.sln
create mode 100644 Serwer/Serwer/Controllers/ValuesController.cs
create mode 100644 Serwer/Serwer/Program.cs
create mode 100644 Serwer/Serwer/Properties/launchSettings.json
create mode 100644 Serwer/Serwer/Serwer.csproj
create mode 100644 Serwer/Serwer/Startup.cs
create mode 100644 Serwer/Serwer/appsettings.Development.json
create mode 100644 Serwer/Serwer/appsettings.json
diff --git a/.Jenkinsfile b/.Jenkinsfile
new file mode 100644
index 0000000..ce65df0
--- /dev/null
+++ b/.Jenkinsfile
@@ -0,0 +1,19 @@
+pipeline {
+ stages {
+ stage('Restore') {
+ dir('Serwer') {
+ bat "dotnet restore"
+ }
+ }
+ stage('Clean') {
+ dir('Serwer') {
+ bat "dotnet clean"
+ }
+ }
+ stage('Build') {
+ dir('Serwer') {
+ bat "dotnet build --configuration Relase"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Serwer/Serwer.sln b/Serwer/Serwer.sln
new file mode 100644
index 0000000..4400ae7
--- /dev/null
+++ b/Serwer/Serwer.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.28307.852
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serwer", "Serwer\Serwer.csproj", "{CCE1E4CC-EC14-46A3-BCC9-2CBD8F2284D6}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {CCE1E4CC-EC14-46A3-BCC9-2CBD8F2284D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CCE1E4CC-EC14-46A3-BCC9-2CBD8F2284D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CCE1E4CC-EC14-46A3-BCC9-2CBD8F2284D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CCE1E4CC-EC14-46A3-BCC9-2CBD8F2284D6}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {30A333CB-6AC2-4EAD-B05B-926DB9690CED}
+ EndGlobalSection
+EndGlobal
diff --git a/Serwer/Serwer/Controllers/ValuesController.cs b/Serwer/Serwer/Controllers/ValuesController.cs
new file mode 100644
index 0000000..791bddd
--- /dev/null
+++ b/Serwer/Serwer/Controllers/ValuesController.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Serwer.Controllers
+{
+ [Route("api/[controller]")]
+ [ApiController]
+ public class ValuesController : ControllerBase
+ {
+ // GET api/values
+ [HttpGet]
+ public ActionResult> Get()
+ {
+ return new string[] { "value1", "value2" };
+ }
+
+ // GET api/values/5
+ [HttpGet("{id}")]
+ public ActionResult Get(int id)
+ {
+ return "value";
+ }
+
+ // POST api/values
+ [HttpPost]
+ public void Post([FromBody] string value)
+ {
+ }
+
+ // PUT api/values/5
+ [HttpPut("{id}")]
+ public void Put(int id, [FromBody] string value)
+ {
+ }
+
+ // DELETE api/values/5
+ [HttpDelete("{id}")]
+ public void Delete(int id)
+ {
+ }
+ }
+}
diff --git a/Serwer/Serwer/Program.cs b/Serwer/Serwer/Program.cs
new file mode 100644
index 0000000..f06d759
--- /dev/null
+++ b/Serwer/Serwer/Program.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Logging;
+
+namespace Serwer
+{
+ public class Program
+ {
+ public static void Main(string[] args)
+ {
+ CreateWebHostBuilder(args).Build().Run();
+ }
+
+ public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
+ WebHost.CreateDefaultBuilder(args)
+ .UseStartup();
+ }
+}
diff --git a/Serwer/Serwer/Properties/launchSettings.json b/Serwer/Serwer/Properties/launchSettings.json
new file mode 100644
index 0000000..5057e92
--- /dev/null
+++ b/Serwer/Serwer/Properties/launchSettings.json
@@ -0,0 +1,30 @@
+{
+ "$schema": "http://json.schemastore.org/launchsettings.json",
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:50287",
+ "sslPort": 44305
+ }
+ },
+ "profiles": {
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": true,
+ "launchUrl": "api/values",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "Serwer": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "launchUrl": "api/values",
+ "applicationUrl": "https://localhost:5001;http://localhost:5000",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Serwer/Serwer/Serwer.csproj b/Serwer/Serwer/Serwer.csproj
new file mode 100644
index 0000000..423afac
--- /dev/null
+++ b/Serwer/Serwer/Serwer.csproj
@@ -0,0 +1,13 @@
+
+
+
+ netcoreapp2.2
+ InProcess
+
+
+
+
+
+
+
+
diff --git a/Serwer/Serwer/Startup.cs b/Serwer/Serwer/Startup.cs
new file mode 100644
index 0000000..8ea9de4
--- /dev/null
+++ b/Serwer/Serwer/Startup.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.HttpsPolicy;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+
+namespace Serwer
+{
+ public class Startup
+ {
+ public Startup(IConfiguration configuration)
+ {
+ Configuration = configuration;
+ }
+
+ public IConfiguration Configuration { get; }
+
+ // This method gets called by the runtime. Use this method to add services to the container.
+ public void ConfigureServices(IServiceCollection services)
+ {
+ services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
+ }
+
+ // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
+ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
+ {
+ if (env.IsDevelopment())
+ {
+ app.UseDeveloperExceptionPage();
+ }
+ else
+ {
+ // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
+ app.UseHsts();
+ }
+
+ app.UseHttpsRedirection();
+ app.UseMvc();
+ }
+ }
+}
diff --git a/Serwer/Serwer/appsettings.Development.json b/Serwer/Serwer/appsettings.Development.json
new file mode 100644
index 0000000..e203e94
--- /dev/null
+++ b/Serwer/Serwer/appsettings.Development.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Debug",
+ "System": "Information",
+ "Microsoft": "Information"
+ }
+ }
+}
diff --git a/Serwer/Serwer/appsettings.json b/Serwer/Serwer/appsettings.json
new file mode 100644
index 0000000..def9159
--- /dev/null
+++ b/Serwer/Serwer/appsettings.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Warning"
+ }
+ },
+ "AllowedHosts": "*"
+}