Skip to content

Commit

Permalink
Merge pull request #253 from bcgov/dev
Browse files Browse the repository at this point in the history
Dev To Main Release 2023-12-19
  • Loading branch information
DarylTodosichuk authored Dec 19, 2023
2 parents fb85d99 + fd66ad5 commit 9a91b3a
Show file tree
Hide file tree
Showing 344 changed files with 146,200 additions and 155,338 deletions.
52 changes: 30 additions & 22 deletions .github/workflows/docker-build-dev.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,56 @@
name: Dev - Build & Push docker images

# This is a workflow that is either manually or PR merge to "dev" triggered
name: Dev - Build
on:
push:
branches: [ "dev" ]
paths-ignore:
- '.github/**'
- '.gitignore'
- 'applications/Unity.Metabase/**'
- 'database/**'
- 'documentation/**'
- 'openshift/**'
- 'COMPLIANCE.yaml'
- 'CONTRIBUTING.md'
- 'LICENSE'
- 'README.md'
- 'SECURITY..md'
# Allows manual triggering
- 'SECURITY.md'
# Allow manual workflow triggering
workflow_dispatch:

# Repository secrets OPENSHIFT_TOKEN_{DEV|TEST|PROD|TOOLS}
# Workflow dependencies are repository service connector and product version + commit buildId
env:
CLUSTER: https://api.silver.devops.gov.bc.ca:6443
AUTH_TOKEN: ${{ secrets.OPENSHIFT_TOKEN_DEV }}
TARGET_PROJECT: d18498
TARGET_ENV: dev

OPENSHIFT_CLUSTER: https://api.silver.devops.gov.bc.ca:6443
OPENSHIFT_AUTH_TOKEN: ${{secrets.OPENSHIFT_TOKEN_DEV}}
RELEASE_VERSION: ${{vars.VERSION_MAJOR}}.${{vars.VERSION_MINOR}}.${{vars.VERSION_PATCH}}
jobs:

build:
# This workflow contains a job called "Build" with steps to set buildArgs, build and push images to container registry
Build:
runs-on: ubuntu-latest
outputs:
PROJECT: ${{steps.project.outputs.TARGET_PROJECT}}
steps:
- uses: actions/checkout@v3
- name: Build application Docker images
- name: Get BuildId
id: commit
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set buildArgs
run: |
echo "buildArgs UNITY_BUILD_VERSION: ${{env.RELEASE_VERSION}}, UNITY_BUILD_REVISION: ${{steps.commit.outputs.sha_short}}"
- name: Build Docker images
run: |
rm -f ./docker-compose.override.yml
docker compose build
docker compose build --build-arg UNITY_BUILD_VERSION=${{env.RELEASE_VERSION}} --build-arg UNITY_BUILD_REVISION=${{steps.commit.outputs.sha_short}}
working-directory: ./applications/Unity.GrantManager
- name: Connect to OpenShift API
id: project
run: |
oc login --token=$AUTH_TOKEN --server=$CLUSTER
oc project $TARGET_PROJECT-$TARGET_ENV
oc login --token=${{env.OPENSHIFT_AUTH_TOKEN}} --server=${{env.OPENSHIFT_CLUSTER}}
echo "PROJECT=$(oc project | grep -oE '[0-9a-z]*-[dev\|test\|prod\|tools]*')" >> $GITHUB_OUTPUT
oc registry login
- name: Push application images to OpenShift container registry
- name: Push build images to container registry
run: |
docker tag unity-grantmanager-web image-registry.apps.silver.devops.gov.bc.ca/$TARGET_PROJECT-$TARGET_ENV/unity-grantmanager-web:github-latest
docker tag unity-grantmanager-dbmigrator image-registry.apps.silver.devops.gov.bc.ca/$TARGET_PROJECT-$TARGET_ENV/unity-grantmanager-dbmigrator:github-latest
# docker push image-registry.apps.silver.devops.gov.bc.ca/$TARGET_PROJECT-$TARGET_ENV/unity-grantmanager-web:github-latest
# docker push image-registry.apps.silver.devops.gov.bc.ca/$TARGET_PROJECT-$TARGET_ENV/unity-grantmanager-dbmigrator:github-latest
echo project = ${{steps.project.outputs.PROJECT}}
docker tag unity-grantmanager-web image-registry.apps.silver.devops.gov.bc.ca/${{steps.project.outputs.PROJECT}}/unity-grantmanager-web:github-latest
docker tag unity-grantmanager-dbmigrator image-registry.apps.silver.devops.gov.bc.ca/${{steps.project.outputs.PROJECT}}/unity-grantmanager-dbmigrator:github-latest
# docker push image-registry.apps.silver.devops.gov.bc.ca/${{steps.project.outputs.PROJECT}}/unity-grantmanager-web:github-latest
# docker push image-registry.apps.silver.devops.gov.bc.ca/${{steps.project.outputs.PROJECT}}/unity-grantmanager-dbmigrator:github-latest
63 changes: 41 additions & 22 deletions .github/workflows/docker-build-test.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,45 @@
name: Test - Build & Push docker images

