<commit_before>'use strict';

import {CLOUD_PROVIDER_REGISTRY} from 'core/cloudProvider/cloudProvider.registry';
import {SERVER_GROUP_COMMAND_BUILDER_SERVICE} from 'core/serverGroup/configure/common/serverGroupCommandBuilder.service';
import {StageConstants} from 'core/pipeline/config/stages/stageConstants';

let angular = require('angular');

module.exports = angular.module('spinnaker.core.pipeline.stage.deployStage', [
  CLOUD_PROVIDER_REGISTRY,
  SERVER_GROUP_COMMAND_BUILDER_SERVICE,
])
  .config(function (pipelineConfigProvider, cloudProviderRegistryProvider) {
    pipelineConfigProvider.registerStage({
      label: 'Deploy',
      description: 'Deploys the previously baked or found image',
      strategyDescription: 'Deploys the image specified',
      key: 'deploy',
      templateUrl: require('./deployStage.html'),
      executionDetailsUrl: require('./deployExecutionDetails.html'),
      controller: 'DeployStageCtrl',
      controllerAs: 'deployStageCtrl',
      defaultTimeoutMs: 60 * 60 * 1000, // 60 minutes
      validators: [
        {
          type: 'stageBeforeType',
          stageTypes: ['bake', 'findAmi', 'findImage', 'findImageFromTags'],
          message: 'You must have a Bake or Find Image stage before any deploy stage.',
          skipValidation: (pipeline, stage) => {
            if (!stage.clusters || !stage.clusters.length) {
              return true;
            }
            return stage.clusters.every(cluster =>
              cloudProviderRegistryProvider.$get().getValue(cluster.provider, 'serverGroup.skipUpstreamStageCheck')
            );
          }
        },
      ],
      accountExtractor: (stage) => (stage.context.clusters || []).map(c => c.account),
      configAccountExtractor: (stage) => (stage.clusters || []).map(c => c.account),
      strategy: true,
    });
  })
  .controller('DeployStageCtrl', function ($injector, $scope, $uibModal, stage, namingService, providerSelectionService,
                                           cloudProviderRegistry, serverGroupCommandBuilder, serverGroupTransformer) {
    $scope.stage = stage;<commit_msg>fix(executions): add alias to deploy for v3 executions<commit_after>'use strict';

import {CLOUD_PROVIDER_REGISTRY} from 'core/cloudProvider/cloudProvider.registry';
import {SERVER_GROUP_COMMAND_BUILDER_SERVICE} from 'core/serverGroup/configure/common/serverGroupCommandBuilder.service';
import {StageConstants} from 'core/pipeline/config/stages/stageConstants';

let angular = require('angular');

module.exports = angular.module('spinnaker.core.pipeline.stage.deployStage', [
  CLOUD_PROVIDER_REGISTRY,
  SERVER_GROUP_COMMAND_BUILDER_SERVICE,
])
  .config(function (pipelineConfigProvider, cloudProviderRegistryProvider) {
    pipelineConfigProvider.registerStage({
      label: 'Deploy',
      description: 'Deploys the previously baked or found image',
      strategyDescription: 'Deploys the image specified',
      key: 'deploy',
      alias: 'createServerGroup',
      templateUrl: require('./deployStage.html'),
      executionDetailsUrl: require('./deployExecutionDetails.html'),
      controller: 'DeployStageCtrl',
      controllerAs: 'deployStageCtrl',
      defaultTimeoutMs: 60 * 60 * 1000, // 60 minutes
      validators: [
        {
          type: 'stageBeforeType',
          stageTypes: ['bake', 'findAmi', 'findImage', 'findImageFromTags'],
          message: 'You must have a Bake or Find Image stage before any deploy stage.',
          skipValidation: (pipeline, stage) => {
            if (!stage.clusters || !stage.clusters.length) {
              return true;
            }
            return stage.clusters.every(cluster =>
              cloudProviderRegistryProvider.$get().getValue(cluster.provider, 'serverGroup.skipUpstreamStageCheck')
            );
          }
        },
      ],
      accountExtractor: (stage) => (stage.context.clusters || []).map(c => c.account),
      configAccountExtractor: (stage) => (stage.clusters || []).map(c => c.account),
      strategy: true,
    });
  })
  .controller('DeployStageCtrl', function ($injector, $scope, $uibModal, stage, namingService, providerSelectionService,
                                           cloudProviderRegistry, serverGroupCommandBuilder, serverGroupTransformer) {
    $scope.stage = stage;
{'fraction_non_alphanumeric': 0.11845473586222946, 'fraction_numerical': 0.004887130556202001, 'mean_word_length': 3.359026369168357, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2405361', 'n_tokens_mistral': 1173, 'n_tokens_neox': 1157, 'n_words': 238}