< All Topics
Print
Bitbucket Pipline example – Java mvn

image: maven:3.6.3
pipelines:
  pull-requests:
    'feature/*':
      - step:
          name: Build Feature branch
          script:
            - mvn -DskipTests=true clean install
            - echo "done!"

      - step:
          name: Test Feature branch
          script:
            - mvn test
            - echo "done!"

    'bugfix/*':
      - step:
          name: Build Bugfix branch
          script:
            - mvn -DskipTests=true clean install

      - step:
          name: Test Bugfix branch
          script:
            - mvn test

    'hotfix/*':
      - step:
          name: Build Hotfix branch
          script:
            - mvn -DskipTests=true clean install

      - step:
          name: Test Hotfix branch
          script:
            - mvn test

  branches:
    master:
      - step:
          name: Build Gateway
          script:
            - mvn -DskipTests=true clean install
            - echo "build done"
            
      - step:
          name: Run Gateway Test
          script:
            - mvn test
            
      - step:
          name: Build and push docker 
          script:
            - docker login -u $DOCKER_LOGIN -p $DOCKER_PASS
            - docker build -t quantox/dev:gateway .
            - docker push urdocker/repo:name_project
          services:
            - docker
            
      - step:
          name: Deploy to test
          deployment: test
          script:
            - cat ./deploy.sh | ssh [email protected]_ip_or_hostname
            - echo "Deploy step finished"