cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Ask the Expert: How can I use Git to achieve continuous integration with ThingWorx?

Highlighted
Alexandrite

Ask the Expert: How can I use Git to achieve continuous integration with ThingWorx?

Hi ThingWorx users,

 

Trying to manage your ThingWorx application artifacts in a CI process? Wondering who changed that line of code in your Thing Service? Trying to see what your Mashup looked like last release? Time to Git excited! PTC now offers a Git Backup Extension, available on the PTC Marketplace, to offer a stronger integration with the Git source repository. This Git feature can push or pull code and artifacts (like entities, data exports or extension dependencies) to your Git repository.

 

Here are some highlights of how this works within ThingWorx:

 

First, configure your Git repo to work with ThingWorx by creating a Git Backup Thing. Then, simply open your new Thing, navigate to the Configuration editor and enter information like your Git URL, your Git username and password, your repo and branch names, etc. See example below.

Ask Kaya - Git1 - Photo 01.pngConfiguring your Git repoWith this configuration in place, you can now use the Home Mashup of this new Git thing to browse the repository and pull down contents to your local ThingWorx instance. For new projects, you can also push new entities to the repo as you work on your application.

 

As you and your team are working, you’ll want to see the differences of the files you are editing and working on collaboratively. The Git extension feature makes this easy. Just like you can see diffs clearly delineated for a file with your Git client, you can see the same with this Git integration in ThingWorx. Similar to the git status command, the Git ThingWorx extension will show you the list of files you have changed that are available to push, as well as their diffs. See an example below.

Ask Kaya - Git1 - Photo 02.pngChecking the Git status

While working, if you want to switch branches or pull down a new project, you can check out a specific version and see all commits available on that branch (see below).

Ask Kaya - Git1 - Photo 03.pngChecking out a specific commit

Want to learn more or try it for yourself? Download the Git Backup Extension from the PTC Marketplace and check out the Git Backup Extension User Guide for guidance.

 

Stay connected,

Kaya

 

P.S. What do you think? Comment your thoughts below!

11 REPLIES 11

Re: Ask Kaya: How can I use Git to achieve continuous integration with ThingWorx?

Great article!

Re: Ask Kaya: How can I use Git to achieve continuous integration with ThingWorx?

Hi Kaya!

 

Do you know if an equivalent extension exists, providing configuration management integration with SVN (Apache Subversion)?

SVN is still often the default configuration management system on a lot of projects.

Thanks,

Sébastien

Re: Ask Kaya: How can I use Git to achieve continuous integration with ThingWorx?

Hi Sébastien,

 

Thanks for reaching out. Currently, we do not have plans for SVN for the Extension. Although, as you may already know, SVN can be used with ThingWorx through the "Export to Source Control" feature of our entities/application constructs.

 

Hey users, anyone else want SVN? Comment here!

 

-Kaya

Re: Ask Kaya: How can I use Git to achieve continuous integration with ThingWorx?

Thanks Kaya.

The export entities for Source Control does not provide an easy "thing by thing" handling (checkout/commit) like the Git extension.

Regards,

Sébastien

Re: Ask the Expert: How can I use Git to achieve continuous integration with ThingWorx?

Hi,

I have installed this extension and configured.

I am not able to see any repository on mashup page .

 

I am able to use all git commands from repository created into storage, but only tis it is not getting displayed in mashup. Find attached screen shot for reference.

 

Let me know if anyone has faced this issue.

 

Thanks in advance,

Vishwas

Re: Ask the Expert: How can I use Git to achieve continuous integration with ThingWorx?

Vishwas, can you share the values from the Configuration page from that Git thing that was created?

Also, can you share if the Thing has a ThingShape attached in the General Information page?

Re: Ask the Expert: How can I use Git to achieve continuous integration with ThingWorx?

GitbackupThing.PNGGitbackup ThingGitbackUpThingConfigurationPNG.PNGHi,

Please find attached screen shots for same.

 

Re: Ask the Expert: How can I use Git to achieve continuous integration with ThingWorx?

Can you first check if the bitbucket url link is in the format https://bitbucket.org/[user/team]/[repositoryname] ?
Second, are you using absolute or relative paths in your platform-settings.json file?
Third, have you tried doing a Pull and post the results of the Application Log?

Re: Ask the Expert: How can I use Git to achieve continuous integration with ThingWorx?

Hi:

Can you first check if the bitbucket url link is in the format https://bitbucket.org/[user/team]/[repositoryname] ?

<Vishwas> Yes Bitbucket URL is this format


Second, are you using absolute or relative paths in your platform-settings.json file?

<Vishwas> Its absolute path
Third, have you tried doing a Pull and post the results of the Application Log?

<Vishwas> I was getting error in application logs

[context: com.thingworx.webservices.context.HttpExecutionContext@2eb0da7b][message: File Repository Must Be Specified]

but after some time that error also gone.

Now not getting any error.

 

I can do all operations by going to that repository into file system but not able to see in mashup.

Thanks,

Vishwas