<?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 Juan C. Cruz on Medium]]></title>
        <description><![CDATA[Stories by Juan C. Cruz on Medium]]></description>
        <link>https://medium.com/@juca_cruz?source=rss-7db46c11e7aa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*2zEfwdDgQaSCXTzf.JPG</url>
            <title>Stories by Juan C. Cruz on Medium</title>
            <link>https://medium.com/@juca_cruz?source=rss-7db46c11e7aa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 12:20:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@juca_cruz/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[Customize Jenkins SSH Agent for Windows]]></title>
            <link>https://medium.com/@juca_cruz/customize-jenkins-ssh-agent-for-windows-5aae53cf8ade?source=rss-7db46c11e7aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/5aae53cf8ade</guid>
            <category><![CDATA[dockerfiles]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[error]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Juan C. Cruz]]></dc:creator>
            <pubDate>Wed, 21 Aug 2024 23:21:38 GMT</pubDate>
            <atom:updated>2024-08-21T23:21:38.516Z</atom:updated>
            <content:encoded><![CDATA[<p>While building a Docker image for Windows based Jenkins agent, I stumbled upon this challenge:</p><p>My team was using a Windows VM to act as a Jenkins Agent to build and deploy .NET apps</p><p>It works like a charm.</p><p>However, I would like to be 100% on Containers, so we decided to embark on the journey of dockerizing this VM.</p><p>Using as baseline <a href="https://www.blogger.com/blog/post/edit/5236223959610973624/7209215014168608075#">jenkins/ssh-agent:windowsservercore-ltsc2022-jdk21</a> we extended that OOTB image by adding the required software installed on the VM:</p><ul><li>Nuget 6.10</li><li>Visual Studio 2019 Build Tools</li><li>Visual Studio 2019 Test Agent</li><li>.NET Framework Developer Pack version 4.5.1–4.6.2</li><li>MSDeploy (webdeploy)</li></ul><p>The main challenge we faced was to copy/paste some files into a particular location</p><pre>C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VisualStudio\v16.0</pre><p>We kept on getting nasty errors like these each time we referenced that folder:</p><pre>x86 : The term &#39;x86&#39; is not recognized as the name of a cmdlet, function, <br>script file, or operable program. Check the spelling of the name, or if a path <br>was included, verify that the path is correct and try again.<br>At line:1 char:40<br>+ Get-ChildItem -Path C:\`Program Files (x86)\`Microsoft Visual Studio\ ...<br>+                                        ~~~<br>    + CategoryInfo          : ObjectNotFound: (x86:String) [], CommandNotFound <br>   Exception<br>    + FullyQualifiedErrorId : CommandNotFoundException</pre><p>Our solution was switching the Work Directory and we never looked back (or had to reference such folder)</p><pre>WORKDIR C:\\&#39;Program Files (x86)&#39;\\Microsoft Visual Studio\\2019\\BuildTools\\MSBuild\\Microsoft\\VisualStudio\\v16.0</pre><p>And that’s how you work around that nasty error.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5aae53cf8ade" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD pipeline on Jenkins using Docker]]></title>
            <link>https://medium.com/@juca_cruz/ci-cd-pipeline-on-jenkins-using-docker-16d785a62720?source=rss-7db46c11e7aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/16d785a62720</guid>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[sfcc]]></category>
            <category><![CDATA[salesforce-commerce-cloud]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Juan C. Cruz]]></dc:creator>
            <pubDate>Fri, 02 Aug 2024 23:21:39 GMT</pubDate>
            <atom:updated>2024-08-08T20:37:25.699Z</atom:updated>
            <content:encoded><![CDATA[<h3>Previously:</h3><p><a href="https://medium.com/@juca_cruz/ci-cd-pipeline-for-salesforce-commerce-cloud-jenkins-part-i-9138e2df1480">CI/CD pipeline on Jenkins — I</a></p><p><a href="https://medium.com/@juca_cruz/ci-cd-pipeline-for-sfcc-jenkins-part-ii-0c796edf7e84">CI/CD pipeline on Jenkins — II</a></p><h3>Now</h3><p>I would like to document here what would it look like a similar setup running on <a href="https://www.blogger.com/blog/post/edit/5236223959610973624/5240050491957057229#">Azure Container Instances </a>(using <a href="https://www.blogger.com/blog/post/edit/5236223959610973624/5240050491957057229#">Docker</a>):</p><ul><li>Login to Azure Portal</li><li>Select the appropriate Subscription to use</li><li>Activate the contributor role</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*-n6lBWRUDOT1UV-X" /></figure><ul><li>Open Azure Cloud Shell</li><li>Let the fun begin! 🥳</li></ul><h3>Create Jenkins main node with persistent storage</h3><p>Containers by default are stateless, so we need to prevent data loss at all cost.</p><p>By using persistent storage no matter how many times the container gets terminated and restarted, we will not lose any data;</p><p>The goal will be to have JENKINS_HOME (<strong>/var/jenkins_home</strong>) safely stored outside of the container.</p><pre># Change these four parameters as needed<br>ACI_PERS_RESOURCE_GROUP=myJenkinsResourceGroup<br>ACI_PERS_STORAGE_ACCOUNT_NAME=myjenkinsstorageacct1<br>ACI_PERS_LOCATION=eastus<br>ACI_PERS_SHARE_NAME=acishare</pre><p>A resource group is a logical folder where we will store (group) all the items that belong to this project, this will help us to be more organized.</p><pre># Create the storage account with the parameters<br>az storage account create - resource-group $ACI_PERS_RESOURCE_GROUP - name $ACI_PERS_STORAGE_ACCOUNT_NAME - location $ACI_PERS_LOCATION - sku Standard_LRS</pre><pre># Create the file share<br>az storage share create - name $ACI_PERS_SHARE_NAME - account-name $ACI_PERS_STORAGE_ACCOUNT_NAME</pre><pre># Retrieve the storage key<br>STORAGE_KEY=$(az storage account keys list - resource-group $ACI_PERS_RESOURCE_GROUP - account-name $ACI_PERS_STORAGE_ACCOUNT_NAME - query &quot;[0].value&quot; - output tsv)</pre><pre># Creation of our Jenkins main node<br>az container create - resource-group $ACI_PERS_RESOURCE_GROUP - name my-jenkins-main-01 - image jenkins/jenkins:latest - dns-name-label jenkins-main-ci - ports 8080 - azure-file-volume-account-name $ACI_PERS_STORAGE_ACCOUNT_NAME - azure-file-volume-account-key $STORAGE_KEY - azure-file-volume-share-name $ACI_PERS_SHARE_NAME - azure-file-volume-mount-path /var/jenkins_home - environment-variables &#39;JAVA_OPTS&#39;=&#39;-Dorg.apache.commons.jelly.tags.fmt.timeZone=America/New_York&#39;</pre><p>After this, we should have a Jenkins main / master node up and running on ACI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/0*2S4dDn_b4Cas1RVf" /></figure><h3>Create Jenkins Inbound Agent</h3><p>As a good practice, we will not be executing any building jobs out of the main node but we will align to our Jenkins architecture.</p><p>Inside Jenkins main node we need to provision a new Node as a Permanent Agent:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/0*rpZBsdul32mrug-9" /></figure><p>Once completed the creation process on Jenkins main node, this is what the Status section will look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*v92xELbRc-_gNctR" /></figure><p>Unlike with main node, we decided to go for our own customized jenkins inbound-agent since we require certain additional tools as noted in previous posts.</p><p>Now going back to Azure Cloud Shell, you will need to execute the following create command:</p><pre>az container create - resource-group $ACI_PERS_RESOURCE_GROUP - name my-agent-node-01 - image mywwwcontainerregistry001.azurecr.io/wwwcontainer/jenkins-inbound-agent-linux-image:0.0.2 - os-type linux - dns-name-label jenkins-node-01-ci - ports 443 - command-line &quot;java -jar /usr/share/jenkins/agent.jar -url http://jenkins-main-ci.eastus.azurecontainer.io:8080 -secret &lt;SECRET_GOES_HERE&gt; -name build-agent-image-01 -workDir /home/jenkins/work -webSocket&quot; - cpu 4 - memory 6</pre><h4>Some considerations</h4><pre>- command-line &quot;java -jar /usr/share/jenkins/agent.jar -url http://jenkins-master-ci.eastus.azurecontainer.io:8080/ -secret &lt;SECRET_GOES_HERE&gt; -name build-agent-image-01 -workDir /home/jenkins/work -webSocket&quot;</pre><p>This parameter ( <em>— command-line</em>) tells the container to execute this command(s) when starts, so it will try to connect to its main node as soon as it comes online.</p><p>The key here is to <strong>include the modifier</strong> <em>-webSocket</em>, <strong>otherwise it will not be able to communicate with the main node</strong>.</p><p>If everything went as planned, the agent will show online in a couple of minutes.</p><h4>Why didn’t you stick with the <a href="https://www.blogger.com/blog/post/edit/5236223959610973624/5240050491957057229#">OOTB Jenkins Inbound agent for linux</a> like you did for the main node with <a href="https://www.blogger.com/blog/post/edit/5236223959610973624/5240050491957057229#">jenkins/jenkins:latest</a>?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*11iUPGXevjDEMFZR" /></figure><p>If you have been paying attention and had read my previous posts, we need some special software to be installed on the agent to make it possible to compile and deploy SFCC code base:</p><ul><li>rsync</li><li>7zip</li><li>maven (optional)</li><li>git</li><li>curl</li><li>sudo</li><li>NodeJS 10.24.1</li><li>NPM</li><li>typescript</li><li><a href="https://www.blogger.com/blog/post/edit/5236223959610973624/5240050491957057229#">sfcc-ci</a></li></ul><p>Therefore we need a custom image, but since I am not a big fan of reinventing the wheel, I extended the <a href="https://hub.docker.com/r/jenkins/ssh-agent">OOTB agent</a> and <a href="https://hub.docker.com/r/wwwcontainer/jenkins-inbound-agent-linux-image">this is the result</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BMMDx88oEKtJkl7G" /></figure><p>If you are the type of fellow who would like build the docker image from scratch, here it is the Dockerfile for your own amusement:</p><pre>FROM jenkins/ssh-agent:latest<br><br>#Switch to root<br>USER root<br><br># Install rsync, 7zip, maven, git, curl &amp; sudo<br>RUN apt-get update \<br>&amp;&amp; DEBIAN_FRONTEND=noninteractive \<br>apt-get upgrade -y \<br>&amp;&amp; apt-get install -y rsync p7zip-full maven git curl sudo<br><br># Clean up APT when done.<br>RUN apt-get clean &amp;&amp; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*<br><br>#Setup NodeJS &amp; NPM<br>ARG NODE_VERSION=10.24.1<br>ARG NODE_PACKAGE=node-v$NODE_VERSION-linux-x64<br>ARG NODE_HOME=/opt/$NODE_PACKAGE<br>ENV NODE_PATH $NODE_HOME/lib/node_modules<br>ENV PATH $NODE_HOME/bin:$PATH<br>RUN curl https://nodejs.org/dist/v$NODE_VERSION/$NODE_PACKAGE.tar.gz | tar -xzC /opt/<br><br>#Install Typescript - test<br>RUN npm install -g typescript<br><br>#Install SFCC-CI<br>RUN npm install -g sfcc-ci<br><br>#Create &quot;alias&quot; (soft link) for 7z<br>RUN ln -s $(which 7z) /usr/bin/7zz<br><br>#Switch to jenkins<br>USER jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*ujyk8VqasrxREvUY" /></figure><p>Now it’s up to you to try and see the magic with your own eyes!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/0*ElLXjcckFlTCEfI4" /></figure><p><em>Originally published on </em><a href="https://juca-cruz-utilities.blogspot.com/2024/09/previously-cicd-pipeline-on-jenkins-i.html"><em>juca-cruz-utilities.blogspot.com</em></a><em> on July 2024</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16d785a62720" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD Pipeline for SFCC — Jenkins — part II]]></title>
            <link>https://medium.com/@juca_cruz/ci-cd-pipeline-for-sfcc-jenkins-part-ii-0c796edf7e84?source=rss-7db46c11e7aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c796edf7e84</guid>
            <category><![CDATA[salesforce-commerce-cloud]]></category>
            <category><![CDATA[sfcc]]></category>
            <category><![CDATA[sfcc-cli]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[Juan C. Cruz]]></dc:creator>
            <pubDate>Thu, 11 Jul 2024 19:32:17 GMT</pubDate>
            <atom:updated>2024-07-11T19:32:17.928Z</atom:updated>
            <content:encoded><![CDATA[<h3>CI/CD Pipeline for Salesforce Commerce Cloud — Jenkins — part II</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*dz2_wlj_rC8hk94D.png" /></figure><p>On a <a href="https://medium.com/@juca_cruz/ci-cd-pipeline-for-salesforce-commerce-cloud-jenkins-part-i-9138e2df1480">previous post</a>, we went over setting up a CI/CD pipeline for <a href="https://www.salesforce.com/products/commerce/">SFCC</a> using Windows.</p><h3>What’s next?</h3><p>Let’s give it a try with Linux!!!</p><h3>Why Linux and not Windows?</h3><p><em>Linux is much more efficient in terms of managing and executing resource intensive tasks like compiling and packaging code projects.</em></p><p>Historically, Linux is 30–40% faster when performing such tasks, a few additional elements to consider:</p><ul><li><strong>Linux performs faster git operations </strong>— Linux performs command line git operations faster than Windows (as evidenced by ci.jenkins.io git client plugin automated tests requiring 12 minutes on Linux and 22 minutes on Windows)</li><li><strong>Fewer locking issues</strong> — Linux file system locking semantics are more forgiving than Windows file system locking semantics. It is more likely that a “busy file” on Windows will disrupt the Jenkins controller than it will on Linux.</li><li><strong>License cost</strong>.</li></ul><p>Our journey has taken us from a process that used to take 3–4 hours when we were leveraging a vendor owned and managed implementation to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*3HJuoiDtGARAISVT.png" /></figure><p>So expect at least to achieve better times than with Windows.</p><p>If you are still with me, this is the translation into shell:</p><h4>Code build</h4><pre>#!/bin/bash<br>export PATH=/usr/local/bin/7zip:$PATH<br>export PREFIX=&quot;B2C&quot;<br>export COMMIT_SHORT=&quot;${GIT_COMMIT::7}&quot;<br>export BRANCH=${GIT_BRANCH//\//_}<br>export BUILD_VERSION=${PREFIX}_${BRANCH}_${BUILD_NUMBER}_${COMMIT_SHORT}<br><br>echo &quot;***Deleting Folders to skip&quot;<br>rm -rf ./cartridges/useless_folder<br><br>echo &quot;***Installing NPM &amp; Build project&quot;<br>npm install --silent<br>npm run build --silent<br><br>echo &quot;***Cleaning up manually build folder&quot;<br>#Since workspace is always cleaned, this step is optional<br>rm -rf ./$BUILD_VERSION<br>mkdir ./$BUILD_VERSION<br><br>echo &quot;***Preparing to package project - rsync&quot;<br>#skipping files: .project *.java *.docx *.cpp *.php<br>#skipping folders: junk<br>rsync -rq --exclude={&#39;.project&#39;,&#39;*.java&#39;,&#39;*.cpp&#39;,&#39;*.php&#39;} --exclude={&#39;junk&#39;} ./cartridges/ $BUILD_VERSION<br><br>echo &quot;***Packaging deployable artifact - 7z&quot;<br>#&quot;-mx[N]&quot; specifies compression level<br>#&quot;-mmt[N]&quot; set number of CPU threads<br>7zz a $BUILD_VERSION.zip $BUILD_VERSION -mx9 -mmt16</pre><h4>Code deploy</h4><p>Nothing new here, feel free to reuse the one we did on our <a href="https://medium.com/@juca_cruz/ci-cd-pipeline-for-salesforce-commerce-cloud-jenkins-part-i-9138e2df1480">first iteration</a>.</p><p>Have fun!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/0*e0_mObPzuRvbvH1t.png" /></figure><p><em>Originally published on</em><a href="https://juca-cruz-utilities.blogspot.com/2024/02/cicd-pipeline-for-sfcc-jenkins-part-ii.html"><em> juca-cruz-utilities.blogspot.com</em></a><em> on Feb 2024</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c796edf7e84" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD Pipeline for Salesforce Commerce Cloud — Jenkins — part I]]></title>
            <link>https://medium.com/@juca_cruz/ci-cd-pipeline-for-salesforce-commerce-cloud-jenkins-part-i-9138e2df1480?source=rss-7db46c11e7aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/9138e2df1480</guid>
            <category><![CDATA[sfcc-cli]]></category>
            <category><![CDATA[sfcc]]></category>
            <category><![CDATA[salesforce-commerce-cloud]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[Juan C. Cruz]]></dc:creator>
            <pubDate>Tue, 25 Jun 2024 13:39:40 GMT</pubDate>
            <atom:updated>2024-07-15T21:10:27.728Z</atom:updated>
            <content:encoded><![CDATA[<h3>CI/CD Pipeline for Salesforce Commerce Cloud — Jenkins — part I</h3><p>Story time: Setting up an efficient CI/CD Pipeline for Salesforce Commerce Cloud</p><p><em>A little bit of context</em></p><p>Our main vendor was running this capability, which enabled the team to run deployments once per week or maybe every other day. That seemed great as the <em>status quo</em>;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*sA9ha2xWFI7-nsyy" /></figure><p>However, waiting for a build to complete in 3–4 hours doesn’t work for me, the goal was to enable the team to deploy at least every hour or less.</p><p>Following a nice combination of creativity plus thinking outside of the box, we setup a pipeline which deploys under 15 minutes (12) to 4 different Instances of Salesforce Commerce Cloud (DEV, INT, QA and STG).</p><p>I am not going to showcase what it looked like in the past, because water under the bridge</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/0*KB91Hg01beQlOp53" /></figure><h4>Overview</h4><p><a href="https://www.jenkins.io/">Jenkins</a> is an open source automation server. It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration, and continuous delivery. It is a server-based system that runs in servlet containers such as Apache Tomcat.</p><p><strong><em>Build great things at any scale</em></strong></p><p>Jenkins provides hundreds of plugins to support building, deploying and automating any project.</p><p>We decided to set it up on a VM in Azure since that’s what we have. We started with a Windows VM for the following reason, we wanted to mirror as much as possible the original setup done by our vendor so we could leverage if there was any institutional knowledge.</p><p>In a future iteration we might use Linx and why not, a Dockerized image.</p><p>The fun part is in the job</p><ul><li>Be organized</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/0*xWCIbtRqzYj0F07J" /></figure><ul><li>Define a unique and short name in order to avoid issues with file system limitations</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*6IJp4SvXwpJ0NNN8" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*85wJAlBdEx3EqtkK" /></figure><ul><li>Add a meaningful description</li><li>Define a clear build strategy — build retention — this will help you to manage your disk space</li><li>Reference your GitHub repo</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*H3G1-EQpyc75r-tn.png" /></figure><ul><li>Make use of Display Name</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/0*ZtAgnt4jq6anZvZA.png" /></figure><ul><li>Enable CI/CD! — This is where we let Jenkins do the checking if there is a new change that needs to be deployed — currently we set that value to 15</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/0*kI83FuxQfD13xg80" /></figure><ul><li>Always delete your workspace in order to prevent old code to be present, we always need a fresh copy of the repo</li><li>Add timestamps to the Console Output — they are super helpful</li><li>Clean up your workspace, but be selective so it will be fast</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/0*80PJLBl0QYIAZWeY" /></figure><ul><li>Use secret bindings (no hardcoded passwords!)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/0*ZOK418W3cSFG0mwg.png" /></figure><ul><li>Add your own build steps. Since you-all came to see the cooking recipe for SFCC Deployments, here it is:</li></ul><p>The steps are quite self explanatory, however one pre-requisit is to have installed <a href="https://github.com/SalesforceCommerceCloud/sfcc-ci">SFCC-CLI</a></p><h4>Windows batch commands</h4><pre>:: Setting variables<br>call set PREFIX=DEVOPS<br>call set PATH=%PATH%;C:\Program Files\7-Zip<br>call set COMMIT_SHORT=%GIT_COMMIT:~0,7%<br>call set BRANCH=%GIT_BRANCH:/=_%<br>call set BUILD_VERSION=%PREFIX%_%BRANCH%_%BUILD_NUMBER%_%COMMIT_SHORT%<br>:: Delete Folders to skip<br>call rmdir /S /Q cartridges\useless_folder<br>:: Install NPM &amp; Build project<br>:: - silent flag suppress output<br>call npm install - silent<br>call npm run build - silent<br>:: Package build<br>:: Since workspace is always cleaned, this next step is optional<br>call rmdir /S /Q %BUILD_VERSION%<br>call mkdir %BUILD_VERSION%<br>:: Robocopy<br>:: skipping files: .project .tern-project .gitignore README.md *.java *.c *.php<br>:: skipping folders: .settings junk<br>call robocopy cartridges %BUILD_VERSION% /E /Z /ZB /R:5 /W:5 /TBD /NP /V /MT:16 /XF .project .tern-project .gitignore README.md *.java *.c *.php /XD .settings junk<br>:: 7z<br>:: &quot;-mx[N]&quot; specifies compression level<br>:: &quot;-mmt[N]&quot; set number of CPU threads<br>call 7z a %BUILD_VERSION%.zip %BUILD_VERSION% -mx9 -mmt16</pre><h4>Shell commands</h4><pre>#Setting variables<br>export PREFIX=&quot;DEVOPS&quot;<br>export TARGET_INSTANCE_DEV=&quot;development-domain.demandware.net&quot;<br>export TARGET_INSTANCE_INT=&quot;integration-domain.demandware.net&quot;<br>export TARGET_INSTANCE_QA=&quot;cert.qa.domain.demandware.net&quot;<br>export TARGET_INSTANCE_STG=&quot;cert.staging.domain.demandware.net&quot;<br>export COMMIT_SHORT=&quot;${GIT_COMMIT::7}&quot;<br>export BRANCH=${GIT_BRANCH//\//}<br>export BUILD_VERSION=${PREFIX}${BRANCH}${BUILD_NUMBER}${COMMIT_SHORT}<br>echo &quot;DEPLOYING $BUILD_VERSION TO $TARGET_INSTANCE_DEV, $TARGET_INSTANCE_INT, $TARGET_INSTANCE_QA and $TARGET_INSTANCE_STG&quot;<br><br>#Login into SFCC<br>npx sfcc-ci client:auth --selfsigned $SFCC_CLIENT $SFCC_CLIENT_SECRET --renew<br><br>#Deploy package<br>npx sfcc-ci code:deploy $BUILD_VERSION.zip -i $TARGET_INSTANCE_DEV<br>npx sfcc-ci code:deploy $BUILD_VERSION.zip -i $TARGET_INSTANCE_INT<br>npx sfcc-ci code:deploy $BUILD_VERSION.zip -i $TARGET_INSTANCE_QA -c $SFCC_TEST_REALM_CERT -p $SFCC_TEST_REALM_CERT_SECRET<br>npx sfcc-ci code:deploy $BUILD_VERSION.zip -i $TARGET_INSTANCE_STG -c $SFCC_REALM_CERT -p $SFCC_REALM_CERT_SECRET</pre><p>Something to consider, we leveraged <a href="https://help.salesforce.com/s/articleView?id=000391641&amp;type=1">P12 Cert</a> to deploy to our QA and STG environment to make sure we take advantage of 2FA.</p><p>So there you have it!</p><p>Feel free to use this as your baseline and please share your refined versions as a comment so we can help each other.</p><p><em>Originally published on </em><a href="https://juca-cruz-utilities.blogspot.com/2023/12/cicd-pipeline-for-sfcc-jenkins.html"><em>juca-cruz-utilities.blogspot.com</em></a><em> on Dec 2023</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9138e2df1480" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Contractors vs Agencies]]></title>
            <link>https://medium.com/@juca_cruz/contractors-vs-agencies-ada73cff3aae?source=rss-7db46c11e7aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/ada73cff3aae</guid>
            <category><![CDATA[consulting-services]]></category>
            <category><![CDATA[partners]]></category>
            <category><![CDATA[systems-integration]]></category>
            <category><![CDATA[sw-development]]></category>
            <category><![CDATA[contractors]]></category>
            <dc:creator><![CDATA[Juan C. Cruz]]></dc:creator>
            <pubDate>Tue, 25 Jun 2024 13:32:12 GMT</pubDate>
            <atom:updated>2024-06-25T13:32:12.119Z</atom:updated>
            <content:encoded><![CDATA[<h3><em>It’s been almost been a year since I switched jobs, it has been a fun/exciting /frustrating/&lt;placeholder for more emotions&gt; journey, and besides the logical and expected differences between jobs.</em></h3><p>There is one thing that has been quietly consuming my idle time: This company loves their agencies!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*JVtekmYkmesC5A1w" /></figure><p>When there is no budget to hire Full Time Employees or support to do that altogether, the workaround is to hire Contractors, although is easier to get more people from an existing “Partner”, however I tend to steer away from that strategy in order to build new practices or even increase velocity;</p><p>Besides the elephant in the room</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/0*CV27WHpD9cKPuBGh.gif" /></figure><p>These are my reasons on why I diversify my portfolio of partners and approaches on how to grow teams:</p><h3>Agencies have an incentive to create hard boundaries and push towards a “feature factory” culture</h3><p>This way they’ll sell more “resources”. Making roles more granular helps selling more profiles.</p><p>For example:</p><ul><li>1 Project Manager</li><li>2 Backend Developers</li><li>2 Front End Developers</li><li>2 QAs</li></ul><p>When it could be just 2 or 3 senior engineers!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/166/0*xhTOaoD0QVnprFkm.png" /></figure><p>With such segregation of responsibilities, each team member can also be more junior on average, and the non-senior profiles are the ones where agencies make the highest margins.</p><p>This translates into suddenly a team of 10 or 15 people, without actually shipping much value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Z5uDV7bkNvfVvaUH" /></figure><h3>Agencies don’t have an incentive for increasing code quality standards</h3><p>Clunky QA and Deployment processes are an opportunity for them to sell the people who operate them. Why should they push for automated CI/CD? <em>They would lose business by doing it!</em></p><p>Issues in Production mean more bug tickets, regression tasks, triage calls, etc. That’s an scope increment they’ll happily bill for.</p><p>Also there’s an incentive to accept loosely defined tasks, and not go deep to define all edge cases ahead of development. This will generate more work down the road.</p><p>Bottomline, it will hurt the client’s pockets!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*QnZy9MmfLJ9Xrcvf" /></figure><h3>Agencies create barriers and bureaucracy</h3><p>This makes super easy to add new people to the team. But not so easy to downscale when needed. Or to fire that person who’s not performing. Unless, the person responsible for the relationship decides to go over a lengthy process to discuss why you don’t want certain individuals (I did this and it’s worth the effort)</p><p>Contract clauses like minimum tenures and so on can really hinder nimbleness in a small team (your legal and procurement team will help you here).</p><p><em>Originally published on </em><a href="https://juca-cruz-utilities.blogspot.com/2023/10/contractors-vs-agencies.html"><em>juca-cruz-utilities.blogspot.com</em></a><em> on Oct 2023</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ada73cff3aae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are GitHub Copilot and GPT-4 the cure for all our software engineering bottlenecks?]]></title>
            <link>https://medium.com/@juca_cruz/are-github-copilot-and-gpt-4-the-cure-for-all-our-software-engineering-bottlenecks-96e62b2a1da1?source=rss-7db46c11e7aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/96e62b2a1da1</guid>
            <category><![CDATA[gpt-4]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[becks-advice]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[github-copilot]]></category>
            <dc:creator><![CDATA[Juan C. Cruz]]></dc:creator>
            <pubDate>Wed, 22 Mar 2023 13:27:48 GMT</pubDate>
            <atom:updated>2024-06-25T13:30:43.814Z</atom:updated>
            <content:encoded><![CDATA[<p><em>As a leader I decided to take for a spin such technologies before fully embracing them or even asking my teams to play with them. And the lines below summarize my personal journey and my 2 cents on the matter</em>:</p><p>On average, developers produce or change 30 lines of code a day. Most of that time is spent on reading and trying to understand code so they can change it.</p><p>It’s almost a 10:1 ratio of reading versus writing code.</p><blockquote>If I knew a DB table was going to be read 10x more often than writing to it, I wouldn’t have optimized it for write speed.</blockquote><p>That’s why Kent Beck’s Simple Design prioritizes:</p><ol><li>Passes the tests</li><li>Reveals intention (should be easy to understand)</li><li>No duplication (DRY)</li><li>Fewest elements (remove anything that doesn’t serve the three previous rules)</li></ol><p>There are wording variations on those rules, but I got those specific words from <a href="https://martinfowler.com/bliki/BeckDesignRules.html">this Martin Fowler post</a>. As he notes, “The rules are in priority order, so <em>passes the tests</em> takes priority over <em>reveals intention</em>”.</p><p>Developers who are disciplined will spend at least half their time refactoring the code to satisfy 2–4 as best as they can. We spend a lot of the remaining “coding” time writing tests.</p><blockquote>I have experimented doing Test-Driven and Test-After development with GitHub Copilot and GPT-4, and they just got in the way.</blockquote><p>On Mentoring developers vs Coding, I realised that it’s better to turn Copilot off. <strong>It was just noise!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FEKYBdu_v7mbkzJ4H9oWng.jpeg" /></figure><p><em>Originally published on </em><a href="https://juca-cruz-utilities.blogspot.com/2023/03/are-github-copilot-and-gpt-4-cure-for.html"><em>juca-cruz-utilities.blogspot.com</em></a><em> on March 2023</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96e62b2a1da1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JS Frameworks with Salesforce]]></title>
            <link>https://medium.com/@juca_cruz/js-frameworks-with-salesforce-2ada2ec750b4?source=rss-7db46c11e7aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ada2ec750b4</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Juan C. Cruz]]></dc:creator>
            <pubDate>Fri, 29 Jun 2018 17:44:10 GMT</pubDate>
            <atom:updated>2018-06-29T17:44:37.242Z</atom:updated>
            <content:encoded><![CDATA[<p>As I mentioned on previous entries, Salesforce has its good and bad things, but coming from a Java School, I still firmly believe that is not very Developer Friendly. One of the things I wanted to try was to implement a Rich UI using JavaScript frameworks and either simple backend or APIs. However, Salesforce makes it kind of complicated. The main challenge is around managing static resources, since all your code will be mostly in a bunch of JS files which have to be packaged and deployed in a Zip file as static resource. But if you are patient enough you could implement something cool with a Visualforce page that might look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*47CV5puTTGXwxkC3.png" /></figure><p>On this particular approach we mixed Apex Remote Objects (Remote Object Model) with React. But that doesn’t mean that you can’t be creative and go for something more complex like using <em>@RemoteAction </em>in your controller methods.</p><p>Yeah, we could have tried something more <em>Salesforcy </em>like Lightning, but that’s not what the cool kids use nowadays :D</p><p><em>Originally published at </em><a href="https://juca-cruz-utilities.blogspot.com/2017/10/js-frameworks-with-salesforce.html"><em>juca-cruz-utilities.blogspot.com</em></a><em> on June 29, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ada2ec750b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSO with Brightcove Gallery]]></title>
            <link>https://medium.com/@juca_cruz/sso-with-brightcove-gallery-7a7cceaf8726?source=rss-7db46c11e7aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a7cceaf8726</guid>
            <category><![CDATA[gallery]]></category>
            <category><![CDATA[sso]]></category>
            <category><![CDATA[brightcove]]></category>
            <dc:creator><![CDATA[Juan C. Cruz]]></dc:creator>
            <pubDate>Fri, 29 Jun 2018 17:38:45 GMT</pubDate>
            <atom:updated>2018-06-29T17:40:45.564Z</atom:updated>
            <content:encoded><![CDATA[<p>If you haven’t heard about Brightcove Gallery, in a few words is just platform that allows you to stream video efficiently and with great quality.</p><p>One of the challenges we faced was to integrate this platform with ours. Despite the fact that they have <a href="https://support.brightcove.com/en/gallery/docs/configuring-access-control-profiles-0">decent documentation</a>, as usual, the fine details are not present. If it was that easy anyone would do it :)</p><p>In order to keep things simple we just have to pay attention to these details:</p><ul><li>After you have created your SSO configuration on Access Control and on your SSO server you have setup your IdP.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*hg7unbh1smrXoqNU.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*kYNKGxNPYExV6KPu.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*Ak-BM6eh0HkFsC6h.png" /></figure><ul><li>Go to your site settings in your project/experience and link your site to your newly created Access Control</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*cep9EzWAJ4A61lq7.png" /></figure><p>According to the documentation this should be all (yay!)</p><p>However when testing you will get a 404 from Gallery (o_O)</p><p>Why me???? :O</p><p>This is the trick:</p><p>Double check your SSO settings on your IdP settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*h77Pd7cIf9wDkxqO.png" /></figure><p>Our endpoint matches what Gallery has in ACS URL Override. But we have a site which has its own URL</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*A4kpbVD8pSWqkvHT.png" /></figure><p>Bingo! Let’s use that URL in our Assertion Consumer Service URL, keep the <strong>/login/callback</strong></p><p>And success!!!</p><p><em>Originally published at </em><a href="https://juca-cruz-utilities.blogspot.com/2018/04/sso-with-brightcove-gallery.html"><em>juca-cruz-utilities.blogspot.com</em></a><em> on June 29, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a7cceaf8726" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pass Collection of Objects with Attributes to a Stored Procedure using iBatis]]></title>
            <link>https://medium.com/@juca_cruz/pass-collection-of-objects-with-attributes-to-a-stored-procedure-using-ibatis-8826d961bed5?source=rss-7db46c11e7aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/8826d961bed5</guid>
            <category><![CDATA[spring]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[ibatis]]></category>
            <dc:creator><![CDATA[Juan C. Cruz]]></dc:creator>
            <pubDate>Fri, 29 Jun 2018 16:43:00 GMT</pubDate>
            <atom:updated>2018-06-29T18:02:41.296Z</atom:updated>
            <content:encoded><![CDATA[<p>In my <a href="http://juca-cruz-utilities.blogspot.com/2010/09/pass-collection-to-stored-procedure.html">last entry</a> I had a requirement which needed to pass a List to an Oracle Stored Procedure, well, that thing is history. But now the problem becomes more complex, because, what happens if I’m expecting in my Stored Proc and Type (STRUCT)</p><p>This is my Collection in Oracle!</p><p><a href="https://juca-cruz-utilities.blogspot.com/2010/09/pass-collection-of-objects-with.html">Continue reading.</a></p><p><em>Originally published at </em><a href="https://juca-cruz-utilities.blogspot.com/2010/09/pass-collection-of-objects-with.html"><em>juca-cruz-utilities.blogspot.com</em></a><em> on June 29, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8826d961bed5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transaction Basics]]></title>
            <link>https://medium.com/@juca_cruz/transaction-basics-797ff3bfcc81?source=rss-7db46c11e7aa------2</link>
            <guid isPermaLink="false">https://medium.com/p/797ff3bfcc81</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[transactions]]></category>
            <dc:creator><![CDATA[Juan C. Cruz]]></dc:creator>
            <pubDate>Fri, 29 Jun 2018 16:19:00 GMT</pubDate>
            <atom:updated>2018-06-29T17:55:52.725Z</atom:updated>
            <content:encoded><![CDATA[<p>The core idea behind a transaction is that it’s a complex operation completed as an all-or-nothing set of simpler operations. If one of the simpler operations fails, then none of the operations should be applied. The classic example is making a purchase, and indeed this is probably where the name “transaction” comes from. There are several steps:</p><ol><li>Pull funds from buyer’s account</li><li>Add funds to seller’s account</li><li>Decrease product inventory</li></ol><p>A failure could happen at any of those steps. For example, at step 1, if the buyer doesn’t have enough money, then the transaction should fail. (We wouldn’t add funds to the seller’s account and we wouldn’t decrease product inventory.) At step 2, if the seller’s account has been frozen due to suspected involvement in illegal activities, then the transaction should fail. At step 3, if the product is out of stock, then again the transaction should fail.<br> ACID is an acronym that stands for atomic, consistent, isolated and durable. An operation is a transaction if and only if it has these four characteristics:</p><ul><li><strong>Atomic:</strong> This is the aforementioned all-or-nothing property. Even though a transaction comprises multiple operations, it is completed as a single logical unit of work. Either the whole thing succeeds or none of it does.</li><li><strong>Consistent:</strong> We want our “transactional resource” (which in most cases means our database) to be consistent with reality. So for example if I have 4,132 widgets in stock after I sell you five of them, then I want the database to say that I have 4,132 widgets in stock after I run a sell(you, 5, widget) transaction. The consistency property means that after a transaction completes, the database (or whatever transactional resource we&#39;re using) matches up with the real world.</li><li><strong>Isolated:</strong> In general we want to be able to run lots of transactions against the database at the same time, and we don’t want to make a big mess out of things in the process. The isolation property means that when you run a transaction, it achieves its results without interference from other transactions. That doesn’t mean that the transactions can’t run concurrently — it just means that the transactions shouldn’t corrupt each other in the process. In practice it’s nontrivial to strike the right balance between concurrency and isolation; transactions however exhibit some level of isolation, and well-designed transactions exhibit the “right” amount of isolation.</li><li><strong>Durable:</strong> This just means that after a transaction has ended, its results are made persistent. Probably they would have called this property “persistent” instead of “durable”, but “ACIP” is not as cool as “ACID”.</li></ul><p>Now that we know what transactions are, we need to understand how individual transactions are actually specified. Defining a transaction involves picking a chunk of code (maybe a method, maybe a set of methods, maybe a block of code inside a method) and setting values for the following five parameters:</p><ul><li><strong>Propagation behavior:</strong> When defining a transaction we must specify its “boundaries”: where does the transaction start and where does it end? In Spring (and also in EJB), the boundaries of a transaction may or may not coincide with the boundaries of a Java method. In one respect this is not unlike using the synchronized keyword: if one synchronized method calls another on the same class, then the protected scope includes both methods, not just one, and so the boundaries do not coincide with a single method. But the difference is that with transactions you have a lot more flexibility as far as defining the boundaries. Certainly it is possible to enter a transaction starting from one method and then include additional method calls within the scope of that initial transaction. But you can do other things too, such as declare that calls to other methods open up new transactions, or that a given method must always run within the scope of an existing transaction, etc. I won&#39;t go over all the options here but there are seven and you can see them here: <a href="http://static.springframework.org/spring/docs/2.5.0/api/org/springframework/transaction/TransactionDefinition.html">transaction propagation options</a>. Probably PROPAGATION_REQUIRED is the most typical.</li><li><strong>Isolation level:</strong> I mentioned above that in practice concurrency trades against isolation. (Once again there’s an analogy with threads, incidentally.) You can specify the level of isolation you need for a given transaction; the general rule of thumb is assign the weakest isolation level you can safely get away with so as to maximize concurrency. Again I won’t go into the details but you can find them here: <a href="http://static.springframework.org/spring/docs/2.5.0/api/org/springframework/transaction/TransactionDefinition.html">transaction isolation levels</a>. The most typical cases are ISOLATION_READ_COMMITTED and ISOLATION_REPEATABLE_READ. The ISOLATION_READ_UNCOMMITTED is so weak as to be almost useless in practice, and ISOLATION_SERIALIZABLE is so strong that you don&#39;t want to use it unless you really, really need the safety it provides: it&#39;s a concurrency-killer.</li><li><strong>Timeout:</strong> Transaction timeouts allow the calling application to give up if the database hasn’t completed the transaction within a specifiable interval of time.</li><li><strong>Read-only:</strong> This flag indicates whether the transaction will be, well, read-only. If so, you can flag it as such and the underlying database or other resource can apply optimizations based on that fact.</li><li><strong>Rollback behavior:</strong> By default, both Spring and EJB roll back a transaction (i.e., cancel it without applying any of the changes) when runtime exceptions, but not when checked exceptions occur. You can modify that behavior.</li></ul><p><em>Originally published at </em><a href="https://juca-cruz-utilities.blogspot.com/2010/03/transaction-basics.html"><em>juca-cruz-utilities.blogspot.com</em></a><em> on June 29, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=797ff3bfcc81" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>