<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>deployment Archives | Clever Cloud</title>
	<atom:link href="https://www.clever.cloud/blog/tag/deployment/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.clever.cloud/blog/tag/deployment/</link>
	<description>From Code to Product</description>
	<lastBuildDate>Fri, 24 Oct 2025 07:17:00 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://cdn.clever-cloud.com/uploads/2023/03/cropped-cropped-favicon-32x32.png</url>
	<title>deployment Archives | Clever Cloud</title>
	<link>https://www.clever.cloud/blog/tag/deployment/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Deploy a Scala / Akka application with PostgreSQL integration</title>
		<link>https://www.clever.cloud/blog/engineering/2022/06/09/deploy-a-scala-akka-application-with-postgresql-integration/</link>
		
		<dc:creator><![CDATA[Geoffrey GUILBON]]></dc:creator>
		<pubDate>Thu, 09 Jun 2022 12:44:32 +0000</pubDate>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[Scala]]></category>
		<guid isPermaLink="false">https://www.clever-cloud.com/?p=6509</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2022/06/akka.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="akka" decoding="async" fetchpriority="high" srcset="https://cdn.clever-cloud.com/uploads/2022/06/akka.png 1400w, https://cdn.clever-cloud.com/uploads/2022/06/akka-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2022/06/akka-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2022/06/akka-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2022/06/akka-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p><!-- wp:media-text {"align":"wide","mediaId":6749,"mediaType":"image","mediaWidth":30} -->
<div class="wp-block-media-text alignwide is-stacked-on-mobile" style="grid-template-columns:30% auto"><figure class="wp-block-media-text__media"><img src="https://cdn.clever-cloud.com/uploads/2022/06/akkatoolkitlogo-2-318x131.png" alt="" class="wp-image-6749 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph -->
<p>When I started working at Clever Cloud, I spent some time messing around with the platform and its tooling. This blog post will present you how I managed to:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>create a simple Scala/Akka HTTP template application with PostgreSQL persistence</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>link the application to a managed PostgreSQL</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>deploy it</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>try it!</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></div></div>
<!-- /wp:media-text -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Create a Scala/Akka HTTP template 🔨</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Get the sources</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><a href="https://github.com/CleverCloud/scala-akka-http-postgres-example">Clone</a> the project generated from Akka Github <a href="https://github.com/akka/akka-http-quickstart-scala.g8" target="_blank" rel="noreferrer noopener">quick start template</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This service provides the ability to manage a simple in-memory user registry exposing 4 routes:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>List all users</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Get a specific user</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Create a user</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Delete a user</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>A thorough description of available the cURL commands may be found <a href="https://developer.lightbend.com/guides/akka-http-quickstart-scala/#cURL-commands" target="_blank" rel="noreferrer noopener">here</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Add extra features</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>A few functionalities have been added on top of the original example:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>store the registry into a PostgreSQL database (instead of in memory)</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>read database parameters from <a href="https://www.clever.cloud/blog/fonctionnalites/2022/03/22/improving-our-environment-variables-editor/">environment variables</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>add a hardcoded basic authentication</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>All parameters may be specified in the <a href="https://github.com/CleverCloud/scala-akka-http-postgres-example/blob/master/src/main/resources/application.conf">application.conf</a> file:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>basic auth</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>database parameters</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>Parameters are fetched from environment variables, or the specified default value if none is found</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">app {
  basic-auth {
    user = "foo"
    user = ${?BASIC_AUTH_USER}
    password = "bar"
    password = ${?BASIC_AUTH_PASSWORD}
  }
  routes {
    # If ask takes more time than this to complete the request is failed
    ask-timeout = 5s
  }

  db {
    host = "localhost"
    host = ${?POSTGRESQL_ADDON_HOST}
    port = "5432"
    port = ${?POSTGRESQL_ADDON_PORT}
    database = "postgres"
    database = ${?POSTGRESQL_ADDON_DB}
    user = "login"
    user = ${?POSTGRESQL_ADDON_USER}
    pass = "pass"
    pass = ${?POSTGRESQL_ADDON_PASSWORD}
  }
}</code></pre>
<!-- /wp:html -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Run the application using Clever Cloud CLI 🚀</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Create a Clever Cloud application</h3>
<!-- /wp:heading -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever create --type sbt myakka --region par --org testorg</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>This command creates a new application</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>of type sbt for <a href="https://www.clever.cloud/product/applications-scala/">Scala</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>named <em>myakka</em></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>in <em>Paris</em> region</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>inside my test organisation <em>testorg</em></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Enable a dedicated build instance for faster build (optional pro tip)</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>By default a newly created application will run an XS instance which are quite small for building Scala applications fast. One way to build faster is to use a dedicated build Instance: In the Clever Cloud console, got to your application -&gt; options, and check the box <code>[] Enable dedicated build instance</code> This way you can keep your XS instance for running the application, but you can choose an XL for the build time. Or with the command line tool:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever scale -a myakka --build-flavor XL</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Create a PostgreSQL database</h3>
<!-- /wp:heading -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever addon -l myakka create postgresql-addon myakkadb</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>This command orders a PostgreSQL add-on instance and link it to <code><em>myakka</em></code>, injecting the right environment variables into the application instance to contact the database.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Database creation and migration is performed using <a href="https://flywaydb.org/">flywaydb</a> tool. Those script may be found in the <a href="https://github.com/CleverCloud/scala-akka-http-postgres-example/tree/master/src/main/resources/db/migration">migration/db</a> directory of the application resources.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Migration will be automatically called once you specify the proper build hook in the environment variables</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><kbd>CC_POST_BUILD_HOOK</kbd> with value <kbd><kbd>sbt flywayMigrate</kbd></kbd></p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever env -a myakka set <kbd>CC_POST_BUILD_HOOK</kbd> "sbt flywayMigrate"</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Configure basic auth environment variables</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Basic authentication login and password can be specified as environment variables using the <kbd>clever env</kbd> command. If none is found, basic authentication will default to <em>application.conf</em> file values</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever env -a myakka set BASIC_AUTH_USER &lt;YOUR_AUTH_USER&gt;
clever env -a myakka set BASIC_AUTH_PASSWORD &lt;YOUR_AUTH_PASSWORD&gt;</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Link your local repo with your Clever Cloud application instance</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Retrieve your application id with</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever applications</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Then link the local repository to the application (creating a <em>.clever.json</em> file)</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever link app_&lt;UUID&gt;</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Deploy</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>You are now ready to deploy and run your code, just run</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever deploy</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>You are now able to follow the deployment process until it completes successfully</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Your application is running now!</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Try it</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>It's time to experiment with it using <kbd>curl</kbd> or your favorite GUI</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading">Add a user</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Adapt this command in order to insert a new user into the registry:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">curl --request POST \
  --url https://app-&lt;UUID&gt;.cleverapps.io/users \
  --header 'Content-type: application/json' \
  -u '&lt;YOUR_AUTH_USER&gt;:&lt;YOUR_AUTH_PASSWORD&gt;' \
  --data '{
  "name": "Serge",
  "age": 42,
  "countryOfResidence": "Greenland"
}'

