Springboot books s3publisher

2 springboot projects

testDevOpsWeb

Front-end publises Web and consumes Rest

test DevOps Web project on github

testDevOps

Back-end deployed on Heroku and publishes Rest data

test DevOps Back project on github

Spring Boot app build with Jenkins via Github and deployed to AWS with s3publisher

  1. create Spring Boots projects

  2. commit && push to GitHub

  3. create .jar executable from Github with Jenkins

  4. Upload .jar to AWS S3 with s3publisher

  5. connect AWS S3 to AWS AEB

  6. AWS AEB deploy and publish

Build .jar with Jenkins

First at all, we create a. jar executable with Jenkins: link and after that we will upload this .jar package executable to S3 manually.

We should do in the near future the automation of this process (by jenkinsfile, for instance).

Using AWS S3 as a Repository

First at all, we create a bucket on AWS S3 and upload the spring boot snapshot.

So far, Object Ownership is disabled, to make our snapshot public we MUST enable it (but no now).

Once spring boot snapshot is uploaded we need it to be public, so let's operate upon its (1) ACL, (2) policy and (3) endpoint: link

Now, the endpoint is open to all:

  • bucket: springbootbookswebbuild

  • region: eu-central-1

  • amz domain: amazonaws.com

  • object: springbootClient-0.0.1-SNAPSHOT.jar

https://springbootbookswebbuild.s3.eu-central-1.amazonaws.com/springbootClient-0.0.1-SNAPSHOT.jar

Installing AWS S3publisher to upload the build

Now, we are going to finish the pipeline with an AWS S3 plugin for jenkins. This plugin will make easy the credentials and bucket configuration.

Configuring AWS S3publisher to upload the build

First, configure AWS in jenkins (bucket). Amazon S3 Bucket Access settings like S3 Bucket Name and credentials ...

Second, Post-build Actions

Publish artifacts to S3 Bucket, Upload artifacts to Amazon S3. You need to define an S3 profile on the Jenkins global config page.

Using AWS EBS to host, run and publish

We are using AWS EAB to host, create an enviroment, run and publish.

We choose JAVA as platform to create the enviroment.

We may upload our package or connect a S3 bucket.

AWS AEB builds the enviroment and try to publish, but there are some severe problems ..

AEB is publishing on: http://springbootwebbooks-env.eba-rgmk4emu.eu-central-1.elasticbeanstalk.com/ but there is some data missing ...

Elastic Beanstalk > Environments > Springbootwebbooks-env > Configuration > Environment properties >

Add new variable : SERVER_PORT : 5000

Using new pipeline jenkins plugin BlueOcean

Blue Ocean is a project that rethinks the user experience of Jenkins, modelling and presenting the process of software delivery by surfacing information that’s important to development teams with as few clicks as possible, while still staying true to the extensibility that is core to Jenkins.