<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hady Rashwan</title>
    <description>The latest articles on DEV Community by Hady Rashwan (@hadyrashwan).</description>
    <link>https://dev.to/hadyrashwan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F447961%2F2f84f041-70f4-4a23-81a0-cc1c0f6fba22.jpeg</url>
      <title>DEV Community: Hady Rashwan</title>
      <link>https://dev.to/hadyrashwan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hadyrashwan"/>
    <language>en</language>
    <item>
      <title>Google Cloud Run and MySql using Ruby On Rails</title>
      <dc:creator>Hady Rashwan</dc:creator>
      <pubDate>Mon, 24 Aug 2020 12:42:05 +0000</pubDate>
      <link>https://dev.to/hadyrashwan/ruby-on-rails-with-google-cloud-run-4hb</link>
      <guid>https://dev.to/hadyrashwan/ruby-on-rails-with-google-cloud-run-4hb</guid>
      <description>&lt;p&gt;We are going to deploy a rails app into Google Cloud Run and Cloud SQL. This will make the rails app serverless. &lt;/p&gt;

&lt;p&gt;We will follow the following &lt;a href="https://github.com/hadyrashwan/ruby-on-rails-getting-started#deployment-on-gcp-as-serverless-"&gt;steps&lt;/a&gt; to deploy our app.&lt;/p&gt;

&lt;p&gt;When running the app, it took over 20 seconds to respond for the first run. Many configurations can be adjected to improve performance. Please feel free to comment with suggestions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup Google Cloud SQL for Mysql.
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Find the service network API section using the search bar.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---_0Fvwb9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/605sxs6astw11g0sh23i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---_0Fvwb9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/605sxs6astw11g0sh23i.png" alt="Search bar"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enable the service network API.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e36c6QvV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/20wml5g94d3mc72kj7vk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e36c6QvV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/20wml5g94d3mc72kj7vk.png" alt="Enable API"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go to the Cloud SQL section.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0bMt5HYe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9jeyjw0dyhha0vlhxdns.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0bMt5HYe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9jeyjw0dyhha0vlhxdns.png" alt="Cloud SQL section"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new database instance.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5Zmp1Efc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ttuxaw25e2vlbvza0izn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5Zmp1Efc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ttuxaw25e2vlbvza0izn.png" alt="Click On  create instance"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose Mysql.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HLir01Rl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6qaywpz33qo51hpef01h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HLir01Rl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6qaywpz33qo51hpef01h.png" alt="Choose Mysql"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Setup the database name and password.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oE_ajz4j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8z7elhe6r5x8eddeh5ut.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oE_ajz4j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8z7elhe6r5x8eddeh5ut.png" alt="Database setup"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on "show more configuration options". and enable private IP.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VQfrMTtQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9le6a6f6djgosg6qortd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VQfrMTtQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9le6a6f6djgosg6qortd.png" alt="Enable private IP"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Click on create and wait until the process is done.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2NQitBDf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nppwji36khc8ivkjnkkx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2NQitBDf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/nppwji36khc8ivkjnkkx.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Write down the private IP.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on Connect with cloud shell.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xidUvH5p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fvl4cbhnd7ytne9w6rid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xidUvH5p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fvl4cbhnd7ytne9w6rid.png" alt="Shell"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Connect using gcloud by pressing enter in the terminal you should see a similar command shown in your shell.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CGPsl2Wa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/oz1pup4h8p8uxot2u5ov.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CGPsl2Wa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/oz1pup4h8p8uxot2u5ov.png" alt="gcloud connect"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enter the root password that you choice earlier and press enter.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Should now be connected.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_bFQbY7R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xmigtbuib8ljr5dwctlg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_bFQbY7R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xmigtbuib8ljr5dwctlg.png" alt="Mysql shell"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create the database using the following command.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7dnN9u-e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4i1vbu9zf4uu4o86gabp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7dnN9u-e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4i1vbu9zf4uu4o86gabp.png" alt="create the database "&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check that the database exists.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VTNYAXOE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6qutyktjg2wqi3exhiz7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VTNYAXOE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6qutyktjg2wqi3exhiz7.png" alt="database exists"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setup Cloud Run
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Clone this repository &lt;a href="https://github.com/hadyrashwan/ruby-on-rails-getting-started"&gt;https://github.com/hadyrashwan/ruby-on-rails-getting-started&lt;/a&gt; and enter the folder.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Generate the secret key using the following command. For demo purposes, we can use this one &lt;code&gt;e2348e9aaf6da01aea29f03eef0a09a6d7c330ac2571043a126335ce62bc087f70931a54e6bf3bc8f6edff93e0fc502fb34c8af2cab31581b00507138088f230&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It is recommended to excuate the following command to get your own secret key.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rake secret
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Update the deploy.sh file with your project ID.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9VZkpilv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8h14iyrx2hbn8an314im.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9VZkpilv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8h14iyrx2hbn8an314im.png" alt="depoly.sh"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install gcloud from &lt;a href="https://cloud.google.com/sdk/gcloud"&gt;gcloud download page&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run the following command to deploy.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./deploy.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;When asked to enable the cloud build API to enable it and &lt;br&gt;
then you may be asked where to deploy it choose &lt;code&gt;us central&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Write down the deployment URL.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PpwRHRiE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4fl235pwhfzievjgi1y7.png" alt="deployment url"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Connect Cloud Run with Cloud Sql.
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Open Serverless VPC page.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TOB0o47O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xbpu8z1mqbtljmzc9n5n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TOB0o47O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xbpu8z1mqbtljmzc9n5n.png" alt="Serverless VPC"&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on &lt;code&gt;Create Connector&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--If8z16rZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fmalf77mtx0wxd512ai4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--If8z16rZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fmalf77mtx0wxd512ai4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Setup the connector as follows and click &lt;code&gt;Create&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_tn3GN1X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qfarabbbcc9w5pzd0sxl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_tn3GN1X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/qfarabbbcc9w5pzd0sxl.png" alt="Create Connector"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now go to the cloud run page.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8XwnuFgV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/m0vcx99v5b605v8oancm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8XwnuFgV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/m0vcx99v5b605v8oancm.png" alt="Cloud Run Panel"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open your app.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zQW0LaEw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gxhsokqkoqd5ypw8csg3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zQW0LaEw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gxhsokqkoqd5ypw8csg3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Edit deploy.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--co8Gwjld--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/h16k8fscovlghczeq1vb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--co8Gwjld--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/h16k8fscovlghczeq1vb.png" alt="Edit deploy"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Edit the connection section.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xH1-mMje--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zdvx39vim1h2ijztifa7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xH1-mMje--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zdvx39vim1h2ijztifa7.png" alt="edit connectio"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update your environment variables. They should be as follow this table:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;BLOG_DATABASE_HOST&lt;/td&gt;
&lt;td&gt;Private IP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BLOG_DATABASE_PASSWORD&lt;/td&gt;
&lt;td&gt;Password&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SECRET_KEY_BASE&lt;/td&gt;
&lt;td&gt;Secret key&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;It should look like this.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q6qA5q9_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kr4aw5yggmc0qbac8en2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q6qA5q9_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kr4aw5yggmc0qbac8en2.png" alt="update variables"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Finally, click &lt;code&gt;Deploy&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Done
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Your app should be ready now go to the deployment URL on your browser.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It may ask you to do a database migration do so.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In my test, the response took over 20 seconds coming from a cold start(first time hitting the app) and 254 ms afterwards.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I disabled the Webpack caching mechanism and used environment variables instead of the secret manger for the demo purposes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Google Cloud docs links that helped me.
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://cloud.google.com/sql/docs/mysql/create-instance"&gt;Setup Google Cloud SQL for Mysql&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://cloud.google.com/sql/docs/mysql/configure-private-ip"&gt;Configuring private IP for the database&lt;/a&gt; .&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://cloud.google.com/sdk/install"&gt;Install gcloud&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://cloud.google.com/sql/docs/mysql/connect-run"&gt;Enable Cloud SQL on Cloud Run&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://cloud.google.com/run/docs/configuring/environment-variables"&gt;Update your environment variables&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>googlecloud</category>
      <category>serverless</category>
    </item>
    <item>
      <title>Setup Java and VS Code  on Ubuntu</title>
      <dc:creator>Hady Rashwan</dc:creator>
      <pubDate>Fri, 07 Aug 2020 12:47:30 +0000</pubDate>
      <link>https://dev.to/hadyrashwan/setup-java-and-vs-code-on-ubuntu-4ahl</link>
      <guid>https://dev.to/hadyrashwan/setup-java-and-vs-code-on-ubuntu-4ahl</guid>
      <description>&lt;p&gt;Settings up your development environment for Java on Ubuntu is straight forward. We are going to install the Java SDK and VS code with the Java extension then create a simple Hello World app. &lt;/p&gt;

&lt;h2&gt;
  
  
  Find the available versions of Java JDK
&lt;/h2&gt;

&lt;p&gt;First, we will search for the available packages to install. I'm looking for version 11, so my search will be.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

$ sudo apt search openjdk-11


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You will get similar to the following. &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Sorting... Done
Full Text Search... Done
default-jdk/focal 2:1.11-72 amd64
  Standard Java or Java compatible Development Kit

openjdk-11-dbg/focal-security,focal-updates 11.0.8+10-0ubuntu1~20.04 amd64
  Java runtime based on OpenJDK (debugging symbols)

openjdk-11-demo/focal-security,focal-updates 11.0.8+10-0ubuntu1~20.04 amd64
  Java runtime based on OpenJDK (demos and examples)

openjdk-11-doc/focal-security,focal-security,focal-updates,focal-updates 11.0.8+10-0ubuntu1~20.04 all
  OpenJDK Development Kit (JDK) documentation

openjdk-11-jdk/focal-security,focal-updates 11.0.8+10-0ubuntu1~20.04 amd64
  OpenJDK Development Kit (JDK)

openjdk-11-jdk-headless/focal-security,focal-updates 11.0.8+10-0ubuntu1~20.04 amd64
  OpenJDK Development Kit (JDK) (headless)

openjdk-11-jre/focal-security,focal-updates,now 11.0.8+10-0ubuntu1~20.04 amd64 [installed,automatic]
  OpenJDK Java runtime, using Hotspot JIT

openjdk-11-jre-dcevm/focal 11.0.3+1-1 amd64
  Alternative VM for OpenJDK 11 with enhanced class redefinition

uwsgi-plugin-servlet-openjdk-11/focal 2.0.18-11ubuntu1 amd64
  JWSGI plugin for uWSGI (OpenJDK 11)



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You can change the number &lt;code&gt;11&lt;/code&gt; and look for other versions of Java.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As you can see &lt;code&gt;openjdk-11-jdk&lt;/code&gt; is available. So let's install it. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Install Java JDK
&lt;/h2&gt;

&lt;p&gt;Now we will install the Java JDK using one command.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

$ sudo apt install openjdk-11-jdk


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Verify that Java installation using the following.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

$ sudo java -version


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The output should be similar to.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

openjdk version "11.0.1" 2020-04-14
OpenJDK Runtime Environment (build 11.0.1+7-Ubuntu-1ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.1+7-Ubuntu-1ubuntu1, mixed mode, sharing)



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Install VS code
&lt;/h2&gt;

&lt;p&gt;You can use the following command to do so.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

sudo snap install --classic code


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If &lt;code&gt;snap&lt;/code&gt; is not available, you can use &lt;code&gt;apt&lt;/code&gt; by following this &lt;a href="https://linuxize.com/post/how-to-install-visual-studio-code-on-ubuntu-20-04/#installing-visual-studio-code-with-apt" rel="noopener noreferrer"&gt;post&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install &lt;a href="https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack" rel="noopener noreferrer"&gt;Java Extension Pack&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

ext install vscjava.vscode-java-pack


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Run A Hello World App
&lt;/h2&gt;

&lt;p&gt;1 - Open VS code.&lt;br&gt;
2 - Create a file called &lt;code&gt;Hello.java&lt;/code&gt;.&lt;br&gt;
3 - Paste the following code. And save it.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Hello&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

        &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello World!"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

    &lt;span class="o"&gt;}&lt;/span&gt;


&lt;span class="o"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;4- Open the &lt;code&gt;Debug&lt;/code&gt; tab and click on &lt;code&gt;Run and Debug&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs71fwltzc9l64medpqb2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs71fwltzc9l64medpqb2.png" alt="Debug Tab"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5- The output in the terminal should be.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fw3pvn6r7wdne570lb6nj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fw3pvn6r7wdne570lb6nj.png" alt="Hello World!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Credit
&lt;/h2&gt;

&lt;p&gt;This post was based on the information from the linuxconfig &lt;a href="https://linuxconfig.org/how-to-install-java-on-ubuntu-20-04-lts-focal-fossa-linux" rel="noopener noreferrer"&gt;post&lt;/a&gt; .&lt;/p&gt;

</description>
      <category>java</category>
      <category>vscode</category>
      <category>ubuntu</category>
    </item>
  </channel>
</rss>