{
	"description": "User Serge created."
}</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading">Get all users</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Check that the user has been properly created, by getting the list of users:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">curl --request GET \
  --url https://app-&lt;UUID&gt;.cleverapps.io/users \
  -u '&lt;YOUR_AUTH_USER&gt;:&lt;YOUR_AUTH_PASSWORD&gt;'

{"users":[{"age":42,"countryOfResidence":"Greenland","name":"Serge"}]}</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>It works, Success! 🎉</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2022/06/akka.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="akka" decoding="async" srcset="https://cdn.clever-cloud.com/uploads/2022/06/akka.png 1400w, https://cdn.clever-cloud.com/uploads/2022/06/akka-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2022/06/akka-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2022/06/akka-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2022/06/akka-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p><!-- wp:media-text {"align":"wide","mediaId":6749,"mediaType":"image","mediaWidth":30} -->
<div class="wp-block-media-text alignwide is-stacked-on-mobile" style="grid-template-columns:30% auto"><figure class="wp-block-media-text__media"><img src="https://cdn.clever-cloud.com/uploads/2022/06/akkatoolkitlogo-2-318x131.png" alt="" class="wp-image-6749 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:paragraph -->
<p>When I started working at Clever Cloud, I spent some time messing around with the platform and its tooling. This blog post will present you how I managed to:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>create a simple Scala/Akka HTTP template application with PostgreSQL persistence</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>link the application to a managed PostgreSQL</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>deploy it</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>try it!</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></div></div>
<!-- /wp:media-text -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Create a Scala/Akka HTTP template 🔨</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Get the sources</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><a href="https://github.com/CleverCloud/scala-akka-http-postgres-example">Clone</a> the project generated from Akka Github <a href="https://github.com/akka/akka-http-quickstart-scala.g8" target="_blank" rel="noreferrer noopener">quick start template</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This service provides the ability to manage a simple in-memory user registry exposing 4 routes:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>List all users</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Get a specific user</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Create a user</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Delete a user</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>A thorough description of available the cURL commands may be found <a href="https://developer.lightbend.com/guides/akka-http-quickstart-scala/#cURL-commands" target="_blank" rel="noreferrer noopener">here</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Add extra features</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>A few functionalities have been added on top of the original example:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>store the registry into a PostgreSQL database (instead of in memory)</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>read database parameters from <a href="https://www.clever.cloud/blog/fonctionnalites/2022/03/22/improving-our-environment-variables-editor/">environment variables</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>add a hardcoded basic authentication</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>All parameters may be specified in the <a href="https://github.com/CleverCloud/scala-akka-http-postgres-example/blob/master/src/main/resources/application.conf">application.conf</a> file:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>basic auth</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>database parameters</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>Parameters are fetched from environment variables, or the specified default value if none is found</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">app {
  basic-auth {
    user = "foo"
    user = ${?BASIC_AUTH_USER}
    password = "bar"
    password = ${?BASIC_AUTH_PASSWORD}
  }
  routes {
    # If ask takes more time than this to complete the request is failed
    ask-timeout = 5s
  }

  db {
    host = "localhost"
    host = ${?POSTGRESQL_ADDON_HOST}
    port = "5432"
    port = ${?POSTGRESQL_ADDON_PORT}
    database = "postgres"
    database = ${?POSTGRESQL_ADDON_DB}
    user = "login"
    user = ${?POSTGRESQL_ADDON_USER}
    pass = "pass"
    pass = ${?POSTGRESQL_ADDON_PASSWORD}
  }
}</code></pre>
<!-- /wp:html -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Run the application using Clever Cloud CLI 🚀</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Create a Clever Cloud application</h3>
<!-- /wp:heading -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever create --type sbt myakka --region par --org testorg</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>This command creates a new application</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul class="wp-block-list"><!-- wp:list-item -->
<li>of type sbt for <a href="https://www.clever.cloud/product/applications-scala/">Scala</a></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>named <em>myakka</em></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>in <em>Paris</em> region</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>inside my test organisation <em>testorg</em></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Enable a dedicated build instance for faster build (optional pro tip)</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>By default a newly created application will run an XS instance which are quite small for building Scala applications fast. One way to build faster is to use a dedicated build Instance: In the Clever Cloud console, got to your application -&gt; options, and check the box <code>[] Enable dedicated build instance</code> This way you can keep your XS instance for running the application, but you can choose an XL for the build time. Or with the command line tool:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever scale -a myakka --build-flavor XL</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Create a PostgreSQL database</h3>
<!-- /wp:heading -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever addon -l myakka create postgresql-addon myakkadb</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>This command orders a PostgreSQL add-on instance and link it to <code><em>myakka</em></code>, injecting the right environment variables into the application instance to contact the database.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Database creation and migration is performed using <a href="https://flywaydb.org/">flywaydb</a> tool. Those script may be found in the <a href="https://github.com/CleverCloud/scala-akka-http-postgres-example/tree/master/src/main/resources/db/migration">migration/db</a> directory of the application resources.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Migration will be automatically called once you specify the proper build hook in the environment variables</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><kbd>CC_POST_BUILD_HOOK</kbd> with value <kbd><kbd>sbt flywayMigrate</kbd></kbd></p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever env -a myakka set <kbd>CC_POST_BUILD_HOOK</kbd> "sbt flywayMigrate"</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Configure basic auth environment variables</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Basic authentication login and password can be specified as environment variables using the <kbd>clever env</kbd> command. If none is found, basic authentication will default to <em>application.conf</em> file values</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever env -a myakka set BASIC_AUTH_USER &lt;YOUR_AUTH_USER&gt;
clever env -a myakka set BASIC_AUTH_PASSWORD &lt;YOUR_AUTH_PASSWORD&gt;</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Link your local repo with your Clever Cloud application instance</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Retrieve your application id with</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever applications</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>Then link the local repository to the application (creating a <em>.clever.json</em> file)</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever link app_&lt;UUID&gt;</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Deploy</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>You are now ready to deploy and run your code, just run</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">clever deploy</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>You are now able to follow the deployment process until it completes successfully</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Your application is running now!</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3 class="wp-block-heading">Try it</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>It's time to experiment with it using <kbd>curl</kbd> or your favorite GUI</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading">Add a user</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Adapt this command in order to insert a new user into the registry:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">curl --request POST \
  --url https://app-&lt;UUID&gt;.cleverapps.io/users \
  --header 'Content-type: application/json' \
  -u '&lt;YOUR_AUTH_USER&gt;:&lt;YOUR_AUTH_PASSWORD&gt;' \
  --data '{
  "name": "Serge",
  "age": 42,
  "countryOfResidence": "Greenland"
}'

