The task that handles both development and deployment
550790
function (options) {

  // This bundle is for our application
  var bundler = browserify({
    debug: options.debug, // Need that sourcemapping
    standalone: 'flux-react',
    // These options are just for Watchify
    cache: {}, packageCache: {}, fullPaths: options.watch
  })
    .require(require.resolve('./src/main.js'), { entry: true })
    .external('react');

  // The actual rebundle process
  var rebundle = function () {
    var start = Date.now();
    bundler.bundle()
      .on('error', gutil.log)
      .pipe(source(options.name))
      .pipe(gulpif(options.uglify, streamify(uglify())))
      .pipe(gulp.dest(options.dest))
      .pipe(notify(function () {

        // Fix for requirejs
        var fs = require('fs');
        var file = fs.readFileSync(options.dest + '/' + options.name).toString();
        file = file.replace('define([],e)', 'define(["react"],e)');
        fs.writeFileSync(options.dest + '/' + options.name, file);

        console.log('Built in ' + (Date.now() - start) + 'ms');

      }));

  };

  // Fire up Watchify when developing
  if (options.watch) {
    bundler = watchify(bundler);
    bundler.on('update', rebundle);
  }

  return rebundle();

}
1115901
def prepare
      started_at = DateTime.now.to_s
      prepare_deploy
      prepare_common_installation
      puppet_installation
      create_prepare_checkpoint(started_at)
    end
859861
function setupByCopy() {
    let task_dir;
    let required_tasks;

    try {
        const config = require(path.join(process.cwd(), 'project.config'));
        required_tasks = config.required_tasks;
        if (!required_tasks) {
            throw Error('no task required.');
        }
        task_dir = config.dir.task;
        if (!task_dir) {
            throw Error('task directory not defined.');
        }
    } catch (error) {
        console.warn(error);
        process.exit(0);
    }

    const dstTaskDir = path.join(process.cwd(), task_dir);
    if (!fs.existsSync(dstTaskDir)) {
        // create tasks dir
        fs.mkdirSync(dstTaskDir);
    }

    required_tasks.forEach((task) => {
        const src = path.join(__dirname, 'tasks', task);
        const dst = path.join(dstTaskDir, task);
        if (fs.existsSync(src)) {
            if (fs.existsSync(dst)) {
                fs.unlinkSync(dst);
            }
            fs.writeFileSync(dst, fs.readFileSync(src).toString());
        } else {
            console.error('task not found: ' + task);
            process.exit(1);
        }
    });
}
771917
def save(self):
        
        task.save_new_environment(self.name, self.datadir, self.target,
            self.ckan_version, self.deploy_target, self.always_prod)
1014446
def deploy(options)
      # Initialize directory settings
      AgentConfig.root_dir = options[:root_dir]
      AgentConfig.cfg_dir = options[:cfg_dir]
      AgentConfig.pid_dir = options[:pid_dir]

      # Configure agent
      cfg = load_init_cfg
      check_agent(options, cfg)
      cfg = configure(options, cfg)

      # Persist configuration
      persist(options, cfg)

      # Setup agent monitoring
      monitor(options) if options[:monit]
      true
    end
1309800
function(tasksConfig) {
  _setupVersioningTasks();
  _setupLazyPluginLoadingTasks();
  _setupCssTasks();
  _setupTemplatesTasks();
  _setupTestsTasks(tasksConfig);
  _setupScriptsTasks(tasksConfig);
  _setupUtilsTasks();
}
1237689
def deploy(project, version, promote, quiet):
    
    from . import logic

    logic.deploy(project, version, promote, quiet)
175783
def build_backend(tasks, default_host=('127.0.0.1', DEFAULT_PORT), *args, 
                  **kw):
    
    host, port = default_host
    if len(sys.argv) > 1:
        host = sys.argv[1]
    if len(sys.argv) > 2:
        port = sys.argv[2]
    
    return BackEnd(tasks, host, port, *args, **kw)
499281
public function registerTasks(Workflow $workflow, Deployment $deployment)
    {
        parent::registerTasks($workflow, $deployment);

        $this->checkIfMandatoryOptionsExist();
        $this->buildConfiguration();
        $this->defineTasks($workflow, $deployment);

        if ($this->getOption('enableTests') !== false) {
            $workflow
                ->addTask([
                    UnitTestTask::class,
                    FunctionalTestTask::class
                ], 'test', $this);
        }

        $workflow->addTask([
                'TYPO3\\Surf\\DefinedTask\\CreateZipDistributionTask',
                'TYPO3\\Surf\\DefinedTask\\CreateTarGzDistributionTask',
                'TYPO3\\Surf\\DefinedTask\\CreateTarBz2DistributionTask',
            ], 'cleanup', $this);

        if ($this->hasOption('enableSourceforgeUpload') && $this->getOption('enableSourceforgeUpload') === true) {
            $workflow->addTask(SourceforgeUploadTask::class, 'cleanup', $this);
        }
        if ($this->hasOption('releaseHost')) {
            $workflow->addTask(PrepareReleaseTask::class, 'initialize', $this);
            $workflow->addTask(ReleaseTask::class, 'cleanup', $this);
        }
        if ($this->hasOption('releaseHost') && $this->hasOption('enableSourceforgeUpload') && $this->getOption('enableSourceforgeUpload') === true) {
            $workflow->addTask(AddDownloadTask::class, 'cleanup', $this);
        }
        if ($this->hasOption('createTags') && $this->getOption('createTags') === true) {
            $workflow->addTask(TagTask::class, 'cleanup', $this);
            if ($this->hasOption('TYPO3\\Surf\\DefinedTask\\Git\\PushTagsTask') && $this->getOption('TYPO3\\Surf\\DefinedTask\\Git\\PushTagsTask') === true) {
                $workflow->afterTask(TagTask::class, 'TYPO3\\Surf\\DefinedTask\\Git\\PushTagsTask', $this);
            }
        }

        $workflow->removeTask(MigrateTask::class);
    }
