Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Forge app development. Part 3. Deployment Edited

Bitbucket Pipelines

Ok, our app is fully functional (well, i've already mentioned some drawbacks, but hope you'll deal with it) and now we want to deploy it to our environments automatically. Atlassian gives us a great tool for this - Bitbucket Pipelines in Bitbucket Cloud. I choose Git as a de-facto standard. 

First of all we need to add additional dependency on order Bitbucket would be able to build our app. In your app folder run:

npm i @forge/cli@latest --save-dev

 Second -  we need to init repository in our app folder and then add/commit changes. Forge already provides .gitignore file. 

git init
git add .
git commit -m "Initial commit"

Then, go your Bitbucket Cloud (if you have no account yet - create it). Create new Git repository without README and .gitignore. Then we need to push our local project to cloud.

git remote add origin https://chemelson@bitbucket.org/chemelson/notes.git // change repo address to yours
git push -u origin --all 

All right! Next create file bitbucket-pipelines.yml in your app folder. This configuration file describe how our app will be deployed.

8.png

Then, create new branch from master - let's call it development. Don't forget to commit&push to cloud. 

Enable Pipelines in Repository Settings → Pipelines → Settings. 

In order to run forge CMD while building we need to add two environment variables. Go to Repository Settings → Pipelines → Repository Variables and create two secured vars - EMAIL (enter your email your use for Forge) and TOKEN (use token acquired in your account before). 

Wow, great work. Let' check. If you run tunnel, stop it. Check out development branch. Go to file NewNoteForm.js and insert such change:

// <ModalDialog header='New Note' onClose={() => show(false)}><ModalDialog header='Create Note' onClose={() => show(false)}>

 

Commit and push!

7.png

Modal window header changed. 

For now, on every commit to any branch except development BitBucket Pipelines will pick up changes and deploy tnem to Forge development environment. On commit to master branch it will auto deploy app to stage environment. In order to deploy to production we must trigger it manually in Pipelines interface. 

Conclusion

Forge is a great step toward increasing developer productivity. It is in Beta now, but it is under heavy development. Watch Forge change logs, build apps and be happy! 

All code from this tutorial can be found here

0 comments

Comment

Log in or Sign up to comment
TAGS

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