{
	"description": "User Serge created."
}</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":4} -->
<h4 class="wp-block-heading">Get all users</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Check that the user has been properly created, by getting the list of users:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre class="wp-block-code"><code class="lang-bash">curl --request GET \
  --url https://app-&lt;UUID&gt;.cleverapps.io/users \
  -u '&lt;YOUR_AUTH_USER&gt;:&lt;YOUR_AUTH_PASSWORD&gt;'

{"users":[{"age":42,"countryOfResidence":"Greenland","name":"Serge"}]}</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>It works, Success! 🎉</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Introducing Jenkins integration for Clever Cloud</title>
		<link>https://www.clever.cloud/blog/features/2021/10/14/introducing-jenkins-integration-for-clever-cloud/</link>
		
		<dc:creator><![CDATA[Arnaud Lefebvre]]></dc:creator>
		<pubDate>Thu, 14 Oct 2021 12:31:35 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[CD]]></category>
		<category><![CDATA[CI]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[Engineering]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[jenkins]]></category>
		<category><![CDATA[runners]]></category>
		<guid isPermaLink="false">https://www.clever-cloud.com/?p=3519</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/10/jenkins.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="jenkins" decoding="async" srcset="https://cdn.clever-cloud.com/uploads/2021/10/jenkins.jpg 1400w, https://cdn.clever-cloud.com/uploads/2021/10/jenkins-300x116.jpg 300w, https://cdn.clever-cloud.com/uploads/2021/10/jenkins-1024x395.jpg 1024w, https://cdn.clever-cloud.com/uploads/2021/10/jenkins-768x296.jpg 768w, https://cdn.clever-cloud.com/uploads/2021/10/jenkins-1368x528.jpg 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p>Today, we are proud to announce the release of our Jenkins add-on with a custom Clever Cloud integration!

