diff --git a/.azure-pipelines/templates/jobs/setup_dependencies.yaml b/.azure-pipelines/templates/jobs/setup_dependencies.yaml index d3b041e8b..ad31ed1a4 100644 --- a/.azure-pipelines/templates/jobs/setup_dependencies.yaml +++ b/.azure-pipelines/templates/jobs/setup_dependencies.yaml @@ -15,6 +15,9 @@ parameters: - 'Prod Private Agent Pool' - 'Prod Private Agent Pool DS2' - 'Prod Private Agent Pool DS3' + - name: dependenciesBuildCores + type: number + default: 1 - name: dependenciesBuildTimeout type: number default: 60 @@ -51,5 +54,6 @@ jobs: parameters: makeJob: dependencies makeService: ${{parameters.serviceName}} + makeVars: 'CPU_CORES=${{parameters.dependenciesBuildCores}} STACK_CORES=${{parameters.dependenciesBuildCores}}' # (Note: a post-job for updating the dependency cache is automatically created, so no further step is due here.) \ No newline at end of file diff --git a/.azure-pipelines/templates/steps/make.yaml b/.azure-pipelines/templates/steps/make.yaml index f7143e56c..f134e3354 100644 --- a/.azure-pipelines/templates/steps/make.yaml +++ b/.azure-pipelines/templates/steps/make.yaml @@ -15,6 +15,9 @@ parameters: values: - frontend - backend + - name: makeVars + type: string + default: '' steps: - task: Bash@3 @@ -29,4 +32,4 @@ steps: inputs: targetType: inline script: | - make -- --${{parameters.makeJob}}-${{parameters.makeService}} IN_CONTAINER=true IN_CI=true PROJECT_DIR=${PROJECT_DIR} \ No newline at end of file + make -- --${{parameters.makeJob}}-${{parameters.makeService}} IN_CONTAINER=true IN_CI=true PROJECT_DIR=${PROJECT_DIR} ${{parameters.makeVars}} \ No newline at end of file diff --git a/azure-pipelines.yaml b/azure-pipelines.yaml index 1c2aeaf9d..5d7823bd0 100755 --- a/azure-pipelines.yaml +++ b/azure-pipelines.yaml @@ -34,6 +34,7 @@ parameters: - key: package.json | esbuild.config.mjs | utils/renamer.pl | utils/faviconize.pl | frontend/src/icons.scss path: assets/favicons/ buildPool: 'Prod Private Agent Pool' + buildCores: 1 buildTimeout: 60 buildArtifacts: | assets/icons/fradrive/*.svg @@ -53,6 +54,7 @@ parameters: - key: stack.yaml | stack.yaml.lock path: .stack/ buildPool: 'Prod Private Agent Pool DS3' + buildCores: 3 buildTimeout: 1440 buildArtifacts: | bin/* @@ -77,6 +79,7 @@ stages: serviceName: ${{service.name}} dependenciesCaches: ${{service.dependenciesCaches}} dependenciesBuildPool: ${{service.buildPool}} + dependenciesBuildCores: ${{service.buildCores}} dependenciesBuildTimeout: ${{service.buildTimeout}} - stage: Build @@ -111,6 +114,7 @@ stages: parameters: makeJob: compile makeService: ${{service.name}} + makeVars: 'CPU_CORES=${{service.buildCores}} STACK_CORES=${{service.buildCores}}' - task: CopyFiles@2 displayName: Prepare ${{service.name}} build artifacts for upload inputs: @@ -166,10 +170,12 @@ stages: parameters: makeJob: lint makeService: ${{service.name}} + makeVars: 'CPU_CORES=${{service.buildCores}} STACK_CORES=${{service.buildCores}}' - template: .azure-pipelines/templates/steps/make.yaml parameters: makeJob: test makeService: ${{service.name}} + makeVars: 'CPU_CORES=${{service.buildCores}} STACK_CORES=${{service.buildCores}}' - task: Docker@2 displayName: Logout from container registry inputs: