From 9bac99fc64d9085ef2aa1044edf71809248b5076 Mon Sep 17 00:00:00 2001 From: Tero Virtanen Date: Tue, 8 Aug 2023 14:03:06 +0300 Subject: [PATCH] build: helsinkilisa review environment on Platta DEVOPS-549 --- azure-pipelines/helsinkilisa-review.yml | 66 +++++++++++++++++++++++++ backend/benefit/docker-entrypoint.sh | 4 +- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 azure-pipelines/helsinkilisa-review.yml diff --git a/azure-pipelines/helsinkilisa-review.yml b/azure-pipelines/helsinkilisa-review.yml new file mode 100644 index 0000000000..5a3c22012c --- /dev/null +++ b/azure-pipelines/helsinkilisa-review.yml @@ -0,0 +1,66 @@ +# +# Review pipeline. Run build and deploy for Platta test environments. +# Pipeline runs different tests e.g. unittest and browser tests. +# +# Continuous integration (CI) triggers cause a pipeline to run whenever you push +# an update to the specified branches or you push specified tags. +# only PR trigger pipeline +trigger: none + +# Pull request (PR) triggers cause a pipeline to run whenever a pull request is +# opened with one of the specified target branches, or when updates are made to +# such a pull request. +# +# GitHub creates a new ref when a pull request is created. The ref points to a +# merge commit, which is the merged code between the source and target branches +# of the pull request. +# +# Opt out of pull request validation +pr: + # PR target branch + branches: + include: + - develop + paths: + include: + - azure-pipelines/helsinkilisa-review.yml + - backend/docker/benefit.Dockerfile + - backend/benefit/** + - backend/shared/** + - frontend/* + - frontend/benefit/** + - frontend/shared/** + exclude: + - README.md + - backend/kesaseteli/** + - backend/tet/** + - frontend/kesaseteli/** + - frontend/tet/** + - frontend/**/browser-tests + - frontend/**/__tests__ + +# By default, use self-hosted agents +pool: Default + +resources: + repositories: + # Azure DevOps repository + - repository: yjdh-helsinkilisa-pipelines + type: git + ref: refs/heads/review_pipelines + # Azure DevOps project/repository + name: yjdh-helsinkilisa/yjdh-helsinkilisa-pipelines + +extends: + # Filename in Azure DevOps Repository (note possible -ui or -api) + # Django example: azure-pipelines-PROJECTNAME-api-release.yml + # Drupal example: azure-pipelines-drupal-release.yml + template: azure-pipelines-helsinkilisa-review.yml@yjdh-helsinkilisa-pipelines + # Application build arguments and config map values as key value pairs. + # The values here will override the values defined in the yjdh-benefit-pipelines repository. + # for example +# parameters: +# buildArgs: +# NEXT_PUBLIC_DEBUG: 0 +# configMap: # pod environment variables +# DEBUG: 0 diff --git a/backend/benefit/docker-entrypoint.sh b/backend/benefit/docker-entrypoint.sh index d6e1b17a16..040c0d3c0b 100755 --- a/backend/benefit/docker-entrypoint.sh +++ b/backend/benefit/docker-entrypoint.sh @@ -16,7 +16,9 @@ fi if [[ "$LOAD_FIXTURES" = "1" ]]; then echo "Loading fixtures..." ./manage.py loaddata groups.json - ./manage.py loaddata default_terms.json + if [[ "$LOAD_DEFAULT_TERMS" = "1" ]]; then + ./manage.py loaddata default_terms.json + fi ./manage.py set_group_permissions fi