Skip to content

Commit da029b8

Browse files
authored
fix: database password & refactor pipelines (#99)
* chore: set pipelines by Ansible scripts * fix: database password environment variable * build: remove obsolete pipelines
1 parent 61662fc commit da029b8

6 files changed

Lines changed: 103 additions & 113 deletions

azure-pipelines-notification-service-api-release.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

azure-pipelines-notification-service-api-review.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

notification_service/settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
CORS_ALLOW_ALL_ORIGINS=(bool, False),
2727
CORS_ALLOWED_ORIGINS=(list, []),
2828
DATABASE_URL=(str, ""),
29+
DATABASE_PASSWORD=(str, ""),
2930
DEBUG=(bool, False),
3031
DEFAULT_FROM_EMAIL=(str, "no-reply@hel.ninja"),
3132
HELUSERS_PASSWORD_LOGIN_DISABLED=(bool, False),
@@ -68,6 +69,9 @@
6869

6970
DATABASES = {"default": env.db()}
7071

72+
if env("DATABASE_PASSWORD"):
73+
DATABASES["default"]["PASSWORD"] = env("DATABASE_PASSWORD")
74+
7175
CACHES = {"default": env.cache()}
7276

7377
try:
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Continuous integration (CI) triggers cause a pipeline to run whenever you push
2+
# an update to the specified branches or you push specified tags.
3+
trigger:
4+
batch: true
5+
branches:
6+
include:
7+
- main
8+
paths:
9+
exclude:
10+
- '*release-please*'
11+
- '*.md'
12+
- '.github/'
13+
- 'pipelines/notification-service-api-release.yml'
14+
- 'pipelines/notification-service-api-review.yml'
15+
- '*compose*'
16+
17+
# Pull request (PR) triggers cause a pipeline to run whenever a pull request is
18+
# opened with one of the specified target branches, or when updates are made to
19+
# such a pull request.
20+
#
21+
# GitHub creates a new ref when a pull request is created. The ref points to a
22+
# merge commit, which is the merged code between the source and target branches
23+
# of the pull request.
24+
#
25+
# Opt out of pull request validation
26+
pr: none
27+
28+
# By default, use self-hosted agents
29+
pool: Default
30+
31+
resources:
32+
repositories:
33+
# Azure DevOps repository
34+
- repository: kuva-notification-service-api-pipelines
35+
type: git
36+
# Azure DevOps project/repository
37+
name: kuva-notification-service-api/kuva-notification-service-api-pipelines
38+
39+
extends:
40+
# Filename in Azure DevOps Repository
41+
template: components/notification-service-api/pipelines/notification-service-api-dev.yml@kuva-notification-service-api-pipelines
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Continuous integration (CI) triggers cause a pipeline to run whenever you push
2+
# an update to the specified branches or you push specified tags.
3+
trigger:
4+
batch: true
5+
tags:
6+
include:
7+
- notification-service-api-v*
8+
9+
# Pull request (PR) triggers cause a pipeline to run whenever a pull request is
10+
# opened with one of the specified target branches, or when updates are made to
11+
# such a pull request.
12+
#
13+
# GitHub creates a new ref when a pull request is created. The ref points to a
14+
# merge commit, which is the merged code between the source and target branches
15+
# of the pull request.
16+
#
17+
# Opt out of pull request validation
18+
pr: none
19+
20+
# By default, use self-hosted agents
21+
pool: Default
22+
23+
resources:
24+
repositories:
25+
# Azure DevOps repository
26+
- repository: kuva-notification-service-api-pipelines
27+
type: git
28+
# Azure DevOps project/repository
29+
name: kuva-notification-service-api/kuva-notification-service-api-pipelines
30+
31+
extends:
32+
# Filename in Azure DevOps Repository
33+
template: components/notification-service-api/pipelines/notification-service-api-release.yml@kuva-notification-service-api-pipelines
Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
#
2-
# Test pipeline. Run build and deploy for Platta test environments.
2+
# Review pipeline. Run build and deploy for Platta dev environments.
33
# Pipeline runs different tests e.g. unittest and browser tests.
44
#
5-
# Continuous integration (CI) triggers cause a pipeline to run whenever you push
5+
# Continuous integration (CI) triggers cause a pipeline to run whenever you push
66
# an update to the specified branches or you push specified tags.
7-
trigger:
8-
batch: true
9-
branches:
10-
include:
11-
- main
12-
paths:
13-
exclude:
14-
- '*release-please*'
15-
- '**/*.md'
16-
- '.github/'
7+
# only PR trigger pipeline
8+
trigger: none
179

18-
# Pull request (PR) triggers cause a pipeline to run whenever a pull request is
10+
# Pull request (PR) triggers cause a pipeline to run whenever a pull request is
1911
# opened with one of the specified target branches, or when updates are made to
2012
# such a pull request.
2113
#
@@ -24,21 +16,31 @@ trigger:
2416
# of the pull request.
2517
#
2618
# Opt out of pull request validation
27-
pr: none
19+
pr:
20+
# PR target branch
21+
branches:
22+
include:
23+
- main
24+
paths:
25+
exclude:
26+
- '*release-please*'
27+
- '*.md'
28+
- '.github/'
29+
- 'pipelines/notification-service-api-release.yml'
30+
- 'pipelines/notification-service-api-dev.yml'
31+
- '*compose*'
2832

2933
# By default, use self-hosted agents
3034
pool: Default
3135

3236
resources:
3337
repositories:
34-
# Azure DevOps repository
35-
- repository: notification-service-api-pipelines
36-
type: git
37-
# Azure DevOps project/repository
38-
name: kuva-notification-service-api/kuva-notification-service-api-pipelines
38+
# Azure DevOps repository
39+
- repository: kuva-notification-service-api-pipelines
40+
type: git
41+
# Azure DevOps project/repository
42+
name: kuva-notification-service-api/kuva-notification-service-api-pipelines
3943

4044
extends:
41-
# Filename in Azure DevOps Repository (note possible -ui or -api)
42-
# Django example: azure-pipelines-PROJECTNAME-api-release.yml
43-
# Drupal example: azure-pipelines-drupal-release.yml
44-
template: azure-pipelines-notification-service-api-test.yml@notification-service-api-pipelines
45+
# Filename in Azure DevOps Repository
46+
template: components/notification-service-api/pipelines/notification-service-api-review.yml@kuva-notification-service-api-pipelines

0 commit comments

Comments
 (0)