Skip to content

Commit

Permalink
fix: revert debug lines
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvenSpellmaker committed Jul 17, 2024
1 parent d71dc16 commit 5e7b524
Showing 1 changed file with 118 additions and 127 deletions.
245 changes: 118 additions & 127 deletions build/azDevOps/azure/azure-pipelines-javaspring-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,134 +194,125 @@ stages:

- checkout: templates

# Updates the build number in Azure DevOps (requires refresh in the UI to see)
- bash: |
echo Reason: $(Build.Reason)
echo source branch: "$(source_branch_ref)"
echo target branch: "$(target_branch_ref)"
echo pull request number: "$(pullrequest_number)"
exit 1
displayName: Debug Vars Test
# # Updates the build number in Azure DevOps (requires refresh in the UI to see)
# - bash: |
# echo '##vso[Build.UpdateBuildNumber]${{ variables.docker_image_tag }}'
# displayName: 'Update: Build Number'

# # Validates all YAML files in the repo to check they adhere to standards
# - template: templates/steps/build/test-validate-yaml.yml
# parameters:
# pipeline_scripts_directory: "${{ variables.self_pipeline_scripts_dir }}"
# container: "k8s_deploy"
# yamllint_config_file: "${{ variables.yamllint_config_file }}"
# yamllint_scan_directory: "${{ variables.yamllint_scan_directory }}"

# # Runs a terraform formatting check and a validation check
# - template: templates/steps/build/test-validate-terraform.yml
# parameters:
# pipeline_scripts_directory: "${{ variables.self_pipeline_scripts_dir }}"
# terraform_container: "terraform_custom"
# terraform_directory: "${{ variables.self_repo_tf_dir }}"

# # Builds the Java app and runs tests
# - template: templates/steps/build/build-java.yml
# parameters:
# repo_root_dir: "${{ variables.self_repo_dir }}"
# project_root_dir: "${{ variables.self_project_dir }}"
# pipeline_scripts_directory: "${{ variables.self_pipeline_scripts_dir }}"
# # Maven
# maven_cache_directory: "${{ variables.maven_cache_directory }}"
# maven_surefire_reports_dir: "${{ variables.maven_surefire_reports_dir }}"
# maven_allowed_test_tags: "${{ variables.maven_allowed_test_tags}}"
# # Docker
# docker_build_container: "${{ variables.docker_java_image }}"
# # Vulnerability Scanning
# vulnerability_scan: "${{ variables.vulnerability_scan }}"
# vulnerability_scan_api_key: "${{ variables.vulnerability_scan_api_key }}"
# vulnerability_scan_fail_build_on_detection: "${{ variables.vulnerability_scan_fail_build_on_detection }}"
# project_type: "${{ variables.java_project_type }}"

# # Builds the Java API Tests
# - template: templates/steps/build/build-api-tests.yml
# parameters:
# repo_root_dir: "${{ variables.self_repo_dir }}"
# functional_test_project_root_dir: "${{ variables.self_functional_testproject_dir }}"
# functional_test_artefact_path: "${{ variables.functional_test_artefact_path }}"
# pipeline_scripts_directory: "${{ variables.self_pipeline_scripts_dir }}"
# # Maven
# maven_untagged_test_check: true
# maven_cache_directory: "${{ variables.maven_cache_directory }}"
# maven_allowed_post_deploy_test_tags: "${{ variables.maven_allowed_post_deploy_test_tags }}"
# maven_ignored_post_deploy_test_tags: "${{ variables.maven_ignored_post_deploy_test_tags }}"
# maven_post_deploy_html_report_directory: "${{ variables.maven_post_deploy_html_report_directory }}"
# maven_post_deploy_failsafe_reports_directory: "${{ variables.maven_post_deploy_failsafe_reports_directory }}"
# # Docker
# docker_build_container: "${{ variables.docker_java_image }}"
# # Vulnerability Scan
# vulnerability_scan: "${{ variables.vulnerability_scan }}"
# vulnerability_scan_api_key: "${{ variables.vulnerability_scan_api_key }}"
# vulnerability_scan_fail_build_on_detection: "${{ variables.vulnerability_scan_fail_build_on_detection }}"
# project_type: "${{ variables.functional_test_project_type }}"

