<?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: Florian Baba</title>
    <description>The latest articles on DEV Community by Florian Baba (@florianbaba).</description>
    <link>https://dev.to/florianbaba</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%2F406984%2F82b19708-0560-499f-b738-6bb03fcace6c.jpg</url>
      <title>DEV Community: Florian Baba</title>
      <link>https://dev.to/florianbaba</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/florianbaba"/>
    <language>en</language>
    <item>
      <title>A githooks example, and how to share it with the team</title>
      <dc:creator>Florian Baba</dc:creator>
      <pubDate>Sun, 14 Mar 2021 17:56:32 +0000</pubDate>
      <link>https://dev.to/florianbaba/a-githooks-example-and-how-to-share-it-with-the-team-42i0</link>
      <guid>https://dev.to/florianbaba/a-githooks-example-and-how-to-share-it-with-the-team-42i0</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Regarding githooks, I had 3 different goals:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;📜 Verify that my commits respect the expected format (hook n°1)&lt;/li&gt;
&lt;li&gt;🔧 Check unit tests are green before every &lt;code&gt;git push&lt;/code&gt; (hook n°2)&lt;/li&gt;
&lt;li&gt;👥 Share these hooks with my team&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  A bit of context
&lt;/h2&gt;

&lt;p&gt;Just for the record, my project was made with Symfony/PHP, and launched via docker/docker-compose.&lt;/p&gt;

&lt;p&gt;But since the main goal here is to use githooks, you can adapt following lines for your own context and needs 😃  &lt;/p&gt;

&lt;p&gt;ℹ️ &lt;strong&gt;Note:&lt;/strong&gt; &lt;em&gt;Once a &lt;code&gt;git init&lt;/code&gt; is made on your project folder, you can find githooks examples in &lt;code&gt;./.git/hooks&lt;/code&gt; in folder as &lt;code&gt;.sample&lt;/code&gt; files.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's do it
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1 - 📜 Verify commit-message format
&lt;/h3&gt;

&lt;p&gt;With my team, we decided to use specific commit formats in order to facilitate the way to consult our git history.&lt;/p&gt;

&lt;p&gt;Here are the formats:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;## Example of a commit linked to a specific ticket&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;PSBO-723] An amazing commit message

&lt;span class="c"&gt;## Example of a commit linked to a hotfix&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;hotfix] A hot message &lt;span class="k"&gt;for &lt;/span&gt;a hot commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First, I need to create a regex that matches only these formats:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;^\[(hotfix|\w+\-[0-9]+)\]( \w+)+$
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I have to create the githooks that will check the commit message format every time I will try to commit.&lt;/p&gt;

&lt;p&gt;To do it I create the hook file as &lt;code&gt;.git/hooks/commit-msg&lt;/code&gt; in my project folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Checking commit-message format..."&lt;/span&gt;

&lt;span class="c"&gt;## the first arg is the path to the git commit temporary file&lt;/span&gt;
&lt;span class="nv"&gt;TEMPORARY_FILE_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;

&lt;span class="c"&gt;## get commit-message from the temporary file&lt;/span&gt;
&lt;span class="nv"&gt;COMMIT_MSG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;head&lt;/span&gt; &lt;span class="nt"&gt;-n1&lt;/span&gt; &lt;span class="nv"&gt;$TEMPORARY_FILE_PATH&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;

&lt;span class="c"&gt;## init regex to match commit-message format&lt;/span&gt;
&lt;span class="nv"&gt;REGEX&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"^&lt;/span&gt;&lt;span class="se"&gt;\[&lt;/span&gt;&lt;span class="s2"&gt;(hotfix|&lt;/span&gt;&lt;span class="se"&gt;\w&lt;/span&gt;&lt;span class="s2"&gt;+&lt;/span&gt;&lt;span class="se"&gt;\-&lt;/span&gt;&lt;span class="s2"&gt;[0-9]+)&lt;/span&gt;&lt;span class="se"&gt;\]&lt;/span&gt;&lt;span class="s2"&gt;( &lt;/span&gt;&lt;span class="se"&gt;\w&lt;/span&gt;&lt;span class="s2"&gt;+)+$"&lt;/span&gt;

&lt;span class="c"&gt;## checking commit-message format&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="nv"&gt;$COMMIT_MSG&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ &lt;span class="nv"&gt;$REGEX&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"Your commit-message format is not valid:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="nv"&gt;$COMMIT_MSG&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Valid format examples:"&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"[PSBO-123] My commit message"&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"[hotfix] My commit message"&lt;/span&gt;
    &lt;span class="nb"&gt;exit &lt;/span&gt;1
