Deploy a PaaS instance.
772852
def deploy(cls, remote_name, branch):
        """"""
        def get_remote_url(remote):
            return 'git config --local --get remote.%s.url' % (remote)

        remote_url = cls.exec_output(get_remote_url(remote_name)) \
            .replace('\n', '')

        if not remote_url or not re.search('gpaas.net|gandi.net', remote_url):
            remote_name = ('$(git config --local --get branch.%s.remote)' %
                           branch)
            remote_url = cls.exec_output(get_remote_url(remote_name)) \
                .replace('\n', '')

        error = None

        if not remote_url:
            error = True
            cls.echo('Error: Could not find git remote '
                     'to extract deploy url from.')
        elif not re.search('gpaas.net|gandi.net', remote_url):
            error = True
            cls.echo('Error: %s is not a valid Simple Hosting git remote.'
                     % (remote_url))
        if error:
            cls.echo("""This usually happens when:
- the current directory has no Simple Hosting git remote attached,
  in this case, please see $ gandi paas attach --help
- the local branch being deployed hasn't been pushed to the \
remote repository yet,
  in this case, please try $ git push <remote> %s
""" % (branch))
            cls.echo('Otherwise, it\'s recommended to use'
                     ' the --remote and/or --branch options:\n'
                     '$ gandi deploy --remote <remote> [--branch <branch>]')
            sys.exit(2)

        remote_url_no_protocol = remote_url.split('://')[1]
        splitted_url = remote_url_no_protocol.split('/')

        paas_access = splitted_url[0]
        deploy_git_host = splitted_url[1]

        command = "ssh %s 'deploy %s %s'" \
                  % (paas_access, deploy_git_host, branch)

        cls.execute(command)
262030
@TaskAction
  public void deployAllAction() throws AppEngineException {
    List<Path> deployables = new ArrayList<>();

    // Look for app.yaml
    Path appYaml = stageDirectory.toPath().resolve("app.yaml");
    if (!Files.isRegularFile(appYaml)) {
      throw new GradleException("Failed to deploy all: app.yaml not found.");
    }
    addDeployable(deployables, appYaml);

    // Look for configuration yamls
    String[] validYamls = {"cron.yaml", "dispatch.yaml", "dos.yaml", "index.yaml", "queue.yaml"};
    for (String yamlName : validYamls) {
      Path yaml = deployExtension.getAppEngineDirectory().toPath().resolve(yamlName);
      if (Files.isRegularFile(yaml)) {
        addDeployable(deployables, yaml);
      }
    }

    // Deploy
    Deployment deploy = gcloud.newDeployment(CloudSdkOperations.getDefaultHandler(getLogger()));

    DeployConfiguration deployConfig = deployExtension.toDeployConfiguration(deployables);
    deploy.deploy(deployConfig);
  }
67668
def clone(gandi, name, vhost, directory, origin):
    """"""
    if vhost != 'default':
        directory = vhost
    else:
        directory = name if not directory else directory

    return gandi.paas.clone(name, vhost, directory, origin)
199429
async def _deploy(self, charm_url, application, series, config,
                      constraints, endpoint_bindings, resources, storage,
                      channel=None, num_units=None, placement=None,
                      devices=None):
        
        log.info('Deploying %s', charm_url)

        # stringify all config values for API, and convert to YAML
        config = {k: str(v) for k, v in config.items()}
        config = yaml.dump({application: config},
                           default_flow_style=False)

        app_facade = client.ApplicationFacade.from_connection(
            self.connection())

        app = client.ApplicationDeploy(
            charm_url=charm_url,
            application=application,
            series=series,
            channel=channel,
            config_yaml=config,
            constraints=parse_constraints(constraints),
            endpoint_bindings=endpoint_bindings,
            num_units=num_units,
            resources=resources,
            storage=storage,
            placement=placement,
            devices=devices,
        )
        result = await app_facade.Deploy([app])
        errors = [r.error.message for r in result.results if r.error]
        if errors:
            raise JujuError('\n'.join(errors))
        return await self._wait_for_new('application', application)
1200488
protected function deploy()
    {
        // create deploy outputfile
        $this->createOutputFile($this->outputFile, false);

        // create undo deploy outputfile
        $this->createOutputFile($this->undoOutputFile, true);
    }