# This is a workflow that is PR merge to "main" triggered
name: Test - Tag and Build
on:
push:
branches: [ "main" ]
paths-ignore:
- '.github/**'
- '.gitignore'
- 'applications/Unity.Metabase/**'
- 'database/**'
- 'documentation/**'
- 'openshift/**'
- 'COMPLIANCE.yaml'
- 'CONTRIBUTING.md'
- 'LICENSE'
- 'README.md'
- 'SECURITY..md'

# Repository variables VERSION_MAJOR_MINOR 0.1 VERSION_MESSAGE Dev to Test - VERSION_PREFIX v
- 'SECURITY.md'

# Repository secrets GH_API_TOKEN {GitHub PAT} OPENSHIFT_TOKEN_{DEV|TEST|PROD|TOOLS}
# Repository variables VERSION_PREFIX {text} VERSION_MAJOR 0 VERSION_MINOR 1 VERSION_PATCH 1 VERSION_MESSAGE {Dev to Test}
env:
GITHUB_TOKEN: ${{secrets.GH_API_TOKEN}}
OPENSHIFT_CLUSTER: https://api.silver.devops.gov.bc.ca:6443
OPENSHIFT_AUTH_TOKEN: ${{secrets.OPENSHIFT_TOKEN_TEST}}
RELEASE_PREFIX: ${{vars.VERSION_PREFIX}}
RELEASE_VERSION: ${{vars.VERSION_MAJOR_MINOR}}
RELEASE_VERSION: ${{vars.VERSION_MAJOR}}.${{vars.VERSION_MINOR}}
RELEASE_MESSAGE: ${{vars.VERSION_MESSAGE}}