&lt;span class="k"&gt;else
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Well done! Your commit-message is valid."&lt;/span&gt;
    &lt;span class="nb"&gt;exit &lt;/span&gt;0
&lt;span class="k"&gt;fi&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Once done, don't forget to give to the file the right to be executed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chmod&lt;/span&gt; +x .git/hooks/commit-msg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Let's test the hook
&lt;/h4&gt;

&lt;p&gt;Now, if I try to commit with an invalid message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Yehaaaa"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It returns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Checking commit-message format...
Your commit-message format is not valid:
Yehaaaa

Valid format examples:
[PSBO-123] My commit message
[hotfix] My commit message
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the commit is canceled, as expected! 🎉 &lt;/p&gt;

&lt;p&gt;If I try to commit with a valid message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"[PSBO-456] It's a valid one this time"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It returns:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Checking commit-message format...
Well done! Your commit-message is valid.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the commit is done! ✔️ &lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2 - 🔧 Launch unit tests before each &lt;code&gt;git push&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Let's do it again!&lt;br&gt;
Since I want to check unit tests &lt;strong&gt;before&lt;/strong&gt; pushing my code, I will create a hook file as &lt;code&gt;.git/hooks/pre-push&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;

&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Checking unit-tests..."&lt;/span&gt;

&lt;span class="c"&gt;## checking unit-tests&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; ./infra &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;exit
&lt;/span&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;docker-compose run php bin/phpunit&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Well done, unit-tests are green!"&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"'git push' is now done."&lt;/span&gt;
    &lt;span class="nb"&gt;exit &lt;/span&gt;0
&lt;span class="k"&gt;else
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Unit-tests failed, therefore the push is canceled."&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Please fix them before pushing again."&lt;/span&gt;
    &lt;span class="nb"&gt;exit &lt;/span&gt;1
&lt;span class="k"&gt;fi&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;Once again, I need to give this hook file the right to be executed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chmod&lt;/span&gt; +x .git/hooks/pre-push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, let's check if it works in case my unit tests are failing.&lt;/p&gt;

&lt;p&gt;First, I changed the code of a unit test so that it fails.&lt;br&gt;
Now I try to git push to trigger the hook:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"[hotfix] Breaking unit-tests"&lt;/span&gt;
git push origin develop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It returns&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Checking unit-tests...
Creating infra_php_run ... &lt;span class="k"&gt;done

&lt;/span&gt;Testing Project Test Suite
F                                                                   1 / 1 &lt;span class="o"&gt;(&lt;/span&gt;100%&lt;span class="o"&gt;)&lt;/span&gt;

There was 1 failure:

1&lt;span class="o"&gt;)&lt;/span&gt; App&lt;span class="se"&gt;\T&lt;/span&gt;ests&lt;span class="se"&gt;\U&lt;/span&gt;til&lt;span class="se"&gt;\C&lt;/span&gt;alculatorTest::testCalculate
Failed asserting that 15 is identical to 16.

/var/www/tests/Util/CalculatorTest.php:31

FAILURES!
Tests: 1, Assertions: 1, Failures: 1.
ERROR: 1
Unit-tests failed, therefore the push is canceled.
Please fix them before pushing again.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tests failed, so the push is canceled, seems good! 👍 &lt;/p&gt;

&lt;p&gt;OK, this time I fixed the code of the unit test.&lt;br&gt;
Then I push to trigger the hook once again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"[hotfix] Fixing unit-tests"&lt;/span&gt;
git push origin develop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It returns&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Checking unit-tests...
Creating infra_php_run ... &lt;span class="k"&gt;done

&lt;/span&gt;Testing Project Test Suite
&lt;span class="nb"&gt;.&lt;/span&gt;                                                                   1 / 1 &lt;span class="o"&gt;(&lt;/span&gt;100%&lt;span class="o"&gt;)&lt;/span&gt;

OK &lt;span class="o"&gt;(&lt;/span&gt;1 &lt;span class="nb"&gt;test&lt;/span&gt;, 1 assertion&lt;span class="o"&gt;)&lt;/span&gt;
Well &lt;span class="k"&gt;done&lt;/span&gt;, unit-tests are green!
&lt;span class="s1"&gt;'git push'&lt;/span&gt; is now &lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Unit-tests are green, so the push was validated and done! This hook works as planned! 💃&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3 - 👥 Share githooks with the team
&lt;/h3&gt;

&lt;p&gt;Now, my hooks are ready! &lt;/p&gt;

&lt;p&gt;But unfortunately I can't share them with the team.&lt;/p&gt;

