title: Build docker image including version with bitbucket pipelines
body: <p>I'm pretty new to Bitbucket Pipelines and I encountered a problem. I'm creating a pipeline to deploy a new version of our Spring Boot application (which runs in a Kubernetes cluster) to our test environment. The problem I encountered is the versioning of our docker build. Our versioning is set up as the following:</p>
  
  <pre><code>alpha_0.1
  alpha_0.2
  beta_1.0
  gamma_1.0
  gamma_1.1
  </code></pre>
  
  <p>So every minor update/bugfix increases the build number by 0.1, and a major update increases the version by 1.0 + every major update gets a new version name.</p>
  
  <p>Currently I have the next setup:</p>
  
  <pre><code>image: java:8
  
  options:
    docker: true
  
  branches:
    master:
      - step:
          caches:
            - gradle
          script:
            - ./gradlew test
            - ./gradlew build
            - docker build -t &lt;application_name&gt;/&lt;version_name&gt;_&lt;version_number&gt;
  </code></pre>
  
  <p>What is the best way to include the <em>version_name</em> and the <em>version_number</em> in the bitbucket pipeline? Until now we runned ruby script which allowed user input for version numbering, but bitbucket pipelines are not interactive.</p>