RELEASE_PATCH: ${{vars.VERSION_PATCH}}
jobs:
# This workflow contains a jobs called "GenerateTag" "PushTag" "Build" "PushAlert"
# This workflow contains jobs called "GenerateTag" "PushTag" "Build"
GenerateTag:
runs-on: ubuntu-latest
outputs:
TAGNAME: ${{steps.nexttag.outputs.gittag}}
IMAGETAG: ${{steps.nexttag.outputs.imagetag}}
TAGMESSAGE: ${{steps.nexttag.outputs.tagmsg}}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Get current date
id: date
id: date-selector
run: echo "date=$(date +'%B %e, %Y')" >> $GITHUB_OUTPUT
- name: Generate Next Git Tag
id: nexttag
id: tag-selector
run: |
VERSION_PATCH=$(git tag --list "${{env.RELEASE_PREFIX}}${{env.RELEASE_VERSION}}.*" --sort=-version:refname | head -n 1 | grep -oE '[0-9]+$')
if [ -z "$VERSION_PATCH" ]; then
Expand All @@ -50,17 +48,22 @@ jobs:
VERSION_PATCH=$((VERSION_PATCH + 1))
fi
echo "gittag=${{env.RELEASE_PREFIX}}${{env.RELEASE_VERSION}}.${VERSION_PATCH}" >> $GITHUB_OUTPUT
echo "imagetag=v${{env.RELEASE_VERSION}}.${VERSION_PATCH}" >> $GITHUB_OUTPUT
echo "tagmsg=${{env.RELEASE_MESSAGE}} ${{steps.date.outputs.date}}" >> $GITHUB_OUTPUT
echo "tagmsg=${{env.RELEASE_MESSAGE}} ${{steps.date-selector.outputs.date}}" >> $GITHUB_OUTPUT
echo "tagpatch=${VERSION_PATCH}" >> $GITHUB_OUTPUT
outputs:
TAGNAME: ${{steps.tag-selector.outputs.gittag}}
TAGMESSAGE: ${{steps.tag-selector.outputs.tagmsg}}
TAGPATCH: ${{steps.tag-selector.outputs.tagpatch}}
PushTag:
needs: [GenerateTag]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: '0'
fetch-depth: '1'
- name: Push Git Tag
id: settag
env:
TAGNAME: ${{needs.GenerateTag.outputs.TAGNAME}}
TAGMESSAGE: ${{needs.GenerateTag.outputs.TAGMESSAGE}}
Expand All @@ -69,26 +72,42 @@ jobs:
git config user.email "[email protected]"
git tag ${{env.TAGNAME}} -m "${{env.TAGMESSAGE}}"
git push origin ${{env.TAGNAME}}
- name: Set repository patch variable
id: setpatch
env:
TAGPATCH: ${{needs.GenerateTag.outputs.TAGPATCH}}
# Depends on GITHUB_TOKEN enviroment variable PAT access
run: |
gh variable set VERSION_PATCH --body "${{env.TAGPATCH}}"
gh variable list
Build:
needs: [GenerateTag, PushTag]
runs-on: ubuntu-latest
outputs:
PROJECT: ${{steps.project.outputs.TARGET_PROJECT}}
steps:
- uses: actions/checkout@v3
- name: Build application Docker images
- name: Get BuildId
id: commit
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set buildArgs
run: |
echo "buildArgs UNITY_BUILD_VERSION: ${{env.RELEASE_VERSION}}, UNITY_BUILD_REVISION: ${{steps.commit.outputs.sha_short}}"
- name: Build Docker images
run: |
rm -f ./docker-compose.override.yml
docker compose build
docker compose build --build-arg UNITY_BUILD_VERSION=${{env.RELEASE_VERSION}} --build-arg UNITY_BUILD_REVISION=${{steps.commit.outputs.sha_short}}
working-directory: ./applications/Unity.GrantManager
- name: Connect to OpenShift API
id: project
run: |
oc login --token=${{env.OPENSHIFT_AUTH_TOKEN}} --server=${{env.OPENSHIFT_CLUSTER}}
echo "PROJECT=$(oc project | grep -oE '[0-9a-z]*-[dev\|test\|prod\|tools]*')" >> $GITHUB_OUTPUT
oc registry login
- name: Push build images to OpenShift container registry
- name: Push images to container registry
run: |
echo project = ${{steps.project.outputs.PROJECT}}
docker tag unity-grantmanager-web image-registry.apps.silver.devops.gov.bc.ca/${{steps.project.outputs.PROJECT}}/unity-grantmanager-web:${{needs.GenerateTag.outputs.IMAGETAG}}
docker tag unity-grantmanager-dbmigrator image-registry.apps.silver.devops.gov.bc.ca/${{steps.project.outputs.PROJECT}}/unity-grantmanager-dbmigrator:${{needs.GenerateTag.outputs.IMAGETAG}}
docker tag unity-grantmanager-web image-registry.apps.silver.devops.gov.bc.ca/${{steps.project.outputs.PROJECT}}/unity-grantmanager-web:github-latest
docker tag unity-grantmanager-dbmigrator image-registry.apps.silver.devops.gov.bc.ca/${{steps.project.outputs.PROJECT}}/unity-grantmanager-dbmigrator:github-latest
# docker push image-registry.apps.silver.devops.gov.bc.ca/${{steps.project.outputs.PROJECT}}/unity-grantmanager-web:github-latest
# docker push image-registry.apps.silver.devops.gov.bc.ca/${{steps.project.outputs.PROJECT}}/unity-grantmanager-dbmigrator:github-latest
3 changes: 3 additions & 0 deletions applications/Unity.GrantManager/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ UNITY_BUILD_VERSION="0.0.0"
UNITY_POSTGRES_DB="UnityGrantManager"
UNITY_POSTGRES_USER="********"
UNITY_POSTGRES_PASSWORD="********"
UNITY_POSTGRES_TENANT_DB="UnityGrantTenant"
UNITY_POSTGRES_TENANT_USER="********"
UNITY_POSTGRES_TENANT_PASSWORD="********"
UNITY_DB_HOST="unity-data-postgres"
UNITY_DB_PORT="5432"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ public override void ConfigureBundle(BundleConfigurationContext context)