&lt;p&gt;Why that?&lt;br&gt;
Because githooks are ignored by git (as every other file in &lt;code&gt;.git&lt;/code&gt; folder), therefore they can't be added to the index or be commited in anyway...&lt;/p&gt;

&lt;p&gt;Unless we do some little magic! 🎩 🐰&lt;/p&gt;

&lt;p&gt;ℹ️ &lt;strong&gt;Note:&lt;/strong&gt; &lt;em&gt;There are multiple solutions to solve this issue, I picked this one because I found it smart and easy to set up.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So to do the magic, I'm going to create my own githooks folder in the root path of the project (not in the &lt;code&gt;.git&lt;/code&gt; folder):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;## I create my own githooks folder&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; .githooks

&lt;span class="c"&gt;## Then, move the githooks I created in this new folder&lt;/span&gt;
&lt;span class="nb"&gt;mv&lt;/span&gt; .git/hooks/commit-msg .githooks/
&lt;span class="nb"&gt;mv&lt;/span&gt; .git/hooks/pre-push .githooks/

&lt;span class="c"&gt;## Don't forget to give "execute" right to the files, if not already done&lt;/span&gt;
&lt;span class="nb"&gt;sudo chmod&lt;/span&gt; +x .githooks/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, I just need to tell git where to find my githooks files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;## Specify a folder for hooks (only available for git version &amp;gt;= 2.9)&lt;/span&gt;
git config core.hooksPath .githooks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And it's done!&lt;/p&gt;

&lt;p&gt;From now one, I can commit these hooks since there are no longer ignored by git, so my teammates will be able to use them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;My githooks work, and I can share them with my team, it's all good! 🎉 💥&lt;/p&gt;

&lt;p&gt;Hope this helped you find out how githooks work and how powerful they can be.&lt;/p&gt;

</description>
      <category>git</category>
      <category>githooks</category>
      <category>ci</category>
      <category>linux</category>
    </item>
    <item>
      <title>A Kubernetes memory aid for beginners </title>
      <dc:creator>Florian Baba</dc:creator>
      <pubDate>Fri, 26 Jun 2020 08:52:57 +0000</pubDate>
      <link>https://dev.to/florianbaba/a-kubernetes-memory-aid-for-beginners-4g2a</link>
      <guid>https://dev.to/florianbaba/a-kubernetes-memory-aid-for-beginners-4g2a</guid>
      <description>&lt;p&gt;Hello!&lt;br&gt;
Since I'm a Kube beginner, I gradually started writing this memory aid.&lt;/p&gt;

&lt;p&gt;It's not exhaustive at all, but it's a start :)&lt;br&gt;
I hope it helps.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;You'll need this alias for all the listed cmd: &lt;code&gt;alias k='kubectl'&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Contexts
&lt;/h2&gt;

&lt;p&gt;List contexts (and show the current one)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k config get-contexts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Switch context&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k config use-context &amp;lt;CONTEXT_NAME&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Pods
&lt;/h2&gt;

&lt;p&gt;List pods&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k get pod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Delete a pod&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k delete pod &amp;lt;POD-ID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Show pod details (and the events linked to the pod)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k describe pod &amp;lt;POD-ID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Download a file from a pod&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k cp &amp;lt;POD-ID&amp;gt;:&amp;lt;POD_FILE_PATH&amp;gt; &amp;lt;LOCAL_PATH&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Containers
&lt;/h2&gt;

&lt;p&gt;Connect to a container using &lt;code&gt;sh&lt;/code&gt; or &lt;code&gt;bash&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k exec -it &amp;lt;POD-ID&amp;gt; -c &amp;lt;CONTAINER-NAME&amp;gt; &amp;lt;sh|bash&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Logs
&lt;/h2&gt;

&lt;p&gt;Show logs of a container&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k logs &amp;lt;POD-ID&amp;gt; &amp;lt;CONTAINER-NAME&amp;gt; -f
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Show all the logs of a deployment&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k logs -f deployment/&amp;lt;DEPLOYMENT-NAME&amp;gt; --all-containers=true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Events
&lt;/h2&gt;

&lt;p&gt;List events sorted by timestamp&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k get event --sort-by .lastTimestamp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Secrets
&lt;/h2&gt;

&lt;p&gt;Show secrets with age&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k get externalsecrets
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Deploys
&lt;/h2&gt;

&lt;p&gt;List deploys on a cluster&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k get deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;List deploys on a cluster, with details&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get deploy -o=custom-columns=NAME:.metadata.name,STATUS:.status.phase,VERSION:.metadata.labels.version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Show deploy status&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k rollout status deploy/&amp;lt;DEPLOY-NAME&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Scale
&lt;/h2&gt;

