Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 096a98c

Browse files
v2 updates (#352)
* OH refresh V2 refactor (#349) Co-authored-by: Dariusz Porowski <[email protected]> * Fixing dotnet 2.1 call (#343) * Fixing dotnet 2.1 call * Correcting for polling of HTTP/2 sites * fixes (#350) Co-authored-by: Dariusz Porowski <[email protected]> * url fix (#351) Co-authored-by: Dariusz Porowski <[email protected]> Co-authored-by: Dariusz Porowski <[email protected]> Co-authored-by: Kit Skinner <[email protected]>
1 parent 0e433f4 commit 096a98c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+24340
-7850
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: "This repo contains the code for the provisioning of the resources
1010

1111
# DevOps OpenHack Proctor Repository
1212

13-
This repo contains the code for the provisioning of the resources necessary to execute a DevOps OpenHack event. The relevant code individual teams use (i.e. the APIs) to complete their challenges can be found in the [DevOps OpenHack Team repository](https://github.com/Azure-Samples/openhack-devops-team/).
13+
This repo contains the code for the provisioning of the resources necessary to execute a DevOps OpenHack event. The relevant code individual teams use (i.e. the APIs) to complete their challenges can be found in the [DevOps OpenHack Team repository](https://github.com/Azure-Samples/openhack-devops-team/).
1414

1515
## Components
1616

@@ -27,7 +27,8 @@ Go to the root of these folders to see a readme with deeper information on each
2727
### Prerequisites
2828

2929
* Bash Shell
30-
* Azure CLI
30+
* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
31+
* [sqlcmd & bcp](https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools)
3132
* An Azure Subscription
3233

3334
### High-Level Installation Flow

provision-team/deploy.sh

Lines changed: 156 additions & 122 deletions
Large diffs are not rendered by default.

provision-team/jenkins/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM jenkins/jenkins:2.229
1+
FROM jenkins/jenkins:lts
22

33
ARG JENKINS_USERNAME=demouser
44
ARG JENKINS_PASSWORD=demo@pass123
55

66
ENV JENKINS_USERNAME $JENKINS_USERNAME
77
ENV JENKINS_PASSWORD $JENKINS_PASSWORD
8-
ENV JAVA_OPTS -Djenkins.install.runSetupWizard=false
8+
ENV JAVA_OPTS="-Djenkins.install.runSetupWizard=false"
99

1010
RUN echo "Starting installation of Jenkins Plugins" \
1111
&& /usr/local/bin/install-plugins.sh \
@@ -17,3 +17,5 @@ RUN echo "Starting installation of Jenkins Plugins" \
1717
&& echo "Done"
1818

1919
COPY ./default-user.groovy /usr/share/jenkins/ref/init.groovy.d/
20+
21+
EXPOSE 8080
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1+
#!groovy
2+
13
import jenkins.model.*
24
import hudson.security.*
5+
import jenkins.security.s2m.AdminWhitelistRule
36

47
def env = System.getenv()
58

6-
def jenkins = Jenkins.getInstance()
7-
if(!(jenkins.getSecurityRealm() instanceof HudsonPrivateSecurityRealm))
8-
jenkins.setSecurityRealm(new HudsonPrivateSecurityRealm(false))
9+
def instance = Jenkins.getInstance()
910

10-
if(!(jenkins.getAuthorizationStrategy() instanceof GlobalMatrixAuthorizationStrategy))
11-
jenkins.setAuthorizationStrategy(new GlobalMatrixAuthorizationStrategy())
11+
def hudsonRealm = new HudsonPrivateSecurityRealm(false)
12+
hudsonRealm.createAccount(env.JENKINS_USERNAME, env.JENKINS_PASSWORD)
13+
instance.setSecurityRealm(hudsonRealm)
1214

13-
// create new Jenkins user account
14-
// username & password from environment variables
15-
def user = jenkins.getSecurityRealm().createAccount(env.JENKINS_USER, env.JENKINS_PASS)
16-
user.save()
17-
jenkins.getAuthorizationStrategy().add(Jenkins.ADMINISTER, env.JENKINS_USER)
15+
def strategy = new FullControlOnceLoggedInAuthorizationStrategy()
16+
instance.setAuthorizationStrategy(strategy)
17+
instance.save()
1818

19-
jenkins.save()
19+
Jenkins.instance.getInjector().getInstance(AdminWhitelistRule.class).setMasterKillSwitch(false)

resources/polling.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fi
4343

4444
healthcheck() {
4545
declare url=$1
46-
result=$(curl -i $url 2>/dev/null | grep HTTP/1.1)
46+
result=$(curl --http2 -i $url 2>/dev/null | grep "HTTP/[12][12\.]*")
4747
echo $result
4848
}
4949

simulator/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#Pull Base Image
2-
FROM microsoft/dotnet:2.1-runtime AS base
2+
FROM mcr.microsoft.com/dotnet/runtime:2.1-alpine AS base
33
WORKDIR /app
44
#Pull SDK Image to Build Solution
5-
FROM microsoft/dotnet:2.1-sdk AS build
5+
FROM mcr.microsoft.com/dotnet/sdk:2.1-alpine AS build
66
WORKDIR /src
77
COPY . .
88
RUN dotnet restore -nowarn:msb3202,nu1503

tripviewer/.dockerignore

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
1-
.dockerignore
2-
.env
3-
.git
4-
.gitignore
5-
.vs
6-
.vscode
7-
*/bin
8-
*/obj
9-
**/.toolstarget
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md

tripviewer/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM microsoft/dotnet:2.1-sdk AS build
1+
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine AS build
22
WORKDIR /src
33
COPY . .
44
RUN dotnet publish "web/TripViewer.csproj" -c Release -o /publish
55

6-
FROM microsoft/dotnet:2.1-aspnetcore-runtime
6+
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine
77
ENV USER_ROOT_URL="https://openhackuserprofile.azurewebsites.net"
88
ENV POI_ROOT_URL="https://openhackpoi.azurewebsites.net"
99
ENV TRIPS_ROOT_URL="https://openhacktrips.azurewebsites.net"
@@ -12,4 +12,4 @@ ENV BING_MAPS_KEY="changeme"
1212

1313
WORKDIR /app
1414
COPY --from=build /publish .
15-
ENTRYPOINT ["dotnet", "TripViewer.dll"]
15+
ENTRYPOINT ["dotnet", "TripViewer.dll"]

tripviewer/TripViewer.sln

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.28010.0
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30114.105
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TripViewer", "web\TripViewer.csproj", "{0E27500B-3E9B-437B-8FA4-238A77CC0A4E}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TripViewer", "web/TripViewer.csproj", "{49FBE870-AFE2-406E-8B4B-026182DF3BB9}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{0E27500B-3E9B-437B-8FA4-238A77CC0A4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{0E27500B-3E9B-437B-8FA4-238A77CC0A4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{0E27500B-3E9B-437B-8FA4-238A77CC0A4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{0E27500B-3E9B-437B-8FA4-238A77CC0A4E}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{49FBE870-AFE2-406E-8B4B-026182DF3BB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{49FBE870-AFE2-406E-8B4B-026182DF3BB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{49FBE870-AFE2-406E-8B4B-026182DF3BB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{49FBE870-AFE2-406E-8B4B-026182DF3BB9}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE
2121
EndGlobalSection
2222
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {616BB73D-5BC1-4E89-80DA-4839B84D9474}
23+
SolutionGuid = {FB2EF42E-DCDC-498A-9B16-83AE0B217D2A}
2424
EndGlobalSection
2525
EndGlobal

tripviewer/web/Controllers/HomeController.cs

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,35 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Diagnostics;
4-
using System.Linq;
5-
using System.Threading.Tasks;
6-
using Microsoft.AspNetCore.Mvc;
1+
using Microsoft.AspNetCore.Mvc;
72
using Microsoft.Extensions.Configuration;
8-
using Microsoft.Extensions.Options;
3+
using Microsoft.Extensions.Logging;
4+
using System.Diagnostics;
95
using TripViewer.Models;
106
using TripViewer.Utility;
117

128
namespace TripViewer.Controllers
139
{
1410
public class HomeController : Controller
1511
{
12+
private readonly ILogger<HomeController> _logger;
1613
private readonly IConfiguration Configuration;
1714

18-
public HomeController(IConfiguration configuration)
15+
public HomeController(ILogger<HomeController> logger, IConfiguration configuration)
1916
{
17+
_logger = logger;
2018
Configuration = configuration;
2119
}
20+
2221
public IActionResult Index()
2322
{
24-
TripViewerConfiguration tv = new TripViewerConfiguration();
25-
26-
tv.USER_ROOT_URL = Configuration.GetValue<string>("USER_ROOT_URL");
27-
tv.USER_JAVA_ROOT_URL = Configuration.GetValue<string>("USER_JAVA_ROOT_URL");
28-
tv.TRIPS_ROOT_URL = Configuration.GetValue<string>("TRIPS_ROOT_URL");
29-
tv.POI_ROOT_URL = Configuration.GetValue<string>("POI_ROOT_URL");
23+
TripViewerConfiguration tv = new TripViewerConfiguration
24+
{
25+
USER_ROOT_URL = Configuration.GetValue<string>("USER_ROOT_URL"),
26+
USER_JAVA_ROOT_URL = Configuration.GetValue<string>("USER_JAVA_ROOT_URL"),
27+
TRIPS_ROOT_URL = Configuration.GetValue<string>("TRIPS_ROOT_URL"),
28+
POI_ROOT_URL = Configuration.GetValue<string>("POI_ROOT_URL")
29+
};
3030
return View(tv);
3131
}
3232

33-
public IActionResult About()
34-
{
35-
ViewData["Message"] = "Your application description page.";
36-
37-
return View();
38-
}
39-
40-
public IActionResult Contact()
41-
{
42-
ViewData["Message"] = "Your contact page.";
43-
44-
return View();
45-
}
46-
4733
public IActionResult Privacy()
4834
{
4935
return View();

0 commit comments

Comments
 (0)