Jenkins is an open source automation server which enables developers to build, test, and deploy their software.<span id="more-3519"></span> It facilitates continuous integration (CI) and continuous delivery (CD), is highly configurable and benefits from a huge community as well as many online resources.
<figure id="attachment_3691"><img title="Jenkins Dashboard on Clever Cloud" src="https://cdn.clever-cloud.com/uploads/2021/10/Screenshot-2021-09-30-at-19-37-38-Console-Clever-Cloud-1.png" alt="Jenkins Dashboard on Clever Cloud" />
<figcaption id="caption-attachment-3691" class="wp-caption-text">Jenkins Dashboard on Clever Cloud</figcaption></figure>
<h3>Clever Cloud applications to run your jobs</h3>
Customise your Jenkins with to the huge variety of available Jenkins plugins: you can install and update any plugin you need to customise your jobs in the best possible ways. We also provide our own custom plugin to manage the runners that will execute your jobs. It means that tasks won't be executed on the Jenkins controller instance but in dedicated virtual machines deployed on Clever Cloud infrastructure. This allows you to configure the Docker image to use with all the tools you need, and the size of the virtual machine that would suit your jobs. The minimum size is <strong>XS (1 vCPU, 2 GiB RAM)</strong> and the maximum is a <strong>3XL (16 vCPU, 32 GiB RAM).</strong> If you need bigger runner sizes for your jobs, let us know!

There are no limits in the number of jobs you can run, either in parallel or in total, you can start as many jobs as you need. Each job will only be billed for the time it really took, down to the second.
<h3>Enhance your Clever Cloud deployments workflow</h3>
Clever Cloud Jenkins add-ons can enhance your deployment workflow on Clever Cloud. For example, if you wish to automatically deploy your project once all tests are successful, you can configure your job to install our <a href="https://www.clever.cloud/developers/reference/clever-tools/getting_started/">CLI clever-tools</a> and then push your code to your Clever Cloud application.