1013989
def deploy_service(ctx, path, name, regions, disabled):
    """"""
    enabled = False if disabled else True

    swag = create_swag_from_ctx(ctx)
    accounts = swag.get_all(search_filter=path)
    log.debug('Searching for accounts. Found: {} JMESPath: `{}`'.format(len(accounts), path))
    for a in accounts:
        try:
            if not swag.get_service(name, search_filter="[?id=='{id}']".format(id=a['id'])):
                log.info('Found an account to update. AccountName: {name} AccountNumber: {number}'.format(name=a['name'], number=a['id']))
                status = []
                for region in regions:
                    status.append(
                        {
                            'enabled': enabled,
                            'region': region

                         }
                    )
                a['services'].append(
                    {
                        'name': name,
                        'status': status
                     }
                )

                swag.update(a, dry_run=ctx.dry_run)
        except InvalidSWAGDataException as e:
            log.warning('Found a data quality issue. AccountName: {name} AccountNumber: {number}'.format(name=a['name'], number=a['id']))

    log.info('Service has been deployed to all matching accounts.')
728799
function deploy(params, cb) {
  params.resourcePath = config.addURIParams(constants.SERVICES_BASE_PATH + "/:guid/deploy", params);
  params.method = "POST";
  params.data = params.service;

  mbaasRequest.admin(params, cb);
}
301394
def create_api_pool_deploy(self):
        """"""
        return ApiPoolDeploy(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
1342170
def deploy(&block)
      in_directory do
        self.setup!
        self.push_with_retry!
        block.call(self, api_rate_limit.call, output) if block_given?
      end
    ensure
      self.teardown!
    end
522999
function createApi(projectInfo, awsDetails, callback) {
    return appsyncCreate.run(projectInfo, awsDetails).then(()=>{
        if(callback){
            callback()
        }
    })
}
1252962
public void deploy(ResourceAdapterArchive raa) throws Throwable
   {
      if (raa == null)
         throw new IllegalArgumentException("Url is null");

      if (!raa.getName().endsWith(".rar"))
         throw new IllegalArgumentException(raa.getName() + " doesn't end with .rar");

      if (!started)
         throw new IllegalStateException("Container not started");

      File parentDirectory = new File(SecurityActions.getSystemProperty("java.io.tmpdir"));
      File raaFile = new File(parentDirectory, raa.getName());

      if (shrinkwrapDeployments != null && shrinkwrapDeployments.contains(raaFile))
         throw new IOException(raa.getName() + " already deployed");

      if (raaFile.exists())
         recursiveDelete(raaFile);

      raa.as(ZipExporter.class).exportTo(raaFile, true);

      if (shrinkwrapDeployments == null)
         shrinkwrapDeployments = new ArrayList<File>(1);

      shrinkwrapDeployments.add(raaFile);

      log.debugf("Deploying: %s", raaFile);

      kernel.getMainDeployer().deploy(raaFile.toURI().toURL());
   }
1319848
def service(ctx):
    """"""

    install_service(ctx.obj['instance'], ctx.obj['dbhost'], ctx.obj['dbname'], ctx.obj['port'])
983603
def deploy
      connect do |http|
        response = http.post(uri('deploys'), '')
        check response
        log 'Deployed'
      end
    end
972570
def serve(self, host='127.0.0.1', port=5000):
        """"""
        from meinheld import server, middleware
        # self.app.run(host=host, port=port)
        server.listen((host, port))
        server.run(middleware.WebSocketMiddleware(self.app))
1348190
def attach(gandi, name, vhost, remote):
    
    return gandi.paas.attach(name, vhost, remote)
1333203
@TaskAction
  public void deployAction() throws AppEngineException {
    gcloud
        .newDeployment(CloudSdkOperations.getDefaultHandler(getLogger()))
        .deployQueue(deployExtension.toDeployProjectConfigurationConfiguration());
  }
548206
def serve(application, host='127.0.0.1', port=8080):
	""""""
	
	# Instantiate the server with a host/port configuration and our application.
	WSGIServer((host, int(port)), application).serve_forever()