
                            S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  SSKJr  SSK	J
r
  SS	KJr  SS
KJr  SSKJr  SSSS.r\
R"                  " \
R$                  R&                  5      \
R(                   " S S\
R*                  5      5       5       r\
R"                  " \
R$                  R.                  5      \
R(                   " S S\
R*                  5      5       5       r\\l        \\l        g)zThe gcloud app deploy command.    )absolute_import)division)unicode_literalsN)appengine_api_client)runtime_builders)base)deploy_util)log)
propertiesEDeploy the local code and/or configuration of your app to App Engine.a      This command is used to deploy both code and configuration to the App
    Engine server. As an input it takes one or more DEPLOYABLES that should be
    uploaded. A DEPLOYABLE can be a service's .yaml file or a configuration's
    .yaml file (for more information about configuration files specific to your
    App Engine environment, refer to
    https://cloud.google.com/appengine/docs/standard/configuration-files
    or
    https://cloud.google.com/appengine/docs/flexible/configuration-files).
    Note, for Java 8 Standard apps or Java 11/17/21 Standard apps using bundled
    services, you must add the path to the appengine-web.xml file inside the
    WEB-INF directory. gcloud app deploy skips files specified in the
    .gcloudignore file (see gcloud topic gcloudignore for more information).
    For Java 11 Standard, you can either use the yaml file, a Maven pom.xml, or
    a Gradle build.gradle. Alternatively, if the application is a single
    self-contained jar, you can give the path to the jar and a simple service
    configuration will be generated. You can deploy Java 11 Maven source
    projects by specifying the location of your project's pom.xml file, and it
    will be built and deployed using App Engine Buildpacks.
        a          To deploy a single service, run:

          $ {command} ~/my_app/app.yaml

        To deploy an App Engine Standard Java8 service or a Java11 service using bundled services, run:

          $ {command} ~/my_app/WEB-INF/appengine-web.xml

        To deploy an App Engine Standard Java11 single jar, run:

          $ {command} ~/my_app/my_jar.jar

        To deploy an App Engine Standard Java11 Maven source project, run:

          $ {command} ~/my_app/pom.xml

        To deploy an App Engine Standard Java11 Gradle source project, run:

          $ {command} ~/my_app/build.gradle

        By default, the service is deployed  to the current project configured
        via:

          $ gcloud config set core/project PROJECT

        To override this value for a single deployment, use the ``--project''
        flag:

          $ {command} ~/my_app/app.yaml --project=PROJECT

        To deploy multiple services, run:

          $ {command} ~/my_app/app.yaml ~/my_app/another_service.yaml

        To change the default --promote behavior for your current
        environment, run:

          $ gcloud config set app/promote_by_default false

        To deploy a service that will run as a service account, run:

          $ {command} ~/my_app/app.yaml --service-account=SERVICE_ACCOUNT
        )briefDESCRIPTIONEXAMPLESc                   4    \ rS rSrSr\S 5       rS rS rSr	g)DeployGAf   r   c                 0    [         R                  " U 5        gzGet arguments for this command.Nr	   
ArgsDeployparsers    lib/surface/app/deploy.pyArgsDeployGA.Argsk        6"    c           
         [         R                  " [        R                  R                  5      n[
        R                  " U R                  5       5      nU[        R                  R                  :w  a0  U R                  5       (       a  [         R                  R                  nO[         R                  R                  n[         R                  " UUUS[         R                  " US9S9$ )NFdefault_strategy)runtime_builder_strategyparallel_buildflex_image_build_option)r	   GetRuntimeBuilderStrategyr   ReleaseTrackGAr   GetApiClientForTrackr   RuntimeBuilderStrategyNEVER_ServerSideExperimentEnabledFlexImageBuildOptions	ON_SERVER	ON_CLIENT	RunDeployGetFlexImageBuildOption)selfargsr!   
api_clientflex_image_build_option_defaults        r   RunDeployGA.Runp   s    *DD %::4;L;L;NOJ //55	6))++(3(I(I(S(S%(3(I(I(S(S%  !9 + C C<!
 r   c                 R   [         R                  R                  R                  R	                  SS9n [
        R                  R                  U5      nUR                  [
        R                  R                  S5      n[        [        R                  " [         R                  R                  R                  R	                  5       R                  S5      5      R!                  5       S5      S-  nXC:  $ ! [
        R"                   a"  n[$        R&                  " SU-  SS9   S	nAg
S	nAff = f)aa  Evaluates whether the build on server-side experiment is enabled for the project.

  The experiment is enabled for a project if the sha256 hash of the
  projectID mod 100 is smaller than the current experiment rollout percent.

Returns:
  false if the experiment is not enabled for this project or the
  experiment config cannot be read due to an error
T)requiredr   zutf-8   d   zzExperiment config file could not be read. This error is informational, and does not cause a deployment to fail. Reason: %s)exc_infoNF)r   VALUESappruntime_builders_rootGetr   ExperimentsLoadFromURIGetExperimentPercentWithDefaultTRIGGER_BUILD_SERVER_SIDEinthashlibsha256coreprojectencode	hexdigestExperimentsErrorr
   debug)r0   runtimes_builder_rootexperiment_configexperiment_percentproject_hashes         r   r*   %DeployGA._ServerSideExperimentEnabled   s    '--11GGKK L *66BB
!,LL

&
&
@
@!E
..$$,,00299'BDDMIK
 l ..,, 	ii%)+ s   B<C0 0D&D!!D& N)
__name__
__module____qualname____firstlineno____doc__staticmethodr   r4   r*   __static_attributes__rR   r   r   r   r   f   s$     N# #(r   r   c                   .    \ rS rSrSr\S 5       rS rSrg)
DeployBeta   r   c                 0    [         R                  " U 5        gr   r   r   s    r   r   DeployBeta.Args   r   r   c                 ,   [         R                  " [        R                  R                  5      n[
        R                  " U R                  5       5      n[         R                  " UUSUS[         R                  " [         R                  R                  S9S9$ )NTr   )use_beta_stagerr!   r"   r#   )r	   r$   r   r%   BETAr   r'   r.   r/   r+   r,   )r0   r1   r!   r2   s       r   r4   DeployBeta.Run   s}    *DD  %::4;L;L;NOJ  !9 + C C(>>HH!JK Kr   rR   N)	rS   rT   rU   rV   rW   rX   r   r4   rY   rR   r   r   r[   r[      s      N# #Kr   r[   )rW   
__future__r   r   r   rD   googlecloudsdk.api_lib.appr   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.appr	   googlecloudsdk.corer
   r   _DETAILED_HELPReleaseTracksr%   r&   DefaultUniverseOnlySilentCommandr   ra   r[   detailed_helprR   r   r   <module>rm      s    % &  '  ; 7 ( 6 # *	*+	3EP D%%(()7t!! 7  *7t D%%**+K## K  ,K, ( )
 r   