Here is a Jenkinsfile example on how you could achieve this. It uses multiple stages to install clever-tools and start the deployment of your default application. Clever-tools will automatically pick up the secrets in the environment variables defined in <code>CLEVER_TOKEN</code> and <code>CLEVER_SECRET</code> to be authenticated. You will need to create two Jenkins credentials with actual tokens. Tokens can be easily retrieved on your local machine by looking in <code>~/.config/clever-cloud</code> on Linux and Mac OSX and <code>%APPDATA%/clever-cloud</code> on Windows.
<pre><code class="language-java">pipeline {
  environment {
    CLEVER_TOKEN = credentials('CLEVER_TOKEN')
    CLEVER_SECRET = credentials('CLEVER_SECRET')
  }

  stage('clever-tools') {
      steps {
        script {
          sh 'npm install -g clever-tools'
       }
     }
  }

  stage('tests') {
    // Your tests steps
  }

  stage('deployment') {
    steps {
      script {
        // Deploy the application
        // A .clever.json file must exists in the repository
        sh 'clever deploy'
      }
    }
  }
}</code></pre>
You can also use Jenkins's own environment variables to customise your build. You can get a list of those variables by appending <code>/env-vars.html</code> at the end of your add-on's URL. Using those, you could decide whether to deploy on your staging or production application based on the branch name.
<h3>Built with the classic features you love</h3>
As with any other products we release, Jenkins add-ons have <strong>automatic backups</strong>, <strong>metrics</strong>, <strong>logs</strong> and <strong>encryption at rest</strong>. You will also be able to use Clever Cloud <strong>Single Sign-On</strong> to connect to your Jenkins add-on, meaning that every organization member can access the Jenkins instance under its own account.

You can find more information about how to configure Jenkins <a href="https://www.clever.cloud/developers/doc/addons/jenkins/">in our documentation</a>.
<h3>Pricing</h3>
<script type="module" src="https://components.clever-cloud.com/load.js?version=7&amp;lang=en&amp;components=cc-pricing-product.smart-addon,cc-pricing-product.smart-runtime"></script>

You will find below the pricing of both <strong>Jenkins</strong> and <strong>Jenkins Runners</strong>. The <a href="https://www.clever.cloud/pricing#https://www.clever.cloud/pricing#jenkins">pricing page</a> is here to help you estimate various configurations.
<div>Jenkins is the managed service on which you will configure your jobs.
<div></div>
</div>
<div>The instances running your tasks, known as Jenkins Runners, billed on a per-second basis:
<div></div>
</div>
<h3 id="whats-next">What's next?</h3>
We plan to provide an even better integration with Jenkins. Our next goals are to add multiple runner retention policies (having successive jobs on the same runner) in addition to improve boot time of runners. We will also open source our Jenkins plugin and upstream it to the Jenkins plugins repository. That way, we will bring the ability to start your own Clever Cloud Jenkins runners from your self-hosted Jenkins instance.]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/10/jenkins.jpg" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="jenkins" decoding="async" loading="lazy" srcset="https://cdn.clever-cloud.com/uploads/2021/10/jenkins.jpg 1400w, https://cdn.clever-cloud.com/uploads/2021/10/jenkins-300x116.jpg 300w, https://cdn.clever-cloud.com/uploads/2021/10/jenkins-1024x395.jpg 1024w, https://cdn.clever-cloud.com/uploads/2021/10/jenkins-768x296.jpg 768w, https://cdn.clever-cloud.com/uploads/2021/10/jenkins-1368x528.jpg 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p>Today, we are proud to announce the release of our Jenkins add-on with a custom Clever Cloud integration!

Jenkins is an open source automation server which enables developers to build, test, and deploy their software.<span id="more-3519"></span> It facilitates continuous integration (CI) and continuous delivery (CD), is highly configurable and benefits from a huge community as well as many online resources.
<figure id="attachment_3691"><img title="Jenkins Dashboard on Clever Cloud" src="https://cdn.clever-cloud.com/uploads/2021/10/Screenshot-2021-09-30-at-19-37-38-Console-Clever-Cloud-1.png" alt="Jenkins Dashboard on Clever Cloud" />
<figcaption id="caption-attachment-3691" class="wp-caption-text">Jenkins Dashboard on Clever Cloud</figcaption></figure>
<h3>Clever Cloud applications to run your jobs</h3>
Customise your Jenkins with to the huge variety of available Jenkins plugins: you can install and update any plugin you need to customise your jobs in the best possible ways. We also provide our own custom plugin to manage the runners that will execute your jobs. It means that tasks won't be executed on the Jenkins controller instance but in dedicated virtual machines deployed on Clever Cloud infrastructure. This allows you to configure the Docker image to use with all the tools you need, and the size of the virtual machine that would suit your jobs. The minimum size is <strong>XS (1 vCPU, 2 GiB RAM)</strong> and the maximum is a <strong>3XL (16 vCPU, 32 GiB RAM).</strong> If you need bigger runner sizes for your jobs, let us know!