context.Files.AddIfNotContains("/libs/pubsub-js/src/pubsub.js");

context.Files.AddIfNotContains("/libs/datatables.net-bs5/js/dataTables.bootstrap5.min.js");
context.Files.AddIfNotContains("/libs/datatables.net-buttons/js/dataTables.buttons.min.js");
context.Files.AddIfNotContains("/libs/datatables.net-buttons/js/buttons.colVis.min.js");
context.Files.AddIfNotContains("/libs/datatables.net-buttons/js/buttons.html5.min.js");

context.Files.AddIfNotContains("/libs/datatables.net-buttons-bs5/js/buttons.bootstrap5.js");
context.Files.AddIfNotContains("/libs/datatables.net-select/js/dataTables.select.js");
context.Files.AddIfNotContains("/libs/datatables.net-buttons-bs5/js/buttons.bootstrap5.js");
context.Files.AddIfNotContains("/libs/datatables.net-select-bs5/js/select.bootstrap5.js");
context.Files.AddIfNotContains("/libs/datatables.net-fixedheader/js/dataTables.fixedHeader.js");
context.Files.AddIfNotContains("/libs/chart.js/dist/chart.umd.js");

context.Files.AddIfNotContains("/libs/datatables.net-colreorder/js/dataTables.colReorder.min.js");
context.Files.AddIfNotContains("/libs/datatables.net-colreorder-bs5/js/colReorder.bootstrap5.min.js");

context.Files.AddIfNotContains("/libs/datatables.net-fixedheader-bs5/js/fixedHeader.bootstrap5.min.js");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ public override void ConfigureBundle(BundleConfigurationContext context)
context.Files.Add("/themes/basic/layout.css");
context.Files.Add("/themes/basic/unity-styles.css");

context.Files.AddIfNotContains("/libs/datatables.net-bs5/css/dataTables.bootstrap5.css");
context.Files.AddIfNotContains("/libs/datatables.net-buttons-bs5/css/buttons.bootstrap5.css");
context.Files.AddIfNotContains("/libs/datatables.net-select-bs5/css/select.bootstrap5.css");
context.Files.AddIfNotContains("/libs/datatables.net-colreorder-bs5/css/colReorder.bootstrap5.css");
context.Files.AddIfNotContains("/libs/datatables.net-fixedheader-bs5/css/fixedHeader.bootstrap5.css");