# # Performs static code analysis, such as Sonar Cloud
# - template: templates/steps/build/test-static-code-analysis.yml
# parameters:
# project_root_dir: "${{ variables.self_project_dir }}"
# pipeline_scripts_directory: "${{ variables.self_pipeline_scripts_dir}}"
# # PR / Branch vars
# source_branch_ref: "$(source_branch_ref)"
# target_branch_ref: "$(target_branch_ref)"
# pullrequest_number: "$(pullrequest_number)"
# # Sonar
# sonar_enable: true
# # Set to false to speed up validation of deploy stage, revert once done
# sonar_container: "sonar_scanner"
# sonar_host_url: "https://sonarcloud.io"
# sonar_project_name: "$(SONAR_PROJECT_NAME)"
# sonar_project_key: "$(SONAR_PROJECT_KEY)"
# sonar_token: "$(SONAR_TOKEN)"
# sonar_organisation: "$(SONAR_ORGANIZATION)"
# # Probably `GitHub` or `vsts`
# sonar_pullrequest_provider: "GitHub"
# sonar_remote_repo: "${{ variables.self_remote_repo }}"
# sonar_command: "sonar-scanner"
# # Docker
# docker_image_tag: "${{ variables.docker_image_tag }}"

# # Builds the Docker image and pushes it to an ACR
# - template: templates/steps/build/build-docker-image.yml
# parameters:
# project_root_dir: "${{ variables.self_project_dir }}"
# pipeline_scripts_directory: "${{ variables.self_pipeline_scripts_dir }}"
# docker_k8s_container: "k8s_deploy"
# docker_build_additional_args: "."
# docker_image_name: "${{ variables.docker_image_name }}"
# docker_image_tag: "${{ variables.docker_image_tag }}"
# docker_container_registry_name: "$(DOCKER_USERNAME)"
# # Azure
# azure_client_id: "$(ARM_CLIENT_ID)"
# azure_client_secret: "$(ARM_CLIENT_SECRET)"
# azure_tenant_id: "$(ARM_TENANT_ID)"
# azure_subscription_id: "$(ARM_SUBSCRIPTION_ID)"

# # Post build tasks, such as Test and Coverage upload, and publishing artefacts
# - template: templates/steps/build/post-build-tasks.yml
# parameters:
# project_root_dir: "${{ variables.self_project_dir }}"
# functional_test_project_root_dir: "${{ variables.self_functional_testproject_dir }}"
# # Build Output File
# # files to be persisted across stages
# build_file: true
# build_file_path: "${{ variables.build_artifact_deploy_path }}"
# build_file_artefact_name: "${{ variables.build_artifact_deploy_name }}"
# # Functional tests
# functional_test: ${{ variables.functional_test }}
# functional_test_artefact_name: "${{ variables.functional_test_artefact_name }}"
# functional_test_artefact_path: "${{ variables.functional_test_artefact_path }}"
# vulnerability_scan: "${{ variables.vulnerability_scan }}"
# vulnerability_scan_report: "${{ variables.vulnerability_scan_report }}"
# java_project_type: "${{ variables.java_project_type }}"
# functional_test_project_type: "${{ variables.functional_test_project_type }}"
echo '##vso[Build.UpdateBuildNumber]${{ variables.docker_image_tag }}'
displayName: 'Update: Build Number'
# Validates all YAML files in the repo to check they adhere to standards
- template: templates/steps/build/test-validate-yaml.yml
parameters:
pipeline_scripts_directory: "${{ variables.self_pipeline_scripts_dir }}"
container: "k8s_deploy"
yamllint_config_file: "${{ variables.yamllint_config_file }}"
yamllint_scan_directory: "${{ variables.yamllint_scan_directory }}"

# Runs a terraform formatting check and a validation check
- template: templates/steps/build/test-validate-terraform.yml
parameters:
pipeline_scripts_directory: "${{ variables.self_pipeline_scripts_dir }}"
terraform_container: "terraform_custom"
terraform_directory: "${{ variables.self_repo_tf_dir }}"

# Builds the Java app and runs tests
- template: templates/steps/build/build-java.yml
parameters:
repo_root_dir: "${{ variables.self_repo_dir }}"
project_root_dir: "${{ variables.self_project_dir }}"
pipeline_scripts_directory: "${{ variables.self_pipeline_scripts_dir }}"
# Maven
maven_cache_directory: "${{ variables.maven_cache_directory }}"
maven_surefire_reports_dir: "${{ variables.maven_surefire_reports_dir }}"
maven_allowed_test_tags: "${{ variables.maven_allowed_test_tags}}"
# Docker
docker_build_container: "${{ variables.docker_java_image }}"
# Vulnerability Scanning
vulnerability_scan: "${{ variables.vulnerability_scan }}"
vulnerability_scan_api_key: "${{ variables.vulnerability_scan_api_key }}"
vulnerability_scan_fail_build_on_detection: "${{ variables.vulnerability_scan_fail_build_on_detection }}"
project_type: "${{ variables.java_project_type }}"

