-
Notifications
You must be signed in to change notification settings - Fork 1
Jasper 342 (P-Drive) #733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
devinleighsmith
wants to merge
5
commits into
master
Choose a base branch
from
jasper-342
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Jasper 342 (P-Drive) #733
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4825768
transitory documents - move common models and core to own projects.
devinleighsmith f0d2bf2
p/q drive transitory document microservice to handle SMB communication.
devinleighsmith b1d1396
add sha values to transitory documents GHAs.
devinleighsmith 16ec00b
Add enhanced errors to better display validation failures.
devinleighsmith 243ce8a
Add support for virtual bail and DCC location.
devinleighsmith File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Remove the line below if you want to inherit .editorconfig settings from higher directories | ||
| root = true | ||
|
|
||
| # C# files | ||
| [*.cs] | ||
|
|
||
| #### Core EditorConfig Options #### | ||
|
|
||
| # Indentation and spacing | ||
| indent_size = 4 | ||
| indent_style = space | ||
| tab_width = 4 | ||
|
|
||
| # New line preferences | ||
| end_of_line = lf | ||
| insert_final_newline = false |
36 changes: 36 additions & 0 deletions
36
.github/workflows/actions/build-transitory-documents-api/action.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Build transitory-documents-api | ||
| description: Builds the transitory-documents-api codebase | ||
|
|
||
| inputs: | ||
| working_directory: | ||
| description: The working directory where the code will be built. | ||
| required: true | ||
| dotnet_version: | ||
| description: The .NET version that will be used. | ||
| required: true | ||
|
|
||
| runs: | ||
| using: composite | ||
|
|
||
| steps: | ||
| - name: Setup .NET Core | ||
| uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4 | ||
| with: | ||
| dotnet-version: ${{ inputs.dotnet_version }} | ||
|
|
||
| - run: dotnet format --verify-no-changes --severity info | ||
| shell: bash | ||
| working-directory: ${{ inputs.working_directory }}/transitory-documents-api | ||
| continue-on-error: true | ||
|
|
||
| - run: dotnet restore | ||
| shell: bash | ||
| working-directory: ${{ inputs.working_directory }} | ||
|
|
||
| - run: dotnet build --configuration Release --no-restore | ||
| shell: bash | ||
| working-directory: ${{ inputs.working_directory }}/transitory-documents-api | ||
|
|
||
| - run: dotnet test --no-restore --verbosity normal | ||
| shell: bash | ||
| working-directory: ${{ inputs.working_directory }}/tests |
35 changes: 35 additions & 0 deletions
35
.github/workflows/build-and-test-transitory-documents-api.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Build and Test transitory documents api | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| paths: | ||
| - 'transitory-documents-api/**' | ||
|
|
||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| WORKING_DIRECTORY: . | ||
|
|
||
| jobs: | ||
| build-and-test: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| strategy: | ||
| matrix: | ||
| dotnet-major-version: [9] | ||
| dotnet-minor-version: [0] | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | ||
|
|
||
| - name: Building transitory documents codebase | ||
| uses: ./.github/workflows/actions/build-transitory-documents-api | ||
| with: | ||
| working_directory: ${{ env.WORKING_DIRECTORY }} | ||
| dotnet_version: ${{ matrix.dotnet-major-version }}.${{ matrix.dotnet-minor-version }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| name: Deploy transitory-documents-api | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| paths: | ||
| - 'transitory-documents-api/**' | ||
|
|
||
| workflow_dispatch: | ||
| inputs: | ||
| gitops-branch: | ||
| description: GitOps repository branch to update | ||
| required: false | ||
| default: main | ||
| gitops-environment: | ||
| description: GitOps environment (dev, test, prod) | ||
| required: false | ||
| default: dev | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| env: | ||
| WORKING_DIRECTORY: . | ||
| IMAGE_NAME: jasper-transitory-documents-api | ||
| GITHUB_IMAGE_REPO: ghcr.io/${{ github.repository_owner }}/jasper | ||
| GITOPS_REPOSITORY: bcgov-c/tenant-gitops-e4161f | ||
| GITOPS_BRANCH: ${{ github.event.inputs.gitops-branch || 'master' }} | ||
| GITOPS_ENVIRONMENT: ${{ github.event.inputs.gitops-environment || 'dev' }} | ||
| GITOPS_FILE_PATH: deploy/transitory-documents-api/${{ github.event.inputs.gitops-environment || 'dev' }}_values.yaml | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build, Create and Push Image | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| short_sha: ${{ steps.short_sha.outputs.SHORT_SHA }} | ||
|
|
||
| strategy: | ||
| matrix: | ||
| dotnet-major-version: [9] | ||
| dotnet-minor-version: [0] | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | ||
|
|
||
| - name: Build API codebase | ||
| uses: ./.github/workflows/actions/build-transitory-documents-api | ||
| with: | ||
| working_directory: ${{ env.WORKING_DIRECTORY }} | ||
| dotnet_version: ${{ matrix.dotnet-major-version }}.${{ matrix.dotnet-minor-version }} | ||
|
|
||
| - name: Log in to the GHCR | ||
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Get short SHA | ||
| id: short_sha | ||
| run: | | ||
| echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Setup Image Metadata | ||
| id: meta | ||
| uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5 | ||
| with: | ||
| images: | | ||
| ${{ env.GITHUB_IMAGE_REPO }}/${{ env.IMAGE_NAME }} | ||
| tags: | | ||
| type=raw,value=${{ steps.short_sha.outputs.SHORT_SHA }} | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | ||
|
|
||
| - name: Build and Push Image to ghcr.io | ||
| id: build_image | ||
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6 | ||
| with: | ||
| push: true | ||
| context: . | ||
| file: ./docker/transitory-documents-api/Dockerfile.release | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| load: true | ||
| build-args: | | ||
| dotnet_version=${{ matrix.dotnet-major-version }}.${{ matrix.dotnet-minor-version }} | ||
|
|
||
| - name: Checkout tenant gitops repository | ||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | ||
| with: | ||
| repository: ${{ env.GITOPS_REPOSITORY }} | ||
| ssh-key: ${{ secrets.TENANT_GITOPS_E4161F_DEPLOY_KEY }} | ||
| ref: ${{ env.GITOPS_BRANCH }} | ||
| path: tenant-gitops-e4161f | ||
|
|
||
| - name: Update transitory-documents-api dev image reference | ||
| uses: fjogeleit/yaml-update-action@451fb54614e46f952fc18ffd99e8c93b7b13f85e # v0.15.0 | ||
| with: | ||
| workDir: tenant-gitops-e4161f | ||
| valueFile: ${{ env.GITOPS_FILE_PATH }} | ||
| changes: | | ||
| { | ||
| "$['transitory-documents-api'].image.repository": "${{ env.GITHUB_IMAGE_REPO }}/${{ env.IMAGE_NAME }}", | ||
| "$['transitory-documents-api'].image.tag": "${{ steps.short_sha.outputs.SHORT_SHA }}" | ||
| } | ||
| commitChange: false | ||
|
|
||
| - name: Load SSH deploy key | ||
| uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0 | ||
| with: | ||
| ssh-private-key: ${{ secrets.TENANT_GITOPS_E4161F_DEPLOY_KEY }} | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. uses a deploy key for authorization. |
||
|
|
||
| - name: Commit and push gitops update | ||
| uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9 | ||
| with: | ||
| cwd: tenant-gitops-e4161f | ||
| add: ${{ env.GITOPS_FILE_PATH }} | ||
| message: Update transitory-documents-api dev image to ${{ steps.short_sha.outputs.SHORT_SHA }} | ||
| push: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update the image name and tag directly in the gitops repo using a file and json key path to target the repository and image tag.