|
| 1 | +# Default configuration used by CI/CD. |
| 2 | +# You can run locally 'mchbuild build' to create the images, |
| 3 | +# 'mchbuild test' to run the tests using the images. The 'deploy' steps |
| 4 | +# can be run separately. |
| 5 | +default: |
| 6 | + - build: |
| 7 | + - getVersion: |
| 8 | + gitCalculateVersion: |
| 9 | + - imageTester: |
| 10 | + containerBuildImage: |
| 11 | + fullImageName: ${var.image}-tester |
| 12 | + target: tester |
| 13 | + extraArgs: |
| 14 | + - --build-arg |
| 15 | + - VERSION=${var.version} |
| 16 | + - imageRunner: |
| 17 | + containerBuildImage: |
| 18 | + fullImageName: ${var.image} |
| 19 | + target: runner |
| 20 | + extraArgs: |
| 21 | + - --build-arg |
| 22 | + - VERSION=${var.version} |
| 23 | + pullAlways: false |
| 24 | + - docs: |
| 25 | + - script: mkdir -p doc/_build |
| 26 | + - pythonDocs: |
| 27 | + fullImageName: ${var.image}-tester |
| 28 | + packageManager: '' |
| 29 | + pullAlways: false |
| 30 | + - test: |
| 31 | + - getVersion: |
| 32 | + gitCalculateVersion: |
| 33 | + - unit: |
| 34 | + - script: mkdir -p test_reports |
| 35 | + - pythonTest: |
| 36 | + fullImageName: ${var.image}-tester |
| 37 | + packageManager: '' |
| 38 | + pullAlways: false |
| 39 | + - pythonCoverage: |
| 40 | + fullImageName: ${var.image}-tester |
| 41 | + packageManager: '' |
| 42 | + pullAlways: false |
| 43 | + - lint: |
| 44 | + - script: mkdir -p test_reports |
| 45 | + - pythonLint: |
| 46 | + fullImageName: ${var.image}-tester |
| 47 | + packageManager: '' |
| 48 | + pullAlways: false |
| 49 | + - pythonTypeChecker: |
| 50 | + fullImageName: ${var.image}-tester |
| 51 | + packageManager: '' |
| 52 | + pullAlways: false |
| 53 | + - verify: |
| 54 | + - imageSecurityScan: |
| 55 | + - securityReport: |
| 56 | + format: [ 'html', 'sbom', 'table', 'print'] |
| 57 | + severity: [ 'CRITICAL', 'HIGH' ] |
| 58 | + removeLocalImage: false |
| 59 | + pullAlways: false |
| 60 | + qualityGate: |
| 61 | + threshold: 20 |
| 62 | + criticalFactor: 5 |
| 63 | + highFactor: 1 |
| 64 | + - publishSbom: |
| 65 | + - securityPublishSbom: |
| 66 | + - deploy: |
| 67 | + - addNextTag: |
| 68 | + gitAddNextTag: |
| 69 | + - addTag: |
| 70 | + gitAddTag: |
| 71 | + - docs: |
| 72 | + openshiftPublishDocs: |
| 73 | + docSrc: doc/_build/ |
| 74 | + docType: python |
| 75 | + - image: |
| 76 | + containerPublishImage: |
| 77 | + removeLocalImage: false |
| 78 | + - cpDelete: |
| 79 | + openshiftDelete: |
| 80 | + - cp: |
| 81 | + openshiftDeploy: |
| 82 | + restartDeployment: false |
| 83 | + - clean: |
| 84 | + - getVersion: |
| 85 | + gitCalculateVersion: |
| 86 | + - images: |
| 87 | + script: | |
| 88 | + if test -n "${var.version}"; then |
| 89 | + podman image rm -f $(podman image ls -q \ |
| 90 | + -f "label=ch.meteoswiss.project=${var.project}-${var.version}") || : |
| 91 | + fi |
| 92 | +
|
| 93 | +# Alternative configuration to install and test the service locally using |
| 94 | +# the local Python installation. Besides 'mchbuild local.build' and |
| 95 | +# 'mchbuild local.test' it is possible to run the job using |
| 96 | +# 'mchbuild local.run'. |
| 97 | +local: |
| 98 | + - build: |
| 99 | + - install: |
| 100 | + pythonInstall: |
| 101 | + - docs: |
| 102 | + pythonDocs: |
| 103 | + - format: |
| 104 | + pythonFormat: |
| 105 | + inPlace: true |
| 106 | + - test: |
| 107 | + - unit: |
| 108 | + - script: mkdir -p test_reports |
| 109 | + - pythonTest: |
| 110 | + - pythonCoverage: |
| 111 | + - lint: |
| 112 | + - script: mkdir -p test_reports |
| 113 | + - pythonLint: |
| 114 | + - pythonTypeChecker: |
| 115 | + - run: |
| 116 | + - main: |
| 117 | + - pythonRun: |
| 118 | + commands: realtime-pollen-calibration update_phenology --help |
| 119 | + |
| 120 | +# Configuration to install and test the python project |
| 121 | +# on top of a conda environment using micromamba to set it up |
| 122 | +conda: |
| 123 | + - build: |
| 124 | + - getVersion: |
| 125 | + gitCalculateVersion: |
| 126 | + - install: |
| 127 | + pythonRun: |
| 128 | + packageManager: micromamba |
| 129 | + commands: | |
| 130 | + micromamba create -y -n ${var.project}-${var.version} --file conda_deps.yml --rc-file .mambarc && |
| 131 | + micromamba run -n ${var.project}-${var.version} poetry install && |
| 132 | + echo "Activate your environment with 'micromamba activate ${var.project}-${var.version}'" |
| 133 | + - test: |
| 134 | + - getVersion: |
| 135 | + gitCalculateVersion: |
| 136 | + - unit: |
| 137 | + pythonRun: |
| 138 | + packageManager: micromamba |
| 139 | + commands: | |
| 140 | + micromamba run -n ${var.project}-${var.version} bash -c "mchbuild local.test.unit" |
| 141 | + - lint: |
| 142 | + pythonRun: |
| 143 | + packageManager: micromamba |
| 144 | + commands: | |
| 145 | + micromamba run -n ${var.project}-${var.version} bash -c "mchbuild local.test.lint" |
| 146 | + - run: |
| 147 | + - getVersion: |
| 148 | + gitCalculateVersion: |
| 149 | + - main: |
| 150 | + - pythonRun: |
| 151 | + packageManager: micromamba |
| 152 | + commands: | |
| 153 | + micromamba run -n ${var.project}-${var.version} bash -c "mchbuild local.run.main" |
| 154 | + - clean: |
| 155 | + - getVersion: |
| 156 | + gitCalculateVersion: |
| 157 | + - deleteCondaEnv: |
| 158 | + pythonRun: |
| 159 | + packageManager: micromamba |
| 160 | + commands: | |
| 161 | + micromamba env remove -y -n ${var.project}-${var.version} |
| 162 | +
|
| 163 | +variables: |
| 164 | + project: realtime-pollen-calibration |
| 165 | + solution: icon |
0 commit comments