Employer Apprenticeship Service | |
Build | |
Web | https://manage-apprenticeships.service.gov.uk/ |
Account API | |
Client |
- Install Visual Studio with these workloads:
- ASP.NET and web development
- Azure development
- .NET desktop development
- Install SQL Server Management Studio
- Install Azure Storage Explorer
- Install CosmosDB Emulator
- Administator Access
- Request a SAS connection to the certs blob storage from from Dev Ops
- Download DasIDPCert.pfx to the das-employerapprenticeshipsservice/src folder
- Open PowerShell as an administrator
- Run src\DevInstall.ps1
- DO NOT COMMIT THE UPDATED CERTIFICATE TO GIT
- Open Visual Studio as an administrator
- Open the solution
- Set the following as the startup project:
- SFA.DAS.EmployerAccounts.Web
- Running the solution will launch the site in your browser
Repeat these steps for:
- SFA.DAS.EAS.Employer_Account.Database
Note: If you have an existing database you may need to drop it first, to avoid the script aborting after an error on truncating data.
Steps:
- Right click on the db project in the solution explorer
- Click on publish menu item
- Click the edit button
- Select Local > ProjectsV13
- Add the project name in again as the Database name (i.e. SFA.DAS.EAS.Employer_Account.Database)
- Click publish
The configuration is loaded from azure table storage.
- Run the Azure Storage Emulator
- Clone the das-employer-config repository
- Clone the das-employer-config-updater repository
- Run the das-employer-config-updater console application and follow the instructions to import the config from the das-employer-config directory
The two repos above are private. If the links appear to be dead make sure you are logged into github with an account that has access to these (i.e. that you are part of the Skills Funding Agency Team organization).
- Create an Azure account and set up a table storage
- Create a table called Configuration and copy across these 4 rows from the employer config setup above changing the PartitionKey to "Development" from "LOCAL":
- SFA.DAS.EmployerApprenticeshipsService._1.0
- SFA.DAS.EmployerAccounts_1.0
- SFA.DAS.EmployerApprenticeshipsService.FeaturesV2_1.0
- SFA.DAS.EmployerApprenticeshipsService.MultiVariantTesting_1.0
- Create two new environment variables:
- ASPNETCORE_ENVIRONMENT set to Development
- APPSETTING_ConfigurationStorageConnectionString set to the connection string of the Azure table storage created above
Using "Action": "*"
can also be used to disable all actions on the controller.
SonarCloud analysis can be performed using a docker container which can be built from the included dockerfile. An example of the docker run command to analyse the code base can be found below.
For this docker container to be successfully created you will need:
- a user on SonarCloud.io with permission to run analysis
- a SonarQube.Analysis.xml file in the root of the git repository.
This file takes the format:
<SonarQubeAnalysisProperties xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sonarsource.com/msbuild/integration/2015/1">
<Property Name="sonar.host.url">https://sonarcloud.io</Property>
<Property Name="sonar.login">[Your SonarCloud user token]</Property>
</SonarQubeAnalysisProperties>
docker run [OPTIONS] IMAGE COMMAND
docker run --rm -v c:/projects/das-employerapprenticeshipsservice:c:/projects/das-employerapprenticeshipsservice -w c:/projects/das-employerapprenticeshipsservice 3d9151a444b2 powershell -F c:/projects/das-employerapprenticeshipsservice/analyse.ps1
Option | Description |
---|---|
--rm | Remove any existing containers for this image |
-v | Bind the current directory of the host to the given directory in the container ($PWD may be different on your platform). This should be the folder where the code to be analysed is |
-w | Set the working directory |
Execute the analyse.ps1 PowerShell script