Skip to content

Commit

Permalink
Merge qa to master (#87)
Browse files Browse the repository at this point in the history
* Cscttv 2132 (#24)

* Add openshift config for api devel.

* Modify Docker build path.

* Add openshift config for identityserver devel.

* Test permission change in container app folder.

* Modify run time permissions

* Change SDK version in Identityserver build.

* Change build branch to devel. Change Rahti container image path.

* Remove researchfi prefix from Openshift config.

* Add README for api application.

* Upgrade Nuget packages.

* CSCTTV-2132_2 (#25)

* Modify Openshift template and Dockerfile for Identityserver.

* Modify image pull path.

* Modify image pull path.

* Add README in Identityserver project.

* Update README.md

* Update README.md

* Modify Git source branch and container path in Identityserver template.

* Remove Identityserver tempkey.jwk and add it in gitignore.

* Change app folder permission in Identityserver container.

* Do not initialize ElasticsearchService without required configuration values.

* CSCTTV-2123 Elasticsearch sync (#26)

* First draft of how data can be synced in Elasticsearch.

* Elasticsearch connection parameters from configuration.

* Add data types for Elasticsearch.

* Add more data in Elasticsearch person index.

* Delete tempkey.jwk

* Add Elasticsearch environment variables in api README. Add identityserver's tempkey.jwk in .gitignore.

* Simplify Elasticsearch service and change it to singleton instead of scoped service.

* Use connection resiliency with SQL Server provider.

* Always set field Modified to current timestamp when creating a new entry in database.

* Add more logging in ElasticsearchService.

* Improve handling of NEST error messages when adding or deleting entry in Elasticsearch.

* Remove unused controller.

* Use raw SQL query for getting DimUserProfile based on ORCID Id in DimPid. Clean up startup.cs dependencies.

* Use raw SQL query when retrieving ORCID registered data source from DimRegisteredDataSource.

* Upgrade Nuget packages in api project.

* Code clean up, remove repetitive code.

* Use raw sql when updating FactFieldValue table. Change created and modified timestamp to DateTime.UtcNow instead of DateTime.Now. Add namespace api.models.ProfileEditor.

* Add unit tests for TtvSqlService.
In TtvSqlService add own function for getting FactFieldValues FK column name based on field identifier.

* Simplify queries which get data for profile editor and elasticsearch index.

* When getting data for profile editor, get only those DimFieldDisplaySettings, which have at least one related FactFieldValue.

* Update Elasticsearch in a background task. (#27)

* When profile is created, include ORCID name automatically in profile.

* In ORCID controller remove unnecessary retrieval of DimKnownPerson entity.

* Remove multiple publicationIds from profile in the same api query.

* Remove cached profiledata when publications are added or removed.

* Use field identifier 550 with ORCID publications.
When userprofile is deleted, remove cached profiledata and remove Elasticsearch entry in background task.

* Enable split SQL query behaviour globally. Fix bug in ORCID publication handling.

* Call SaveChangesAsync only once when ORCID data is imported.

* Call SaveChangesAsync only once when adding demo data into user profile.

* Modify Identityserver Javascript client configuration handling.

* Add cooperation selection api (demo) (#28)

* Add draft version of cooperation selection api.

* Modify cooperation choice text content.

* Add Swagger documentation. (#29)

* Add Swagger documentation.

* Simplify cooperationdemo api. Swagger documentation improvements.

* Comment out Swagger, because the configuration does not work in Docker build.

* Enable Swagger in development environment

* Modify xml documentation generation. Modify environment handling in startup.

* Add LanguageService. (#30)

* Language service and name translation improvements.

* Add DimUserChoice in Ttv model. Add DimUserChoice handling in CooperationChoicesController. (#31)

* Compress api responses.

* Profile API for adding and removing funding decisions. (#32)

* Add controller and models for DimFundingDecision handling.

* Add funding decision handling in user profile.

* Add funding decision in demo data.

* Add DimFundingDecision demo data.

* Modify demo data. Modify FundingDecisionController functionality.

* Simplify addFungingDecision API response.

* CSCTTV-1703 research dataset handling in profile API (#33)

* Add controller and models for DimResearchDataset handling.

* Add relation between DimResearchDataset and FactFieldValues. Modify FundingDecisionController to use updated Ttv data model.

* Add part of research dataset demo data.

* Modify research dataset demo data handling. Modify demo data deletion.

* Modify research dataset structure in profile data API response.

* Comment out profile data query items.

* Include ORCID ID in demodata source id field.

* Modify research dataset demo data.

* Fix bug in research dataset demodata creation. Modify user profile deletion.

* Add funding decision and research dataset column names in TtvSqlService.

* Optimize user profile  and related data deletion.

* Add department name in affiliation. Demo implementation, not production ready. (#34)

* Improve handling of null values in name translation.

* Restore previous functionality in user profile deletion.

* Change funding decision handling to use projectId instead of funderProjectNumber. (#35)

* Fix typo in funding decision property name.

* Add OpenShift templates for demo version.

* Change start and end date property names in funding decision item.

* Add property datasetCreated in research dataset item.

* Change demo version openshift build config git branch.

* Comment out querying DimIdentifierlessData because of data model mismatch.

* Add user profile id in cooperation item query.

* Return API response immediately when there are no items to add or remove.

* Add debug controller for getting debug data and statistics.

* Sql model update 2021 12 (#37)

* Remove log print of user profile existence check.

* Add api response compression.

* Ttv model update according to latest SQL database structure. Major change to handling of registered data source, work in progress.

* Version which builds without errors. Elasticsearch synchronization and debug controller have some parts of code commented out.

* Modify user profile creation, adding demo data and adding ORCID data.

* Modify registered data source handling in profile data load.

* Fix bug, which prevents deleting DimFieldDisplaySettings related to user profile.

* Move profile editor data retrieval code into UserProfileService.

* Modify profile data handling in Elasticsearch synchronization.

* Modify SourceId field handling. Fix ORCID import bugs in DimName and DimResearcherDescription.

* Handle missing name element when parsing ORCID record.

* Upgrade Nuget packages. Modify DemoDataService.

* Filter query to get only ORCID related entities. Remove manual adjustment of EntityState.

* Get list of available FieldIdentifiers from UserProfileService. Add unit test to validate FieldIdentifier list content.

* Add type code in publication and ORCID publication. (#38)

* Fix bug where fromCache property was not set in ApiResponseProfileDataGet.

* Take DOI from DimPublication.Doi instead of DimPublication.DoiHandle

* Set ORCID member api scopes. Store and update user's ORCID access token on ORCID login. (#39)

* Store ORCID tokens from Keycloak external IDP token endpoint. Add TokenService. (#40)

* Add missing dependency injection in TokenService

* Add Keycloak account linking. Add named http clients. Modify configuration parameters. (#41)

* Require specific scope and orcid claim in controller authorization policy. (#42)

* Add DuplicateHandlerService (#43)

* Add DupplicateHandlerService and unit tests. Add temporary models and controller for testing purposes.

* Modify DuplicateHandlerService unit tests

* Logout and delete Keycloak user when user profile is deleted. (#44)

* EF model update. Registered data source handling changes. (#45)

* EF model scaffolded from test database on 5.5.2022.

* Modify ORCID and Tiedejatutkimus.fi data source handling.

* Add missing model files.

* Store ORCID and TTV registered data source and organization values into a singleton service on startup. (#46)

* Fixes suggested by Visual Studio code analyzer (#47)

* Remove IdentityServer (#48)

* Affiliation organization and department name handling in ORCID import (#49)

* Add OrcidImportService. Move logic from controller to service. Modify Orcid json parser unit tests.

* Add OrganizationHandlerService. Modify organization name handling in ORCID import and profile data deletion.

* Modify affiliation related organization search in ORCID import. Modify affiliation deletion.

* Modify affiliation department name handling.

* Modify ORCID disambiguation source mapping, add unit test.

* Move logic from controllers to services. (#50)

* Improvements in background Elasticsearch index update (#51)

* Queue background tasks according to Microsoft documentation.

* Check if Elasticsearch sync feature is enabled before adding items to task queue.

* Update NuGet packages (#52)

* Add ” (test)” in temporary organization names

* Update TTV model. Add DueDateDueTime into DimCallProgramme

* Update TTV model change. PK in BrGrantedPermission

* Remove demo data related code from user profile deletion.

* Do not delete DimResearchDataset on profile deletion

* Migrate from ASP.NET Core 5.0 to 6.0 (#53)

* Add sharing API for profile editor (#54)

* Add SharingController and SharingService

* Profile sharing related database queries on application startup.

* DimReferenceData handling when setting user profile default permissions.

* Add SharingController and draft data

* Add API endpoints for getting available sharing permissions and purposes. Language service bugfix.

* Rename sharing purpose related model.

* Add endpoints for listing, adding and removing of share permissions.

* Change OKM organization id (#55)

* Add Openshift template for Artifactory build. Remove unused templates. (#56)

* Startup.cs code clean up.

* Use interfaces in dependecy injection. (#57)

* Add Serilog for logging. (#58)

* Add GitHub codeql (#61)

* Add GitHub action CodeQL.

* Modify CodeQL GitHub action

* Check only csharp in GitHub action CodeQL.

* Modify log format.

* Modify log message content. (#62)

* CSCTTV-2724 Improvements in profile creation (#63)

* Improved TTV database search when creating user profile.

* Add research activity search on profile creation.

* CSCTTV-2720 Improve testability (#64)

* Add debug methods to create and delete a user profile to any ORCID ID in dim_pid.

* Get ORCID record from public API when a specific flag is set in access token.

* Fix bug in parsing of ORCID record education element

* Import from ORCID only one entry of the same publication. (#65)

* Enable database command logging

* Use TagWith in queries to make debug log more readable.

* Optimized profile data query using Dapper (#66)

* Add Dapper. Get profiledata using raw sql.

* Profile data person section query converted to raw sql.

* Partially completed version of new profile data query using Dapper.

* Add dim_education handling in new profile data query.

* Add dim_publication and dim_orcid_publication handling in new profile data query.

* Moved profile data SQL string into TtvSqlService. Use new profile data query in Elasticsearch index update.

* Add missing ITtvSqlService.cs, which was dropped by malfunctioning IDE.

* Removed old code from UserProfileService

* Profile data deletion using Dapper (#67)

* Initial code for deleting user profile using Dapper. Modify unit tests. Upgrade packages.

* First working version of profile data deletion using Dapper.

* Fix bug in deleting ORCID put codes from dim_pid. Add unit tests SQL statement creation.

* Removed commented code.

* Profile data response using new data structure. (#68)

* New data structure in profile data response

* Profile data personal section converted to new data structure.

* Profile data activity section converted to new data structure.

* Remove commented code and temporary modification in controller.

* Modify DuplicateHandlerService unit tests.

* Fix bug in Swagger documentation. Set controller route names explicitly.

* Optimized profile deletion (#69)

* Delete multiple IDs from dim_pid and dim_orcid_publication in the same SQL statement.

* Delete multiple rows in one SQL statement using WHERE id IN condition

* Update TTvSqlService unit tests.

* Update field identifiers, unit tests and dependencies.

* Use Automapper to create Elasticsearch data object from profile editor data object. (#70)

* Limit profiledata in Elastic index to published items only. (#71)

* Add property activitiesAndRewards into profiledata. Add property researchDatasets into Elasticsearch profiledata. (#72)

* Update SQL query for dim_research_activity. Update profiledata contents. (#73)

* Funding decision handling in SQL query and API response (#74)

* Research dataset handling in SQL query and API response (#75)

* Fix missing itemMeta in profile editor data.

* Add API endpoint accountdelete for removing Keycloak user. (#76)

* Cscttv 2799 hide national identification number (#77)

* Add own folder structure for Keycloak related files.

* Modify Java project naming. Add readme.

* Modify Keycloak Dockerfile

* Add custom Keycloak extension into build_dependencies folder.

* Add OpenShift template for Keycloak devel. Modify Keycloak Dockerfile. (#78)

* Rename Keycloak OpenShift template entries

* Add Keycloak version number 19 in OpenShift template to avoid collision with old installation.

* Fix bug in Keycloak custom provider URL.

* Comment out automatic certificate generation in Keycloak container.

* Add list of unique data sources in profile data and Elasticsearch index. (#79)

* Add SectorId in organization data. (#80)

* Add property primaryValue in Elasticsearch data. (#81)

* Remove obsolete API code. Organize models. Update dependencies. (#82)

* Remove DemoDataService

* Reduce EntityFramework database log level.

* Remove duplicate field PrimaryValue from elasticsearch model. (#83)

* Remove duplicate PrimaryValue fields from Elasticsearch models. (#84)

* Rename controller and route for profiledata. (#85)

* Add OpenShift templates for QA and production. (#86)
  • Loading branch information
sarkikos authored Nov 7, 2022
1 parent 654c98b commit 384d674
Show file tree
Hide file tree
Showing 426 changed files with 14,001 additions and 65,247 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "devel" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "devel" ]
schedule:
- cron: '19 17 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
4 changes: 4 additions & 0 deletions aspnetcore/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.cs]

# CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
dotnet_diagnostic.CS8632.severity = silent
18 changes: 3 additions & 15 deletions aspnetcore/mydata.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{530E1C35-DCE
src\.gitignore = src\.gitignore
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "identityserver", "src\identityserver\identityserver.csproj", "{F470F142-9BE6-4F58-ABBA-0688AADBA3DA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "api.Tests", "src\api.Tests\api.Tests.csproj", "{1C38915D-3D9C-4BF7-9C0F-B4568DE45493}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B24A6206-EA06-441C-811C-7C329851C4AA}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "api", "src\api\api.csproj", "{9A67B131-39EA-4D65-A99C-7650B2238308}"
EndProject
Expand All @@ -29,18 +30,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F470F142-9BE6-4F58-ABBA-0688AADBA3DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F470F142-9BE6-4F58-ABBA-0688AADBA3DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F470F142-9BE6-4F58-ABBA-0688AADBA3DA}.Debug|x64.ActiveCfg = Debug|Any CPU
{F470F142-9BE6-4F58-ABBA-0688AADBA3DA}.Debug|x64.Build.0 = Debug|Any CPU
{F470F142-9BE6-4F58-ABBA-0688AADBA3DA}.Debug|x86.ActiveCfg = Debug|Any CPU
{F470F142-9BE6-4F58-ABBA-0688AADBA3DA}.Debug|x86.Build.0 = Debug|Any CPU
{F470F142-9BE6-4F58-ABBA-0688AADBA3DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F470F142-9BE6-4F58-ABBA-0688AADBA3DA}.Release|Any CPU.Build.0 = Release|Any CPU
{F470F142-9BE6-4F58-ABBA-0688AADBA3DA}.Release|x64.ActiveCfg = Release|Any CPU
{F470F142-9BE6-4F58-ABBA-0688AADBA3DA}.Release|x64.Build.0 = Release|Any CPU
{F470F142-9BE6-4F58-ABBA-0688AADBA3DA}.Release|x86.ActiveCfg = Release|Any CPU
{F470F142-9BE6-4F58-ABBA-0688AADBA3DA}.Release|x86.Build.0 = Release|Any CPU
{1C38915D-3D9C-4BF7-9C0F-B4568DE45493}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C38915D-3D9C-4BF7-9C0F-B4568DE45493}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C38915D-3D9C-4BF7-9C0F-B4568DE45493}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand All @@ -67,7 +56,6 @@ Global
{9A67B131-39EA-4D65-A99C-7650B2238308}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F470F142-9BE6-4F58-ABBA-0688AADBA3DA} = {530E1C35-DCEA-4F12-B363-E62C2554D61E}
{1C38915D-3D9C-4BF7-9C0F-B4568DE45493} = {530E1C35-DCEA-4F12-B363-E62C2554D61E}
{9A67B131-39EA-4D65-A99C-7650B2238308} = {530E1C35-DCEA-4F12-B363-E62C2554D61E}
EndGlobalSection
Expand Down
18 changes: 18 additions & 0 deletions aspnetcore/openshift/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Builder
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY aspnetcore/src/api/api.csproj ./
RUN dotnet restore
# Copy everything else and build
COPY aspnetcore/src/api/ ./
RUN dotnet publish -c Release -o out



# Runtime image
FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /app
COPY --from=build-env /app/out .
EXPOSE 8080
ENTRYPOINT ["dotnet", "api.dll"]
99 changes: 99 additions & 0 deletions aspnetcore/openshift/api/template-api-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# This file is part of the research.fi service
#
# Copyright 2021 Ministry of Education and Culture, Finland
#
# :author: CSC - IT Center for Science Ltd., Espoo Finland [email protected]
# :license: MIT
apiVersion: v1
kind: Template
metadata:
labels:
app: mydata-api-demo
template: mydata-api-demo
name: mydata-api-demo
objects:
# Service (demo)
- apiVersion: v1
kind: Service
metadata:
name: mydata-api-service-demo
labels:
app: mydata-api-demo
annotations:
description: Mydata api service for demo
spec:
ports:
- name: mydata-api-port-demo
port: 8080
targetPort: 8080
selector:
depcfg: mydata-api-depcfg-demo

# ImageStream (demo)
- apiVersion: v1
kind: ImageStream
metadata:
name: mydata-api-demo
labels:
app: mydata-api-demo

# BuildConfig using Docker build strategy
- apiVersion: v1
kind: BuildConfig
metadata:
name: mydata-api-build-demo
labels:
app: mydata-api-demo
spec:
source:
git:
uri: https://github.com/CSCfi/research-fi-mydata.git
ref: demo2021
contextDir: .
strategy:
dockerStrategy:
dockerfilePath: aspnetcore/openshift/api/Dockerfile
output:
to:
kind: ImageStreamTag
name: mydata-api-demo:latest
successfulBuildsHistoryLimit: 2
failedBuildsHistoryLimit: 2

# Deployment config (demo)
- apiVersion: v1
kind: DeploymentConfig
metadata:
name: mydata-api-deployment-demo
labels:
app: mydata-api-demo
spec:
selector:
app: mydata-api-demo
depcfg: mydata-api-depcfg-demo
template:
metadata:
labels:
app: mydata-api-demo
depcfg: mydata-api-depcfg-demo
spec:
containers:
- name: mydata-api-container-demo
image: researchfi/mydata-api-demo
imagePullPolicy: Always
ports:
- containerPort: 8080
protocol: TCP
replicas: 1
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- mydata-api-container-demo
from:
kind: ImageStreamTag
name: mydata-api-demo:latest
strategy:
type: Rolling
58 changes: 58 additions & 0 deletions aspnetcore/openshift/api/template-api-devel-artifactory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This file is part of the research.fi service
#
# Copyright 2022 Ministry of Education and Culture, Finland
#
# :author: CSC - IT Center for Science Ltd., Espoo Finland [email protected]
# :license: MIT

# Build mydata API devel version and push image to Artifactory

apiVersion: v1
kind: Template
metadata:
name: template-artifactory-build-mydata-api-devel
annotations:
description: This template adds build configuration, which builds mydata API devel version and pushes the image into Artifactory.
labels:
app: mydata-api-devel

parameters:
- name: ARTIFACTORY_BASE_URL
displayName: Artifactory base URL.
description: Base URL of Artifactory. For example "myartifactory.mydomain.fi"
value: ""
required: true

objects:
- apiVersion: v1
kind: BuildConfig
metadata:
name: artifactory-build-mydata-api-devel
labels:
app: mydata-api-devel
spec:
source:
type: Git
git:
uri: https://github.com/CSCfi/research-fi-mydata.git
ref: devel
contextDir: .
strategy:
type: Docker
dockerStrategy:
dockerfilePath: aspnetcore/openshift/api/Dockerfile
output:
to:
kind: DockerImage
name: researchfi-mydata-api-docker-dev.${ARTIFACTORY_BASE_URL}/mydata-api-devel:latest
pushSecret:
name: artifactory-researchfi-mydata-api-docker-dev
nodeSelector: {}
triggers:
- type: ImageChange
imageChange:
from:
kind: ImageStreamTag
name: mydata-api-devel:latest
successfulBuildsHistoryLimit: 2
failedBuildsHistoryLimit: 2
99 changes: 99 additions & 0 deletions aspnetcore/openshift/api/template-api-devel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# This file is part of the research.fi service
#
# Copyright 2021 Ministry of Education and Culture, Finland
#
# :author: CSC - IT Center for Science Ltd., Espoo Finland [email protected]
# :license: MIT
apiVersion: v1
kind: Template
metadata:
labels:
app: mydata-api-devel
template: mydata-api-devel
name: mydata-api-devel
objects:
# Service (devel)
- apiVersion: v1
kind: Service
metadata:
name: mydata-api-service-devel
labels:
app: mydata-api-devel
annotations:
description: Mydata api service for devel branch
spec:
ports:
- name: mydata-api-port-devel
port: 8080
targetPort: 8080
selector:
depcfg: mydata-api-depcfg-devel

# ImageStream (development)
- apiVersion: v1
kind: ImageStream
metadata:
name: mydata-api-devel
labels:
app: mydata-api-devel

# BuildConfig using Docker build strategy
- apiVersion: v1
kind: BuildConfig
metadata:
name: mydata-api-build-devel
labels:
app: mydata-api-devel
spec:
source:
git:
uri: https://github.com/CSCfi/research-fi-mydata.git
ref: devel
contextDir: .
strategy:
dockerStrategy:
dockerfilePath: aspnetcore/openshift/api/Dockerfile
output:
to:
kind: ImageStreamTag
name: mydata-api-devel:latest
successfulBuildsHistoryLimit: 4
failedBuildsHistoryLimit: 4

# Deployment config (development)
- apiVersion: v1
kind: DeploymentConfig
metadata:
name: mydata-api-deployment-devel
labels:
app: mydata-api-devel
spec:
selector:
app: mydata-api-devel
depcfg: mydata-api-depcfg-devel
template:
metadata:
labels:
app: mydata-api-devel
depcfg: mydata-api-depcfg-devel
spec:
containers:
- name: mydata-api-container-devel
image: researchfi/mydata-api-devel
imagePullPolicy: Always
ports:
- containerPort: 8080
protocol: TCP
replicas: 1
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- mydata-api-container-devel
from:
kind: ImageStreamTag
name: mydata-api-devel:latest
strategy:
type: Rolling
Loading

0 comments on commit 384d674

Please sign in to comment.