There are no limits in the number of jobs you can run, either in parallel or in total, you can start as many jobs as you need. Each job will only be billed for the time it really took, down to the second.
<h3>Enhance your Clever Cloud deployments workflow</h3>
Clever Cloud Jenkins add-ons can enhance your deployment workflow on Clever Cloud. For example, if you wish to automatically deploy your project once all tests are successful, you can configure your job to install our <a href="https://www.clever.cloud/developers/reference/clever-tools/getting_started/">CLI clever-tools</a> and then push your code to your Clever Cloud application.

Here is a Jenkinsfile example on how you could achieve this. It uses multiple stages to install clever-tools and start the deployment of your default application. Clever-tools will automatically pick up the secrets in the environment variables defined in <code>CLEVER_TOKEN</code> and <code>CLEVER_SECRET</code> to be authenticated. You will need to create two Jenkins credentials with actual tokens. Tokens can be easily retrieved on your local machine by looking in <code>~/.config/clever-cloud</code> on Linux and Mac OSX and <code>%APPDATA%/clever-cloud</code> on Windows.
<pre><code class="language-java">pipeline {
  environment {
    CLEVER_TOKEN = credentials('CLEVER_TOKEN')
    CLEVER_SECRET = credentials('CLEVER_SECRET')
  }

  stage('clever-tools') {
      steps {
        script {
          sh 'npm install -g clever-tools'
       }
     }
  }

  stage('tests') {
    // Your tests steps
  }

  stage('deployment') {
    steps {
      script {
        // Deploy the application
        // A .clever.json file must exists in the repository
        sh 'clever deploy'
      }
    }
  }
}</code></pre>
You can also use Jenkins's own environment variables to customise your build. You can get a list of those variables by appending <code>/env-vars.html</code> at the end of your add-on's URL. Using those, you could decide whether to deploy on your staging or production application based on the branch name.
<h3>Built with the classic features you love</h3>
As with any other products we release, Jenkins add-ons have <strong>automatic backups</strong>, <strong>metrics</strong>, <strong>logs</strong> and <strong>encryption at rest</strong>. You will also be able to use Clever Cloud <strong>Single Sign-On</strong> to connect to your Jenkins add-on, meaning that every organization member can access the Jenkins instance under its own account.

You can find more information about how to configure Jenkins <a href="https://www.clever.cloud/developers/doc/addons/jenkins/">in our documentation</a>.
<h3>Pricing</h3>
<script type="module" src="https://components.clever-cloud.com/load.js?version=7&amp;lang=en&amp;components=cc-pricing-product.smart-addon,cc-pricing-product.smart-runtime"></script>

You will find below the pricing of both <strong>Jenkins</strong> and <strong>Jenkins Runners</strong>. The <a href="https://www.clever.cloud/pricing#https://www.clever.cloud/pricing#jenkins">pricing page</a> is here to help you estimate various configurations.
<div>Jenkins is the managed service on which you will configure your jobs.
<div></div>
</div>
<div>The instances running your tasks, known as Jenkins Runners, billed on a per-second basis:
<div></div>
</div>
<h3 id="whats-next">What's next?</h3>
We plan to provide an even better integration with Jenkins. Our next goals are to add multiple runner retention policies (having successive jobs on the same runner) in addition to improve boot time of runners. We will also open source our Jenkins plugin and upstream it to the Jenkins plugins repository. That way, we will bring the ability to start your own Clever Cloud Jenkins runners from your self-hosted Jenkins instance.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Hooks: thank you captain</title>
		<link>https://www.clever.cloud/blog/features/2017/08/10/hooks-thank-you-captain/</link>
		
		<dc:creator><![CDATA[Clement Delafargue]]></dc:creator>
		<pubDate>Thu, 10 Aug 2017 16:20:00 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[deployment]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2017/08/10/hooks-thank-you-captain/</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/hooks-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="hooks 1" decoding="async" loading="lazy" srcset="https://cdn.clever-cloud.com/uploads/2021/08/hooks-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/hooks-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/hooks-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/hooks-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/hooks-1-1368x528.png 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p><p>We&#39;ve been quietly rolling out support for hooks during deployments. This may come as a surprise if you listen to our ramblings about deployment processes, as we&#39;ve always pushed for self-contained, zero-adherence builds. Don&#39;t worry, we haven&#39;t changed our minds. Let&#39;s see why and how doing things outside of the build system can make sense.</p>