// Add assets for "/themes/basic/fonts/**/*"
context.Files.AddRange(new[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@if (CurrentUser.IsAuthenticated)
{
<a href="#" class="fw-bold d-sm-inline text-decoration-none">
<span><span>@CurrentUser.Name </span><span> @CurrentUser.SurName</span></span>
<span>@CurrentUser.FindClaimValue("DisplayName")</span>
</a>
}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Themes.Basic.Components.Brand
@using Volo.Abp.MultiTenancy;

@inject ICurrentTenant CurrentTenant

@{
string userName = (@ViewBag.UserName == null) ? "Test" : @ViewBag.UserName;
string[] userNameInitialsArr = userName.Split(" ");
string userNameInitials = userNameInitialsArr[0].Truncate(1) + ((userNameInitialsArr.Length > 1) ? userNameInitialsArr[1].Truncate(1) : "");

string pageTitle = (@ViewBag.PageTitle == null) ? "" : @ViewBag.PageTitle;
string pageTitle = CurrentTenant.Name + " - " + ViewBag.PageTitle;
}

<nav class="navbar navbar-expand-md shadow-sm flex-column flex-md-row unity-sub-navbar" id="sub-navbar">
<div class="container-fluid">
<h6>@pageTitle</h6>
<div class="search-input" style="display:none">
<div class="input-group">
<div class="input-group input-group-with-icons">
<div class="input-group-prepend">
<span class="input-group-text">
<i class="fs-5 fl fl-search"></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,6 @@ body {
overflow: hidden;
}

.input-group .input-group-prepend {
border: none;
}

.input-group .input-group-prepend .input-group-text, .input-group .input-group-append .input-group-text {
height: var(--bc-input-field-height);
border-radius: 0.25rem;
background-color: var(--bc-colors-white-primary-500);
border: none;
}

.input-group .form-control {
font-size: var(--bc-font-size);
line-height: 1;
height: var(--bc-input-field-height);
border: none;
color: var(--bc-colors-grey-text-500);
border-radius: .25rem;
}

.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
margin-left: calc(var(--bs-border-width) * -4);
}

.form-control:focus {
box-shadow: none;
}


.btn {
--bs-btn-border-radius: 0.1875rem;
Expand Down Expand Up @@ -323,8 +295,8 @@ div.dataTables_wrapper div.dataTables_length label {
input.form-control, textarea.form-control, .form-select {
font-size: var(--bc-font-size);
color: var(--bc-colors-grey-text-500);
border-radius: 0.1875rem;
border: var(--bs-border-width) solid var(--bs-border-color);
border-radius: 0.1875rem !important;
border: var(--bs-border-width) solid var(--bs-border-color);
}

input.form-control:hover, textarea.form-control:hover, .form-select:hover {
Expand Down Expand Up @@ -356,6 +328,12 @@ input.form-control, textarea.form-control, .form-select {
background-color: var(--bc-colors-grey-pressed);
}

abp-date-picker .btn {
position: absolute !important;
right: 1px;
padding: 0;
top: 2px;
}

.card {
--bs-card-border-color: transparent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@


.unity-side-nav {
min-width: 50px;
min-width: 200px;
width: 210px;
height: calc(100vh - 128px);
overflow-y: scroll;
Expand Down Expand Up @@ -159,3 +159,28 @@
.unity-currency-input {
text-align: right;
}

.input-group-with-icons .input-group-prepend {
border: none;
}

.input-group-with-icons .input-group-prepend .input-group-text, .input-group-with-icons .input-group-append .input-group-text {
height: var(--bc-input-field-height);
border-radius: 0.25rem;
background-color: var(--bc-colors-white-primary-500);
border: none;
}

.input-group-with-icons .form-control {
font-size: var(--bc-font-size);
line-height: 1;
height: var(--bc-input-field-height);
border: none;
color: var(--bc-colors-grey-text-500);
border-radius: .25rem;
width: 1% !important;
}

.input-group-with-icons > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
margin-left: calc(var(--bs-border-width) * -4);
}
Loading

0 comments on commit 9a91b3a

Please sign in to comment.