title: How to correctly define stages & commands in buildspec.yml?
body: <p>Currently, I'm looking forward to migrating my own-side project into AWS and I have already uploaded it into CodeCommit. The next step is to utilize CodePipeline &amp; CodeBuild for build and testing purposes.</p>
  
  <p>I have a simple microservices written in Java with this <code>build.gradle</code></p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
          gradlePluginPortal()
      }
      dependencies {
          classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.1.1.RELEASE'
          classpath 'com.bmuschko:gradle-docker-plugin:4.2.0'
      }
  }
  
  apply plugin: 'idea'
  apply plugin: 'java'
  apply plugin: 'org.springframework.boot'
  apply plugin: 'io.spring.dependency-management'
  apply plugin: 'com.bmuschko.docker-spring-boot-application'
  
  compileJava {
      sourceCompatibility = 11
      targetCompatibility = 11
  }
  
  group 'com.polubentcev.messenger'
  version '1.0'
  
  docker {
      springBootApplication {
          baseImage = 'openjdk:11-jre-slim'
      }
  }
  
  repositories {
      mavenLocal()
      mavenCentral()
      jcenter()
  }
  
  def messengerVersion = '1.0'
  def springBootVersion = '2.1.2.RELEASE'
  
  dependencies {
      compile 'com.polubentcev.messenger:messenger-util-model:'+messengerVersion
      compile 'org.springframework.boot:spring-boot-starter-web:'+springBootVersion
      compile 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:2.1.0.RELEASE'
      compile 'org.springframework.cloud:spring-cloud-starter-config:2.1.0.RELEASE'
      compile 'org.springframework.boot:spring-boot-starter-data-jpa:'+springBootVersion
      compile 'org.springframework.boot:spring-boot-starter-security:'+springBootVersion
      compile 'org.springframework.kafka:spring-kafka:2.2.3.RELEASE'
      compile 'org.springframework.cloud:spring-cloud-starter-oauth2:2.1.0.RELEASE'
      compile 'org.springframework.security.oauth:spring-security-oauth2:2.3.4.RELEASE'
      compile 'org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.1.2.RELEASE'
      compile 'org.postgresql:postgresql:42.2.5'
      compileOnly 'org.projectlombok:lombok:1.18.4'
      annotationProcessor 'org.projectlombok:lombok:1.18.4'
      testCompile 'org.springframework.boot:spring-boot-starter-test:'+springBootVersion
  }
  </code></pre>
  
  <p>I would like to have a <code>buildspec.yml</code> file for CodeDeploy in order to run unit tests and build docker image from it.</p>
  
  <p>Does anybody have any similar experience and can help me to create the file? </p>