&lt;p&gt;Define the number of replicas&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k scale deploy/&amp;lt;DEPLOY-NAME&amp;gt; --replicas=2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Show replicas sets&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k get rs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Cron
&lt;/h2&gt;

&lt;p&gt;Show cron jobs&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;k get cronjobs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>kubernetes</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Convert .ppk key for ssh connection on linux</title>
      <dc:creator>Florian Baba</dc:creator>
      <pubDate>Thu, 18 Jun 2020 08:59:29 +0000</pubDate>
      <link>https://dev.to/florianbaba/convert-ppk-key-for-ssh-connection-on-linux-b59</link>
      <guid>https://dev.to/florianbaba/convert-ppk-key-for-ssh-connection-on-linux-b59</guid>
      <description>&lt;p&gt;If you want to use a ssh key as a &lt;code&gt;.ppk&lt;/code&gt; file (putty format) on linux, first you need to convert it.&lt;/p&gt;

&lt;p&gt;To do it, install &lt;code&gt;putty-tools&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install putty-tools 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can convert your key from &lt;code&gt;.ppk&lt;/code&gt; format to &lt;code&gt;.key&lt;/code&gt; format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;puttygen &amp;lt;your_key_name&amp;gt;.ppk -O private-openssh -o &amp;lt;your_key_name&amp;gt;.key 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And voilà! 😀&lt;br&gt;
You can use it to open your ssh connection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -i &amp;lt;your_key_name&amp;gt;.key &amp;lt;user&amp;gt;@&amp;lt;server-ip&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>linux</category>
      <category>ssh</category>
      <category>putty</category>
      <category>ppk</category>
    </item>
    <item>
      <title>Scrum retrospective template</title>
      <dc:creator>Florian Baba</dc:creator>
      <pubDate>Fri, 12 Jun 2020 15:31:17 +0000</pubDate>
      <link>https://dev.to/florianbaba/scrum-retrospective-template-54m6</link>
      <guid>https://dev.to/florianbaba/scrum-retrospective-template-54m6</guid>
      <description>&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;Team&lt;/th&gt;
&lt;th&gt;Participants&lt;/th&gt;
&lt;th&gt;Writer&lt;/th&gt;
&lt;th&gt;Timekeeper&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2020-01-01&lt;/td&gt;
&lt;td&gt;Team name&lt;/td&gt;
&lt;td&gt;Camille, Fred, Paul&lt;/td&gt;
&lt;td&gt;Camille&lt;/td&gt;
&lt;td&gt;Fred&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Sprint review
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Sprint goal
&lt;/h3&gt;

&lt;p&gt;Name or description of the sprint goal&lt;/p&gt;

&lt;h3&gt;
  
  
  Velocity
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NB:&lt;/strong&gt; Velocity = Story points done / Total presence days&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Total presence days&lt;/th&gt;
&lt;th&gt;Story points planned&lt;/th&gt;
&lt;th&gt;Story points done&lt;/th&gt;
&lt;th&gt;Velocity&lt;/th&gt;
&lt;th&gt;Successful sprint goal&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;33&lt;/td&gt;
&lt;td&gt;65&lt;/td&gt;
&lt;td&gt;86&lt;/td&gt;
&lt;td&gt;2.6&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Burndown chart
&lt;/h3&gt;

&lt;p&gt;&amp;lt;-- insert burndown image --&amp;gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Sprint ROTI
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Product owner&lt;/th&gt;
&lt;th&gt;Developers&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;4/5&lt;/td&gt;
&lt;td&gt;4.5/5&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Demo
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Audience ROTI&lt;/th&gt;
&lt;th&gt;Link to the demo&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;3.9/5&lt;/td&gt;
&lt;td&gt;&amp;lt;-- demo-link --&amp;gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Retrospective
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Format: The boat
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;The boat&lt;/th&gt;
&lt;th&gt;The island&lt;/th&gt;
&lt;th&gt;The wind&lt;/th&gt;
&lt;th&gt;The anchors&lt;/th&gt;
&lt;th&gt;The reef&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Thanks
&lt;/h3&gt;

&lt;p&gt;Special thanks to &amp;lt;-- a great co-worker --&amp;gt; for his help during this sprint.&lt;/p&gt;

&lt;h3&gt;
  
  
  Chosen topics &amp;amp; actions
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Topic&lt;/th&gt;
&lt;th&gt;Actions&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A topic&lt;/td&gt;
&lt;td&gt;A great action linked to this topic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Another topic&lt;/td&gt;
&lt;td&gt;A smart action&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Retrospective ROTI
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Team&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;4.3/5&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>agile</category>
      <category>scrum</category>
    </item>
  </channel>
</rss>
