

At Sonatype, we specialize in helping organizations build better, faster software more securely without slowing down innovation. Teams who adopt best practices and invest in the right tools, at each phase of the software development life cycle (SDLC), enhance their overall productivity and ROI to meet business goals faster. Developers, IT operations, quality engineering, and security teams have embraced new technologies and cultural shifts to accelerate time to market and identify efficiencies in building applications. The role of modern software development has evolved. We will first start by creating the credentials followed by binding them to a variable.As leaders of organizations, innovators of technology, and practitioners of continuous development, we must understand the constant changes in the industry to better suit the needs of the business and of our customers. The second stage uploads the artifact to the S3 bucket. Replace the URL in the curl command with the URL of your Nexus repository. This will help us conceal the password as the shell commands are visible in the console output & we don’t want that. Since Nexus credentials are colon separated ( username:password), we have bound these credentials ( explained in the next steps below) to a variable called $NEXUS_CREDNETIALS. The first stage requires a credential to log in to Nexus. You have options to either create the credentials with the same IDs or replace the IDs with your values in this script. Configure this job & add below pipeline script.Create a new job in Jenkins of type Pipeline.You can use the free tier for this exercise. Create a free AWS account, if don’t already have one.It can be any file, but I chose a PNG image file. A file already uploaded to the above-mentioned Nexus repository - The pipeline will retrieve this file & upload it to the S3 bucket.I created a repository with the name: s3-repo. Nexus repository (raw type) - You can also use a different type of Nexus repository.AWS Access Key ID & Secret Access Key - It should have write permissions on the pre-existing S3 bucket.

AWS free tier ( if you aren’t an existing AWS customer).This post explains how we can quickly set up this pipeline. We were using AWS Lambdas & the web application was meant to be served from the S3 bucket. A few months ago, I was asked to set up a Jenkins pipeline that retrieves the artifact, a zip file containing the JavaScript web application code, from a Nexus repository and then upload that zip file to an AWS S3 bucket.