<span id="more-2898"></span>

<h2 id="our-stance-is-unchanged">Our stance is unchanged</h2>
<p>At Clever Cloud, we&#39;re uncompromizing on automation. The first step to automate production is to have robust, reproducible builds. The best way to be robust and reproducible is to get rid of implicit dependencies: if you have more than two operations to run in sequence to build and run your project, then you have a problem. Not just for deployment, mind you, but for your day-to-day productivity: working on your application becomes complicated, and onboarding new developers takes hours (or worse).</p>
<p>How are Node.JS apps deployed on Clever Cloud? Simple: <code>npm install &amp;&amp; npm start</code>. What about scala applications? <code>sbt stage</code>. No problem, no vendor lock-in. That&#39;s nice and clean. Unfortunately it&#39;s not the whole story.</p>
<h3 id="the-case-of-frontend-build">The case of frontend build</h3>
<p>It&#39;s got to be the most common question we have about our deployment system: &quot;how can I integrate my frontend build in the deployment phase&quot;?</p>
<p>For Node.JS, easy, just add your build phase to <code>scripts.install</code>. For scala applications, you can configure <code>sbt-web</code>. For PHP applications, you can hook in composer. Hooking the frontend build in the main build can range from super easy to <a href="http://dwarffortresswiki.org/index.php?title=DF2014:Fun&amp;redirect=no">dwarf-fortress-fun</a>. Some build tools allow to run arbitrary code, some are more restrictive (but more predictable). For instance, building Haskell applications with <code>stack</code> makes it quite hard to shell out and run <code>npm install</code>.</p>
<h3 id="monolithic-builds-are-not-the-only-option">Monolithic builds are not the only option</h3>
<p>In a full-stack setup (eg Ruby on Rails or Play! framework), integrating the front-end build in the build system is a good idea, as it gives you better integration (eg. <code>play run</code> also refreshes compiled assets). If you&#39;re going with a minimalist tech stack however, integrating everything makes less sense, as your needs for the development environment are not aligned with your needs for the production environment. Let&#39;s say you work on a <code>scotty</code> web app, with some assets compilation. For development, no need to bake everything in the web lib, you can use <a href="https://www.npmjs.com/package/devloop">Devloop</a> and have automatic recompiling on reload, both for frontend and backend.</p>
<p>In that case, instead of shoehorning the frontend build in a <code>stack</code> setup, using a hook as an escape hatch is the most time-effective way to do it; it also gives you more control on when build tasks happen. This allows you to leverage our build system more efficiently.</p>
<h2 id="available-hooks-and-when-to-use-them">Available hooks and when to use them</h2>
<p>A <a href="https://www.clever.cloud/developers/clever-cloud-overview/hooks/">complete rundown of hooks</a> is available in the documentation, but I&#39;ll give you a concrete example to give you a better understanding of what you can do.</p>
<table class="table">
<thead>
<tr>
<th width="200">Hook</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>`pre build`</td>
<td>This is a good place to run `npm install`, as it happens before the deps are cached: that way you benefit from dependencies caching for both frontend and backend builds.</td>
</tr>
<tr>
<td>`post build`</td>
<td>That's where you want to run the actual build target. It happens before the built artifact is saved, this way the frontend build is bundled with the rest of the compiled files.</td>
</tr>
<tr>
<td>`pre run`</td>
<td>That's only for specific setup you want to run every time (even when deploying from cache).</td>
</tr>
<tr>
<td>`run succeeded` and `run failed`</td>
<td>These are mostly for notification purposes, as they happen when the application has already started (or failed to start). They can't abort the launch, so they're just there for debugging or notification purposes.</td>
</tr>
</tbody>
</table>

<h2 id="please-give-us-feedback">Please give us feedback</h2>
<p>I&#39;ve created the new hooks system to scratch an itch, so it may change a bit in the following months. Please reach out to the <a href="mailto:support@clever-cloud.com">support team</a> if you have questions or suggestions.</p>
]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://cdn.clever-cloud.com/uploads/2021/08/hooks-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="hooks 1" decoding="async" loading="lazy" srcset="https://cdn.clever-cloud.com/uploads/2021/08/hooks-1.png 1400w, https://cdn.clever-cloud.com/uploads/2021/08/hooks-1-300x116.png 300w, https://cdn.clever-cloud.com/uploads/2021/08/hooks-1-1024x395.png 1024w, https://cdn.clever-cloud.com/uploads/2021/08/hooks-1-768x296.png 768w, https://cdn.clever-cloud.com/uploads/2021/08/hooks-1-1368x528.png 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p><p>We&#39;ve been quietly rolling out support for hooks during deployments. This may come as a surprise if you listen to our ramblings about deployment processes, as we&#39;ve always pushed for self-contained, zero-adherence builds. Don&#39;t worry, we haven&#39;t changed our minds. Let&#39;s see why and how doing things outside of the build system can make sense.</p>
<span id="more-2898"></span>

