Skip to content

Commit 50eee06

Browse files
authored
build: refactor pipelines (#406)
* fix: database password from enviroment variable * PLATTA-6229
1 parent a48095e commit 50eee06

7 files changed

Lines changed: 126 additions & 163 deletions

File tree

azure-pipelines-release.yml

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

azure-pipelines-review.yml

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

azure-pipelines-test.yml

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

palvelutarjotin/settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
ALLOWED_HOSTS=(list, []),
3535
USE_X_FORWARDED_HOST=(bool, False),
3636
DATABASE_URL=(str, ""),
37+
DATABASE_PASSWORD=(str, ""),
3738
CACHE_URL=(str, "locmemcache://"),
3839
MAILER_EMAIL_BACKEND=(str, "django.core.mail.backends.console.EmailBackend"),
3940
MAILER_LOCK_PATH=(str, ""),
@@ -113,6 +114,9 @@
113114

114115
DATABASES = {"default": env.db()}
115116

117+
if env("DATABASE_PASSWORD"):
118+
DATABASES["default"]["PASSWORD"] = env("DATABASE_PASSWORD")
119+
116120
CACHES = {"default": env.cache()}
117121

118122
if env.str("DEFAULT_FROM_EMAIL"):

pipelines/kultus-api-dev.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
- master
8+
- main
9+
paths:
10+
exclude:
11+
- '*release-please*'
12+
- '*.md'
13+
- '.github/'
14+
- 'pipelines/kultus-api-release.yml'
15+
- 'pipelines/kultus-api-review.yml'
16+
- 'docker-compose*'
17+
18+
# Pull request (PR) triggers cause a pipeline to run whenever a pull request is
19+
# opened with one of the specified target branches, or when updates are made to
20+
# such a pull request.
21+
#
22+
# GitHub creates a new ref when a pull request is created. The ref points to a
23+
# merge commit, which is the merged code between the source and target branches
24+
# of the pull request.
25+
#
26+
# Opt out of pull request validation
27+
pr: none
28+
29+
# By default, use self-hosted agents
30+
pool: Default
31+
32+
resources:
33+
repositories:
34+
# Azure DevOps repository
35+
- repository: kultus-pipelines
36+
type: git
37+
# Azure DevOps project/repository
38+
name: kultus/kultus-pipelines
39+
40+
extends:
41+
# Filename in Azure DevOps Repository
42+
template: components/kultus-api/pipelines/kultus-api-dev.yml@kultus-pipelines

pipelines/kultus-api-release.yml

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+
- palvelutarjotin-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: kultus-pipelines
27+
type: git
28+
# Azure DevOps project/repository
29+
name: kultus/kultus-pipelines
30+
31+
extends:
32+
# Filename in Azure DevOps Repository
33+
template: components/kultus-api/pipelines/kultus-api-release.yml@kultus-pipelines

pipelines/kultus-api-review.yml

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

0 commit comments

Comments
 (0)