# Builds the Java API Tests
- template: templates/steps/build/build-api-tests.yml
parameters:
repo_root_dir: "${{ variables.self_repo_dir }}"
functional_test_project_root_dir: "${{ variables.self_functional_testproject_dir }}"
functional_test_artefact_path: "${{ variables.functional_test_artefact_path }}"
pipeline_scripts_directory: "${{ variables.self_pipeline_scripts_dir }}"
# Maven
maven_untagged_test_check: true
maven_cache_directory: "${{ variables.maven_cache_directory }}"
maven_allowed_post_deploy_test_tags: "${{ variables.maven_allowed_post_deploy_test_tags }}"
maven_ignored_post_deploy_test_tags: "${{ variables.maven_ignored_post_deploy_test_tags }}"
maven_post_deploy_html_report_directory: "${{ variables.maven_post_deploy_html_report_directory }}"
maven_post_deploy_failsafe_reports_directory: "${{ variables.maven_post_deploy_failsafe_reports_directory }}"
# Docker
docker_build_container: "${{ variables.docker_java_image }}"
# Vulnerability Scan
vulnerability_scan: "${{ variables.vulnerability_scan }}"
vulnerability_scan_api_key: "${{ variables.vulnerability_scan_api_key }}"
vulnerability_scan_fail_build_on_detection: "${{ variables.vulnerability_scan_fail_build_on_detection }}"
project_type: "${{ variables.functional_test_project_type }}"

# Performs static code analysis, such as Sonar Cloud
- template: templates/steps/build/test-static-code-analysis.yml
parameters:
project_root_dir: "${{ variables.self_project_dir }}"
pipeline_scripts_directory: "${{ variables.self_pipeline_scripts_dir}}"
# PR / Branch vars
source_branch_ref: "$(source_branch_ref)"
target_branch_ref: "$(target_branch_ref)"
pullrequest_number: "$(pullrequest_number)"
# Sonar
sonar_enable: true
# Set to false to speed up validation of deploy stage, revert once done
sonar_container: "sonar_scanner"
sonar_host_url: "https://sonarcloud.io"
sonar_project_name: "$(SONAR_PROJECT_NAME)"
sonar_project_key: "$(SONAR_PROJECT_KEY)"
sonar_token: "$(SONAR_TOKEN)"
sonar_organisation: "$(SONAR_ORGANIZATION)"
# Probably `GitHub` or `vsts`
sonar_pullrequest_provider: "GitHub"
sonar_remote_repo: "${{ variables.self_remote_repo }}"
sonar_command: "sonar-scanner"
# Docker
docker_image_tag: "${{ variables.docker_image_tag }}"

# Builds the Docker image and pushes it to an ACR
- template: templates/steps/build/build-docker-image.yml
parameters:
project_root_dir: "${{ variables.self_project_dir }}"
pipeline_scripts_directory: "${{ variables.self_pipeline_scripts_dir }}"
docker_k8s_container: "k8s_deploy"
docker_build_additional_args: "."
docker_image_name: "${{ variables.docker_image_name }}"
docker_image_tag: "${{ variables.docker_image_tag }}"
docker_container_registry_name: "$(DOCKER_USERNAME)"
# Azure
azure_client_id: "$(ARM_CLIENT_ID)"
azure_client_secret: "$(ARM_CLIENT_SECRET)"
azure_tenant_id: "$(ARM_TENANT_ID)"
azure_subscription_id: "$(ARM_SUBSCRIPTION_ID)"

# Post build tasks, such as Test and Coverage upload, and publishing artefacts
- template: templates/steps/build/post-build-tasks.yml
parameters:
project_root_dir: "${{ variables.self_project_dir }}"
functional_test_project_root_dir: "${{ variables.self_functional_testproject_dir }}"
# Build Output File
# files to be persisted across stages
build_file: true
build_file_path: "${{ variables.build_artifact_deploy_path }}"
build_file_artefact_name: "${{ variables.build_artifact_deploy_name }}"
# Functional tests
functional_test: ${{ variables.functional_test }}
functional_test_artefact_name: "${{ variables.functional_test_artefact_name }}"
functional_test_artefact_path: "${{ variables.functional_test_artefact_path }}"
vulnerability_scan: "${{ variables.vulnerability_scan }}"
vulnerability_scan_report: "${{ variables.vulnerability_scan_report }}"
java_project_type: "${{ variables.java_project_type }}"
functional_test_project_type: "${{ variables.functional_test_project_type }}"

- stage: Dev
dependsOn: Build
Expand Down

0 comments on commit 5e7b524

Please sign in to comment.