<h2 id="our-stance-is-unchanged">Our stance is unchanged</h2>
<p>At Clever Cloud, we&#39;re uncompromizing on automation. The first step to automate production is to have robust, reproducible builds. The best way to be robust and reproducible is to get rid of implicit dependencies: if you have more than two operations to run in sequence to build and run your project, then you have a problem. Not just for deployment, mind you, but for your day-to-day productivity: working on your application becomes complicated, and onboarding new developers takes hours (or worse).</p>
<p>How are Node.JS apps deployed on Clever Cloud? Simple: <code>npm install &amp;&amp; npm start</code>. What about scala applications? <code>sbt stage</code>. No problem, no vendor lock-in. That&#39;s nice and clean. Unfortunately it&#39;s not the whole story.</p>
<h3 id="the-case-of-frontend-build">The case of frontend build</h3>
<p>It&#39;s got to be the most common question we have about our deployment system: &quot;how can I integrate my frontend build in the deployment phase&quot;?</p>
<p>For Node.JS, easy, just add your build phase to <code>scripts.install</code>. For scala applications, you can configure <code>sbt-web</code>. For PHP applications, you can hook in composer. Hooking the frontend build in the main build can range from super easy to <a href="http://dwarffortresswiki.org/index.php?title=DF2014:Fun&amp;redirect=no">dwarf-fortress-fun</a>. Some build tools allow to run arbitrary code, some are more restrictive (but more predictable). For instance, building Haskell applications with <code>stack</code> makes it quite hard to shell out and run <code>npm install</code>.</p>
<h3 id="monolithic-builds-are-not-the-only-option">Monolithic builds are not the only option</h3>
<p>In a full-stack setup (eg Ruby on Rails or Play! framework), integrating the front-end build in the build system is a good idea, as it gives you better integration (eg. <code>play run</code> also refreshes compiled assets). If you&#39;re going with a minimalist tech stack however, integrating everything makes less sense, as your needs for the development environment are not aligned with your needs for the production environment. Let&#39;s say you work on a <code>scotty</code> web app, with some assets compilation. For development, no need to bake everything in the web lib, you can use <a href="https://www.npmjs.com/package/devloop">Devloop</a> and have automatic recompiling on reload, both for frontend and backend.</p>
<p>In that case, instead of shoehorning the frontend build in a <code>stack</code> setup, using a hook as an escape hatch is the most time-effective way to do it; it also gives you more control on when build tasks happen. This allows you to leverage our build system more efficiently.</p>
<h2 id="available-hooks-and-when-to-use-them">Available hooks and when to use them</h2>
<p>A <a href="https://www.clever.cloud/developers/clever-cloud-overview/hooks/">complete rundown of hooks</a> is available in the documentation, but I&#39;ll give you a concrete example to give you a better understanding of what you can do.</p>
<table class="table">
<thead>
<tr>
<th width="200">Hook</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>`pre build`</td>
<td>This is a good place to run `npm install`, as it happens before the deps are cached: that way you benefit from dependencies caching for both frontend and backend builds.</td>
</tr>
<tr>
<td>`post build`</td>
<td>That's where you want to run the actual build target. It happens before the built artifact is saved, this way the frontend build is bundled with the rest of the compiled files.</td>
</tr>
<tr>
<td>`pre run`</td>
<td>That's only for specific setup you want to run every time (even when deploying from cache).</td>
</tr>
<tr>
<td>`run succeeded` and `run failed`</td>
<td>These are mostly for notification purposes, as they happen when the application has already started (or failed to start). They can't abort the launch, so they're just there for debugging or notification purposes.</td>
</tr>
</tbody>
</table>

<h2 id="please-give-us-feedback">Please give us feedback</h2>
<p>I&#39;ve created the new hooks system to scratch an itch, so it may change a bit in the following months. Please reach out to the <a href="mailto:support@clever-cloud.com">support team</a> if you have questions or suggestions.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
