<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Daniele Cruciani on Medium]]></title>
        <description><![CDATA[Stories by Daniele Cruciani on Medium]]></description>
        <link>https://medium.com/@danielecr?source=rss-161ee63f32b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*zsuESPk5UpQOAx2qkm10EQ.jpeg</url>
            <title>Stories by Daniele Cruciani on Medium</title>
            <link>https://medium.com/@danielecr?source=rss-161ee63f32b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 20:19:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@danielecr/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to monitor cloud costs with kosty: an AWS FinOps utility]]></title>
            <link>https://medium.com/@danielecr/how-to-monitor-cloud-costs-with-kosty-an-aws-finops-utility-2695b6b98d79?source=rss-161ee63f32b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2695b6b98d79</guid>
            <category><![CDATA[finops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-security]]></category>
            <dc:creator><![CDATA[Daniele Cruciani]]></dc:creator>
            <pubDate>Tue, 30 Dec 2025 10:13:15 GMT</pubDate>
            <atom:updated>2025-12-30T10:13:15.740Z</atom:updated>
            <content:encoded><![CDATA[<p>Some month ago I found this interesting project on github: <a href="https://github.com/kosty-cloud/kosty">https://github.com/kosty-cloud/kosty</a></p><p>Kosty is a cost and security audit written in python and using aws cli to check the current status of your service.</p><p>I followed the quickstart guide:</p><blockquote><em>pip3 install kosty</em></blockquote><blockquote><em>python3 -m venv costy</em></blockquote><blockquote><em>export AWS_DEFAULT_PROFILE=root</em></blockquote><blockquote><em>kosty audit — output all</em></blockquote><p>Unfortunately this just output the json file, there is no GUI to check visually the cost and security audit.</p><p>To get the GUI:</p><blockquote><em>git clone </em><a href="https://github.com/kosty-cloud/kosty"><em>https://github.com/kosty-cloud/kosty</em></a></blockquote><blockquote><em>cd kosty</em></blockquote><blockquote><em>open dashboard/index.html</em></blockquote><p>The GUI start with an upload button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/0*y_sti40jTVNCfAN_.png" /></figure><p>After upload there is a summary charts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y_e73fjEh1uUHvpf.png" /></figure><p>In details…</p><p>… continue reading on <a href="https://smartango.com/2025/12/how-to-monitor-cloud-costs-with-kosty-an-aws-finops-utility/">https://smartango.com/2025/12/how-to-monitor-cloud-costs-with-kosty-an-aws-finops-utility/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2695b6b98d79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning Rust #Day0]]></title>
            <link>https://medium.com/@danielecr/learning-rust-day0-771140bf76c7?source=rss-161ee63f32b------2</link>
            <guid isPermaLink="false">https://medium.com/p/771140bf76c7</guid>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[zeromq]]></category>
            <category><![CDATA[json]]></category>
            <dc:creator><![CDATA[Daniele Cruciani]]></dc:creator>
            <pubDate>Wed, 28 Nov 2018 06:03:11 GMT</pubDate>
            <atom:updated>2018-11-28T06:05:21.564Z</atom:updated>
            <content:encoded><![CDATA[<h4>Having to deal with php coder who should wrote services, I argued there is no way to use ReactPHP and make them productive without wasting my time. I proposed to use C because that would be accessible to everyone, there is libzdb that manage connection pool and threads works just fine, but after 6 hours I found we should deal with json and libjsmn, writing a parser, creating a double linked tree, walk on tree, warrant that source string is not freed before the work is complete, testing the code, making it readable, so spending 2 additional days for it, and then having a code that would be almost readable, of cource more readable than the ReactPHP one, but maybe not so funny to works with. I found some rust code around and how it deals with json, ZeroMQ, threads, and connection pools. After this quick trip I started a new project and began to code. Day 0 was yesterday. I am courious to see which is the real learning curve of Rust, I decided to log some thing here. I am approaching it by the <em>pretender-pattern</em>. Pretender-pattern translates to: I do not know, I just paste this piece of code and see.</h4><p>This is a cut&amp;paste my README.md</p><h3>## Rust language notes</h3><p>Rust use Cargo to install additional packages.</p><p>Cargo needs a toml file that defines import</p><p><a href="https://docs.rs/crate/zmq/">https://docs.rs/crate/zmq/</a></p><p>in Rust everything is hardtyped, and is const if not explicitely stated. use:</p><p>```<br>let mut data = String::new();<br>```</p><p>to have a mutable string.</p><p>Memory allocation is done by the runtime.</p><p>ZMQ message has something strange inside: formatting as a string produce Some(“the string”)</p><p>If code does not compile things will not work.</p><p>If code compiles it is almost sure it will do its job.</p><p><a href="https://doc.rust-lang.org/book/2018-edition/ch04-01-what-is-ownership.html">https://doc.rust-lang.org/book/2018-edition/ch04-01-what-is-ownership.html</a></p><p>“Because ownership is a new concept for many programmers, it does take some time to get used to. “</p><h3>### that strange unwrap()</h3><p>In Rust every function return its result and its error status.</p><p>For this reasone there is unwrap() method, on the returned “object” that just take the result and panic without managing the errors.</p><p>It is not an object, but simply a returned value wrapped with error stuff.</p><p>So unwrap() returns the candy.</p><h3>## which advances, really</h3><p>Considering the alternative, nodejs, which are the real advances of<br>using Rust?</p><p>I do not care about performance because the job is really trivial, but<br>we care about robustness and availabilities of the service.</p><p>NodeJs has scope and garbage collecting things, but is not so evident<br>where it play its game.</p><p>In Javascript there is an implicit retainment of memory in the case of<br>anonymous function: closures.</p><p>Every closure define a scope, and with every scope there is a bunch of<br>pointed structures that must be maintained into ram until the closure<br>is not available anymore.</p><p>This is confusing and sometime trickly to see where memory leaks is<br>really happening.</p><p>================================</p><p>* Produced code</p><p>amazmatch.rs</p><blockquote>extern crate zmq;</blockquote><blockquote>fn main() {<br> let ctx = zmq::Context::new();</blockquote><blockquote>let receiver = ctx.socket(zmq::REP).unwrap();<br> receiver.bind(“tcp://*:5553”).unwrap();<br> let sender = ctx.socket(zmq::REQ).unwrap();<br> let str = “{\”cmd\”:\”/test\”, \”data\”: null}”;<br> sender.connect(“tcp://127.0.0.1:5553”).unwrap();<br> sender.send_str(str,0).unwrap();<br> let msg = receiver.recv_msg(0).unwrap();<br> println!(“{:?}”, msg.as_str());<br> //socket.send_str(“hello world!”, 0).unwrap();<br> <br> println!(“Hello World!”);<br>}</blockquote><p>Cargo.toml</p><blockquote>[package]<br>name = “amazmacht”<br>version = “0.1.0”<br>authors = [“user”]</blockquote><blockquote>[dependencies]<br>zmq = “0.8”</blockquote><blockquote>[[bin]]<br>name = “amazmacht”<br>path = “amazmacht.rs”</blockquote><p>Overall comment: Ohhh</p><p>Last node: I am really good at writing NodeJs code, I do not know why I am doing this, really.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=771140bf76c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Suspend api React]]></title>
            <link>https://medium.com/@danielecr/suspend-api-react-5b0ef29e0763?source=rss-161ee63f32b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b0ef29e0763</guid>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[redux-observable]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[suspense]]></category>
            <category><![CDATA[apollo-client]]></category>
            <dc:creator><![CDATA[Daniele Cruciani]]></dc:creator>
            <pubDate>Tue, 30 Oct 2018 05:42:40 GMT</pubDate>
            <atom:updated>2018-10-30T05:42:40.458Z</atom:updated>
            <content:encoded><![CDATA[<p>Riguardo a Suspense API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J88XyeqqTuCqTUCs" /><figcaption>“trees between bridge during daytime” by <a href="https://unsplash.com/@cytngl?utm_source=medium&amp;utm_medium=referral">Cayetano Gil</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>presentata qui:<br><a href="https://blog.logrocket.com/async-rendering-in-react-with-suspense-5d0eaac886c8">https://blog.logrocket.com/async-rendering-in-react-with-suspense-5d0eaac886c8</a></p><p>e qui:<br><a href="https://medium.com/@baphemot/understanding-react-suspense-1c73b4b0b1e6">https://medium.com/@baphemot/understanding-react-suspense-1c73b4b0b1e6</a></p><p>Sviluppo applicazioni web, e devo rendere disponibile all’utente la possibilità di lavorare sui dati offline, cioè nel proprio browser, per poi poter effettuare un commit dei dati dopo un certo tempo.</p><p>Attualmente si tende a salvare sempre tutto su server, si dice “è tutto su cloud, è più sicuro”. Questo però tende complica sicuramente la parte server, e non sempre le cose sono possibili quando si ha un carico di lavoro eccessivo (lavoro di programmazione, intendo).</p><p>Se devo realizzare una applicazione seguendo la filosofia cloud-first ho bisogno di servizi che tengano traccia delle modifiche transitorie e che prevedano i concetti di stato transitorio associato ad un dispositivo, o forse sarebbe meglio associarlo ad un utente, giustamente. Tutto molto bello, ma vanno considerati i costi a livello di struttura della applicazione.</p><p>Ho sentito chiamare di chi si occupa del backend “l’omino del server”. Purtroppo la complessità da gestire a livello backend non è solamente quella di occuparsi delle azioni dell’utente, ma anche di far andare d’accordo tutto il sistema con gli interventi provenienti dall’utente.</p><p>D’altra parte vorrebbe dire semplicemente aggiungere un altro layer, visto che gli stati transitori/di-lavoro non vanno fatti interagire col resto del sistema ma solo con una cache di modifica.</p><p>Ma resta il fatto che il client (il browser), non può cavarsela con le operazioni di tipo bulk sui dati quando non ha la connettività se deve necessariamente fare affidamento sul server.</p><p>In sostanza ho bisogno di redux. Ho bisogno di uno storage sul quale fare ricerche, sostituire un valore con il valore massimo presente per quella tipologia di elementi, ho bisogno di raggruppare, muovere, ordinare, fare grafici interattivi, e così via.</p><p>Tutto ciò vuol dire avere comunque bisogno di uno stato della applicazione da dover poi sincronizzare periodicamente con il backend, se l’omino del server è volenteroso, oppure salvare solo quando l’utente lo ritiene necessario.</p><p>Rimango dell’idea di continuare ad usare redux-observable, che mi permette di gestire tutto quello di cui si occupa Suspense, come la cancellazione:</p><p><a href="https://github.com/redux-observable/redux-observable/blob/master/docs/recipes/Cancellation.md">https://github.com/redux-observable/redux-observable/blob/master/docs/recipes/Cancellation.md</a></p><p>e usare redux.</p><p>L’argomentazione che il codice si complica è molto debole secondo me, i concetti di rendering e di stato dei dati della applicazione dovrebbero essere separati, proprio per rendere il codice meno complesso.</p><p>Ed è tra l’altro per questo motivo che penso di non adottare apollo client, perché ho bisogno di gestire lo stato. Anche mi pare di aver visto che apollo permette di rimpiazzare alcuni suoi pezzi, quindi potrei tenerlo in considerazione ora.</p><p>Ciò non toglie che se si hanno esigenze differenti (e se l’omino del server è spiccio), Suspense permette di scrivere molto meno codice ed essere molto più espressivo, ma fino ad un certo limite. In breve</p><blockquote>Suspense gestisce i dati dell’applicazione ma a patto che nessun altro li tocchi</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b0ef29e0763" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup Jenkins e Gogs per il CI/CD]]></title>
            <link>https://medium.com/@danielecr/setup-jenkins-e-gogs-per-il-ci-cd-674e91afc9bf?source=rss-161ee63f32b------2</link>
            <guid isPermaLink="false">https://medium.com/p/674e91afc9bf</guid>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[deployment-pipelines]]></category>
            <dc:creator><![CDATA[Daniele Cruciani]]></dc:creator>
            <pubDate>Sun, 25 Feb 2018 09:08:26 GMT</pubDate>
            <atom:updated>2018-02-25T09:08:26.197Z</atom:updated>
            <content:encoded><![CDATA[<p>Ascoltai circa un anno fa una presentazione da parte di redhat su come fare un setup di sistema di CI/CD. Poi verso la fine dello scorso anno ho avuto l’occasione di implementarlo.</p><p>Ho proceduto per fasi perché al tempo non avevo idea di come usare il tutto. Lovoro per xWave GmbH, una azienda di Francoforte (e Stoccarda) che fornisce i servizi fruibili tramite starsellersworld.com. In sostanza si vende servizi di repricing e posizionamento dei prodotti nelle piattaforme di vendita (amazon, ebay, rakuten, ….), gestione delle fatturazioni, gestione dei prodotti, gestione delle spedizioni, per venditori ecommerce. Un partner per i venditori e-commerce che possono scegliere di quali servizi acquistare.</p><p>Io in particolare mi occupo di UI/UX e alcuni servizi di aggiornamento dati (servizi in nodejs, e script in php CLI). In quest’area non è stato mai fatto il passo di adottare delle best practice di sviluppo, siamo andati avanti un po’ per inerzia, un po’ per pigrizia, un po’ per mancanza di accordi su cosa fossero “best practice”. A causa di alcuni contrasti e caratteriali (ironicamente, con uno scrum master che avrebbe dovuto cambiare tutto questo) mi sono trovato solo, o meglio, mi sono trovato ad essere il più autorevole riguardo quest’area di sviluppo.</p><h3>Redmine e Gogs</h3><p>Come logico, avevamo in cantiere diversi progetti. Il mio primo passo effettivamente è stato installare redmine e prenderci confidenza. L’ho fatto in locale, in un docker (2, ovvero un docker-compose). E quindi ho integrato gogs a redmine. Niente di particolarmente complesso, l’unico lato oscuro era per me far comunicare dei containers docker. Ma ho scoperto che era possibile aggiungere una rete ad un container col comando</p><pre>docker network connect container1 container2</pre><p>Per ignoranza che non ho aggiunto gogs allo stesso container, e nemmeno definito una rete di tipo bridge dove far girare tutti i containers, così da poter riferirmi ad un container nella stessa rete chiamandolo per nome o imageid.</p><p>Poi ho chiesto se potessi avere un server dove installarci questi servizi.</p><p>Gogs+Redmine, finalmente avevamo un repository nostro dove tener traccia delle modifiche, e visibile a tutti, e un tool per gestire i progetti e poter avere un quadro della situazione. Tanto è vero che il capo mi cazziava sulle scadenze.</p><h3>Jenkins (e Gogs)</h3><p>Non so perché, ma avevo pianificato di usare Gogs e i suoi hook per automatizzare il deploy. Ma per un qualche motivo mi sono ricordato di <strong>Jenkins</strong>. Era arrivato natale ed avevo un po’ di tempo libero, così lo installai in locale (altro container). La prima cosa che feci è leggermi il tutorial ed implementare il servizio in node. Andando avanti ho capito che infondo non ho molto altro da imparare riguardo a Jenkins.</p><p><a href="https://jenkins.io/doc/tutorials/build-a-node-js-and-react-app-with-npm/">Build a Node.js and React app with npm</a></p><p>Jenkins è naturalmente in grado di predere repository presso qualsiasi fonte git, e quindi gogs andava benissimo, ovviamente specificando l’ip della LAN del docker (ma dall’ip pubblico sarebbe andato lo stesso). Il problema è che volevo che venisse fatto un deploy ad ogni rilascio di versione. Per questo c’è il plugin:</p><p><a href="https://github.com/jenkinsci/gogs-webhook-plugin">jenkinsci/gogs-webhook-plugin</a></p><p>La cosa comoda di jenkins è che tutto viene gestito dall’interno, a differenza di Redmine, ad esempio per installare un plugin basta cercarlo dalla sezione configurazione, selezionarlo, e installarlo. E voila:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nzAaXfqfOiRvnaHGDLfaZw.png" /></figure><p>in <strong>Gogs</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_XQ_3O7-y_uxPI1uxI-X2g.png" /></figure><p>Ok, <em>job=</em> deve riferirsi allo stesso nome del job jenkins, ma non va di riprendere la schermata, è domenica, un po’ di comprensione.</p><p>Anche riguardo agli eventi, selezionando “Lasciami scegliere ciò di cui ho bisogno” vengono mostrati tutti gli eventi e si può selezionare “rilascio”, che vuol dire che ad ogni push di un nuovo tag verrà eseguita la pipeline. Personalmente preferisco definire la pipeline all’interno del repository</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3uifhT9plDCvWE3ZGYcSbw.png" /></figure><h4>Nota riguardo le credenziali</h4><p>Ho generato una chiave tramite</p><pre>ssh-keygen -t rsa</pre><p>Senza specificare password, salvando poi la coppia nella <em>jenkins_home/.ssh</em></p><p>Poi in Gogs ho aggiunto un utente Jenkins, per il quale ho caricato la chiave pubblica (generata sopra). Poi ad ogni progetto Gogs ho aggiunto l’utente Jenkins in lettura. Caricare una deploy key per ogni progetto è più macchinoso inoltre <strong><em>se si carica una deploy key, questa non potrà essere usata come chiave di accesso per un utente</em></strong>, questo può essere considerato molto probabilmente un bug di Gogs, che ho segnalato.</p><h4>Jenkinsfile</h4><p>Ho seguito le indicazioni del tutorial, salvando Jenkinsfile nel repo. Penso ancora sia la scelta giusta.</p><p><a href="https://jenkins.io/doc/book/pipeline/syntax/">Pipeline Syntax</a></p><p>Per me un Jenkinsfile è:</p><pre>pipeline {<br>    agent none<br>    environment {<br>        CI = &#39;true&#39;<br>    }<br>    stages {<br>        stage(&#39;Build&#39;) {<br>    agent {<br>        dockerfile {<br>          args &#39;-v /srv/docker/jenkins-data/.ssh:/root/.ssh&#39;<br>        }<br>    }<br><br>            steps {<br>                sh &#39;npm install&#39;<br>            }<br>        }<br>        stage(&#39;Test&#39;) {<br>    agent {<br>        dockerfile {<br>          args &#39;-v /srv/docker/jenkins-data/.ssh:/root/.ssh&#39;<br>        }<br>    }<br>            steps {<br>                sh &#39;./jenkins/scripts/test.sh&#39;<br>            }<br>        }<br>        stage(&#39;PHPtestt&#39;) {<br>            agent {<br>              dockerfile {<br>                  filename &#39;Dockerfilephp&#39;<br>                  args &#39;-v /srv/docker/jenkins-data/.ssh:/root/.ssh&#39;<br>               }<br>            }<br>            steps {<br>                sh &#39;./jenkins/scripts/testphp.sh&#39;<br>            }<br>        }<br>	stage(&#39;Upload&#39;) {<br>    agent {<br>        dockerfile {<br>          args &#39;-v /srv/docker/jenkins-data/.ssh:/root/.ssh&#39;<br>        }<br>    }<br>	    steps {<br>		sh &#39;./jenkins/scripts/upload.sh&#39;<br>	    }<br>	}<br>    }<br>}</pre><p>Che, a parte l’essere non indentato, è piuttosto particolare, infatti avremmo bisogno di aggiornare un server del backend che utilizza ancora una versione di php 5.3, e non essendo supportata ho utilizzato trovato cespi al quale ho aggiunto phpunit per i test (Dockerfilephp):</p><pre>FROM cespi/php-5.3:cli-latest<br><br>RUN apk update &amp;&amp; apk add openssh<br>RUN apk add sshpass<br><br>RUN curl -s http://getcomposer.org/installer | php \<br>    &amp;&amp; mv composer.phar /usr/local/bin/ \<br>    &amp;&amp; ln -s /usr/local/bin/composer.phar /usr/local/bin/composer</pre><p>Per curiosità, filter-ssw è un modulo che si occupa di definire dei filtri condizionali su dei dati da importare, con una interfaccia web javascript che genera un json. Questo json viene salvato nel db, e successivamente utilizzato per filtrare i dati importati. Quindi la parte che riguarda esegue test tramite jest (che fortunatamente integra in modo trasparente jsdom):</p><pre>var fs = require(&#39;fs&#39;);<br>var myhtml = fs.readFileSync(__dirname + &#39;/basehtml.html&#39;);<br><br>const htmlSnip = myhtml.toString();<br><br>test(&#39;should fillup json decoded from def&#39;, (done) =&gt; {<br><br>    document.body.innerHTML = htmlSnip;<br>    require(&#39;../libraries/jquery-1.8.2.min&#39;);<br>    require(&#39;../libraries/jquery-ui-1.9.0.custom.min&#39;);<br><br>....bla eblah</pre><pre>    setTimeout(() =&gt; {<br>        const lhtml = $(&#39;#jsonwith-ast&#39;).html();<br>        expect(lhtml).not.equals(&#39;&#39;);<br>        done()<br>    }, 3000);<br>})</pre><p>e la parte che riguarda il php esegue gli unit test tramite phpunit.</p><h4>Step sequenziali</h4><p>In generale gli step all’interno di una pipeline sono eseguiti in maniera sequenziale. Al verificarsi di un errore, la pipeline è interrotta:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L9NfKRLpBVcjAxVZOwM4Ag.png" /></figure><h3>Deployment</h3><p>Il deploy script potrebbe essere più interessante (è in jenkins/scripts/upload.sh)</p><pre>#!/usr/bin/env sh</pre><pre>echo &quot;create package for 246&quot;<br>tar czf filter-package-246.tar.gz -T package-246_filelist.txt<br>echo &quot;show content of 246-package&quot;<br>tar tzf filter-package-246.tar.gz</pre><pre>echo &quot;create package for 246&quot;<br>tar czf filter-package-247.tar.gz -T package-247_filelist.txt<br>echo &quot;show content of 247-package&quot;<br>tar tzf filter-package-247.tar.gz</pre><pre>FOLDER246=/srv/...<br>BACKUPCOMMAND=&quot;cd $FOLDER246; tar czf backup-filter$(date +%Y%m%d%H%M%S).tar.gz js/actiongroup.js js/fieldaction.js js/filter2.js csv_sets_wizard6.php csv_sets_wizard4_xml.php&quot;</pre><pre>UNPACKCOMMAND=&quot;cd $FOLDER246; tar xzf filter-package-246.tar.gz&quot;<br>ssh -o StrictHostKeyChecking=no utente@frontendip $BACKUPCOMMAND<br>scp filter-package-246.tar.gz utente@frontendip:$FOLDER246/<br>ssh -o StrictHostKeyChecking=no utente@frontendip $UNPACKCOMMAND</pre><pre>BACKUPCOMMAND=&quot;cd /path/.../; tar czf backup-filter$(date +%Y%m%d%H%M%S).tar.gz FilterActionOnline.class.php&quot;</pre><pre>UNPACKCOMMAND=&quot;cd /path/.../; tar xzf filter-package-247.tar.gz&quot;</pre><pre>scp -o StrictHostKeyChecking=no filter-package-247.tar.gz utente2@backendip:/path/..../<br>ssh utente2@backendip $BACKUPCOMMAND<br>ssh utente2@backendip $UNPACKCOMMAND</pre><p>Ho rimosso dati sensibili, ma avendo la chiave ssh montata nel docker che si occupa dell’upload viene fatta l’autenticazione tramite public key e challenge. Specificare -o StrictHostKeyChecking=no è necessario, fintantoché non sia stato aggiornato known_hosts includendo l’host remoto.</p><h3>Cosa succede dunque</h3><p>All’azione</p><pre>git tag v19<br>git push --tags</pre><p>Gogs riceve il tag, e invia una richiesta a Jenkins, con la secret specificata. Jenkins avvia il job relativo, prelevando da Gogs il repository che contiene la definizione della pipeline. L’esecuzione della pipeline e i log di questa vengono salvati e sono visibili accedendo a Jenkins.</p><h3>E il build?</h3><p>I test sono molto fastidiosi, e il deploy è delicato e macchinoso, sicuramente Jenkins toglie il grosso del lavoro. Ma c’è anche un altro aspetto: il build. Certo, con php e javascript (a parte il transpilling) non c’è molto da fare, ma per una applicazione electron è veramente snervante. Grazie a Jenkins non devo fare altro che rilasciare una nuova versione, ed esso avvia il build e lo carica in un server a cui ho accesso (io e i miei colleghi). La cosa comoda è poter sbirciare i log del build, basta specificare <em>-v /home/myhome/builds/logs:/root/.npm</em> ad esempio, per poter vedere i log di npm.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=674e91afc9bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>