346039
public void deployManaged(@Observes DeployManagedDeployments event) throws Exception {
        forEachManagedDeployment(new Operation<Container, Deployment>() {
            @Inject
            private Event<DeploymentEvent> event;

            @Override
            public void perform(Container container, Deployment deployment) throws Exception {
                //when a container is manually controlled, the deployment is deployed automatically
                //once the container is manually started, not now
                if (!"manual".equals(container.getContainerConfiguration().getMode())) {
                    if (container.getState() != State.STARTED) {
                        throw new IllegalStateException("Trying to deploy a managed deployment "
                            + deployment.getDescription().getName()
                            + " to a non started managed container "
                            + container.getName());
                    }
                    event.fire(new DeployDeployment(container, deployment));
                }
            }
        });
    }
435143
def script_deployment(path, script, submap=None):

    """"""

    if submap is None:
        submap = {}
    script = substitute(script, submap)
    return libcloud.compute.deployment.ScriptDeployment(script, path)
818362
def _setup_task(self, load):
        

        if not self._task:
            self._task = Task(self._data_dir)

        if load:
            self._task.load()
918503
def _deploy(self):
        """"""
        timeout = int(os.environ.get('AMULET_SETUP_TIMEOUT', 900))
        try:
            self.d.setup(timeout=timeout)
            self.d.sentry.wait(timeout=timeout)
        except amulet.helpers.TimeoutError:
            amulet.raise_status(
                amulet.FAIL,
                msg="Deployment timed out ({}s)".format(timeout)
            )
        except Exception:
            raise
669258
public function main()
    {

        // load the interval we want to scan the directory
        $interval = $this->getInterval();

        // load the configured directory
        $directory = $this->getDirectory();

        // prepare the extensions of the file we want to watch
        $extensionsToWatch = sprintf('{%s}', implode(',', $this->getExtensionsToWatch()));

        // log the configured deployment directory
        $this->getSystemLogger()->info(
            sprintf('Start scanning directory %s for files to be rotated (interval %d)', $directory, $interval)
        );

        // watch the configured directory
        while (true) {
            // clear the filesystem cache
            clearstatcache();

            // iterate over the files to be watched
            foreach (glob($directory . '/*.' . $extensionsToWatch, GLOB_BRACE) as $fileToRotate) {
                // log that we're rotate the file
                $this->getSystemLogger()->debug(
                    sprintf('Query wheter it is necessary to rotate %s', $fileToRotate)
                );

                // handle file rotation
                $this->handle($fileToRotate);

                // cleanup files
                $this->cleanup($fileToRotate);
            }

            // sleep a while
            sleep($interval);
        }
    }
259491
public function postDeploy() {
    $terminus_site_env = $this->getPantheonSiteEnv();
    $pantheon_prefix   = getenv('TERMINUS_SITE');
    if ($terminus_site_env == $pantheon_prefix . '.develop' || $terminus_site_env == $pantheon_prefix . '.dev') {
      $drush_commands = [
        'drush_partial_config_import' => "terminus remote:drush $terminus_site_env -- config-import --partial -y",
        'drush_cache_clear' => "terminus remote:drush $terminus_site_env -- cr",
        'drush_entity_updates' => "terminus remote:drush $terminus_site_env -- entity-updates -y",
        'drush_update_database' => "terminus remote:drush $terminus_site_env -- updb -y",
        'drush_full_config_import' => "terminus remote:drush $terminus_site_env -- config-import -y",
      ];
      // Run the installation.
      $result = $this->taskExec(implode(' && ', $drush_commands))
        ->run();
    }
  }
56756
protected void onApplicationConfigurations()
	{
		// set configuration before the application configuration...
		onBeforeApplicationConfigurations();
		// set global configurations for both development and deployment mode...
		onGlobalSettings();
		// set configuration for development...
		if (RuntimeConfigurationType.DEVELOPMENT.equals(this.getConfigurationType()))
		{
			onDevelopmentModeSettings();
		}
		// set configuration for deployment...
		if (RuntimeConfigurationType.DEPLOYMENT.equals(this.getConfigurationType()))
		{
			onDeploymentModeSettings();
		}
	}
729982
def populate
      task = ForemanTasks.async_task ::Actions::Staypuft::Deployment::Populate,
                                     Deployment.find(params[:id]),
                                     fake:   !!params[:fake],
                                     assign: !!params[:assign]
      redirect_to foreman_tasks_task_url(id: task)
    end