Skip to content

Commit

Permalink
Update documentation for open source (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmbillie authored Oct 28, 2021
1 parent fc33545 commit 69ff227
Show file tree
Hide file tree
Showing 18 changed files with 69 additions and 287 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
time: "21:00"
timezone: "America/Detroit"
15 changes: 3 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Hot Potato CI
name: hot-potato-ci

on:
push
Expand Down Expand Up @@ -95,21 +95,12 @@ jobs:
# - name: Push Images
# #if: env.isMaster == 'true'
# env:
# TAG_SCHEME: docker.artifactory.onbase.net
# TAG_SCHEME: ghcr.io/hylandsoftware
# GITHUB_USR: testautomation_github
# run: |
# nuget sources Add -Name Artifactory -Source https://artifactory.onbase.net/artifactory/api/nuget/nuget/tato -username $GITHUB_USR -password ${{ secrets.TESTAUTOMATION_GITHUB }}

# nuget setapikey ${{ secrets.TESTAUTOMATION_GITHUB }} -Source Artifactory

# nuget push $GITHUB_WORKSPACE/src/HotPotato.AspNetCore.Host/**/*.nupkg -Source https://artifactory.onbase.net/artifactory/api/nuget/nuget/tato
# nuget push $GITHUB_WORKSPACE/src/HotPotato.AspNetCore.Middleware/**/*.nupkg -Source https://artifactory.onbase.net/artifactory/api/nuget/nuget/tato
# nuget push $GITHUB_WORKSPACE/src/HotPotato.Core/**/*.nupkg -Source https://artifactory.onbase.net/artifactory/api/nuget/nuget/tato
# nuget push $GITHUB_WORKSPACE/src/HotPotato.OpenApi/**/*.nupkg -Source https://artifactory.onbase.net/artifactory/api/nuget/nuget/tato

# docker login -u $GITHUB_USR -p ${{ secrets.TESTAUTOMATION_GITHUB }} $TAG_SCHEME

# docker build --tag $TAG_SCHEME/tato/hot-potato:${{ env.GitVersion_MajorMinorPatch }} --build-arg IMAGE_VERSION=${{ env.GitVersion_MajorMinorPatch }}
# docker build --tag $TAG_SCHEME/tato/hot-potato:${{ env.GitVersion_MajorMinorPatch }} --build-arg IMAGE_VERSION=${{ env.GitVersion_MajorMinorPatch }} --build-arg CERT_INSTALL=${{ secrets.CERT_INSTALL }}
# docker push $TAG_SCHEME/tato/hot-potato:${{ env.GitVersion_MajorMinorPatch }}
# docker tag $TAG_SCHEME/tato/hot-potato:${{ env.GitVersion_MajorMinorPatch }} $TAG_SCHEME/tato/hot-potato:latest
# docker push $TAG_SCHEME/tato/hot-potato:latest
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ To run tests locally against an external remote endpoint, you will need to provi

```diff
{
"RemoteEndpoint": "https://nvpub.vic-metria.nu/naturvardsregistret/v2/rest",
"RemoteEndpoint": "https://indikatorer-api.naturvardsverket.se/",
"HttpClientSettings": {
"IgnoreClientHttpsCertificateValidationErrors": "false"
},
"SpecLocation": "https://raw.githubusercontent.com/greentechdev/greentechdev.github.io/master/nvr_api.yaml",
"SpecLocation": "https://raw.githubusercontent.com/greentechdev/greentechdev.github.io/master/environmental_indicators_api.yaml",
"ForwardProxy": {
"Enabled": "false",
"ProxyAddress": "http://localhost:8888",
Expand All @@ -62,22 +62,22 @@ To run tests locally against an external remote endpoint, you will need to provi
}
```

Once the API that needs to be tested is configured, you'll want to append the endpoints (e.g localhost:3232/omrade/skyddstyper) through something like Postman.
Once the API that needs to be tested is configured, you'll want to append the endpoints (e.g localhost:3232/omrade/api/v1/indicators/) through something like Postman.

Noted: As with any sort of Hot Potato testing, you'll be replacing the host name with localhost:3232.

To run these tests locally through a Docker container, you can do a Docker build from within the root folder of your Hot Potato solution, while passing passing in an arbitrary number for IMAGE_VERSION, like so:

```sh
docker build --tag hcr.io/automated-testing/hot-potato:4.9 --build-arg IMAGE_VERSION=4.9 .
docker build --tag hot-potato:4.8 --build-arg IMAGE_VERSION=4.8 .
```

Now to test, you may pass the API's REMOTE_ENDPOINT and SPEC_LOCATION through the command line. Connecting Docker with your localhost requires some nontrivial network setup, so we recommend using an external API, like so:

```sh
docker run --rm -d --network hp --name Conformance -p 3232:3232 -e HttpClientSettings__IgnoreClientHttpsCertificateValidationErrors=true -e
REMOTE_ENDPOINT=https://nvpub.vic-metria.nu/naturvardsregistret/v2/rest -e
SPEC_LOCATION=https://raw.githubusercontent.com/greentechdev/greentechdev.github.io/master/nvr_api.yaml hcr.io/automated-testing/hot-potato:4.9
docker network create hp

docker run --rm -d --network hp --name Conformance -p 3232:3232 -e HttpClientSettings__IgnoreClientHttpsCertificateValidationErrors=true -e REMOTE_ENDPOINT=https://indikatorer-api.naturvardsverket.se/ -e SPEC_LOCATION=https://raw.githubusercontent.com/greentechdev/greentechdev.github.io/master/environmental_indicators_api.yaml hot-potato:4.8
```

## Pull requests
Expand Down
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
LABEL cache=true
ARG VERSION
ARG IMAGE_VERSION
ARG CERT_INSTALL

RUN apt-get update && apt-get install -y curl sudo
RUN curl -fksSL https://certs.hyland.io/install.sh | sudo bash
RUN curl -fksSL ${CERT_INSTALL} | sudo bash
RUN update-ca-certificates

WORKDIR /app
COPY . .

RUN dotnet build -c Docker -p:Version=${VERSION}
RUN dotnet build -c Docker -p:Version=${IMAGE_VERSION}
RUN dotnet publish -c Docker --framework=net5.0 --output /app/publish

FROM mcr.microsoft.com/dotnet/aspnet:5.0 as runtime

LABEL maintainer "Test Automation Team <[email protected]>"

ENV SPEC_LOCATION "https://bitbucket.hyland.com/projects/TATO/repos/hot-potato/raw/test/RawPotatoSpec.yaml"
ENV SPEC_LOCATION "https://raw.githubusercontent.com/HylandSoftware/Hot-Potato/master/test/RawPotatoSpec.yaml"
ENV REMOTE_ENDPOINT "http://localhost:9000"

COPY --from=build /app/publish /opt/hotpotato/
Expand Down
138 changes: 0 additions & 138 deletions Jenkinsfile

This file was deleted.

Loading

0 comments on commit 69ff227

Please sign in to comment.