Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Deploying java application on remote server

Hi,

I would like to set up continous deployment enviroment on bitbucket.

I have simple java web app which is running on my remote server (raspberry pi with tomcat container). Now I would like to automatize process of deploying it on the server each time I push new changes to the bitbucket repository.

In documentation I founded only deployment tutorial for app hosted on heroku. 

I would appreciate for some advices.

Lukasz

3 answers

Hello,

You can automate deployment with Bitbucket. You can use Bitbucket Cloud if your remote server is available from the internet. You can use Bitbucket pipelines and Bitbucket deployments. You can read more here:

https://confluence.atlassian.com/bitbucket/bitbucket-deployments-940695276.html

https://confluence.atlassian.com/bitbucket/bitbucket-deployments-940695276.html

Thank you for your answer.

Now my pipeline looks as below:

image: maven:3.3.9

pipelines:
  default:
    - step:
        caches:
          - maven
        script: 
          - mvn -B verify 
     - step:
        name: Deploy to production
        deployment: production
        script:
          - mvn tomcat7:deploy

But now I am reciving following error during deployment step:

Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project diagnostykadermatologiczna: Cannot invoke Tomcat manager: Connection reset

Its is probably because I need to specify tomcat server credentials in maven settings.xml file (I need to do that when I was deploying from my local computer). 

So my question is how can I override default maven settings.xml which is used in pipeline?

I found under following link that I can create settings.xml file in the root of my project and push it to bitbucket repo and then use:

- mvn -s settings.xml

pipeline.png

But it didnt work for me and failed with error:

No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, etc...

 

Thanks,

Lukasz

0 votes

I was able to run this using:

    - mvn tomcat7:redeploy

Instead of ‘deploy’

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

366 views 2 10
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you