Skip to main content
Question

Automate/Schedule Push from FME Cloud/Server to Remote Git Repository

  • November 27, 2019
  • 5 replies
  • 118 views

ld
Participant
Forum|alt.badge.img+1
  • Participant
We have successfully linked the FME Server git repository to our remote repository in Azure. This is great, since our commit history will now persist between backup/restores when upgrading.

 

However it seems the only way to trigger a push to the remote repository is to manually navigate to the 'Push to Remote' button in 'System Configuration'.

 

I can't see anything in Automations or in the FME Server API documentation which would allow us to automate this process. Has anyone found an inventive way to schedule the 'Push to Remote' process? It doesn't necessarily need to trigger with every commit, more like once per day.

 

Using FME Server 2019.1 hosted in FME Cloud.

5 replies

nampreetatsafe
Safer
Forum|alt.badge.img+12

Hi @Id, I'm not a FME Server expert, but a fellow Safer mentioned that version control is not exposed as an endpoint in the FME Server REST API.

That said, you can try constructing a POST with HTTPCaller to /fmerest/v3/versioncontrol/remote/push – they will need an fmetoken Authorization Header (e.g. fmetoken token=*************************************** ). However, he hasn't tested this himself.

Feel free to up vote and comment on this existing post in our Ideas Forum, https://knowledge.safe.com/idea/75121/expose-versioning-through-the-fme-server-rest-api.html


runneals
Contributor
Forum|alt.badge.img+19
  • Contributor
  • December 4, 2019

Here's an FME workspace that I made that pushes the latest changes to the local repo, and then pushes it to the remote repo. We have this scheduled to run every night, so even though someone may have modified a workspace and reuploaded it without clicking the button to commit, they get commited anyway and are noted as an automated commit.

MAJOR DISCLAIMER: Since SAFE doesn't officially support the api yet, it isn't technically supported and may break in future versions of FME Server.

 

https://github.com/runneals/GISProjects/blob/master/fme/FME%20Server%20Tools/FME%20Server%20Bulk%20Commit%20for%20Version%20Control.fmw

ld
Participant
Forum|alt.badge.img+1
  • Author
  • Participant
  • December 16, 2019
runneals wrote:

Here's an FME workspace that I made that pushes the latest changes to the local repo, and then pushes it to the remote repo. We have this scheduled to run every night, so even though someone may have modified a workspace and reuploaded it without clicking the button to commit, they get commited anyway and are noted as an automated commit.

MAJOR DISCLAIMER: Since SAFE doesn't officially support the api yet, it isn't technically supported and may break in future versions of FME Server.

 

https://github.com/runneals/GISProjects/blob/master/fme/FME%20Server%20Tools/FME%20Server%20Bulk%20Commit%20for%20Version%20Control.fmw

Thanks, this looks promising. Will this include commit comments/version descriptions in the push to the remote repository?


ld
Participant
Forum|alt.badge.img+1
  • Author
  • Participant
  • December 16, 2019
nampreetatsafe wrote:

Hi @Id, I'm not a FME Server expert, but a fellow Safer mentioned that version control is not exposed as an endpoint in the FME Server REST API.

That said, you can try constructing a POST with HTTPCaller to /fmerest/v3/versioncontrol/remote/push – they will need an fmetoken Authorization Header (e.g. fmetoken token=*************************************** ). However, he hasn't tested this himself.

Feel free to up vote and comment on this existing post in our Ideas Forum, https://knowledge.safe.com/idea/75121/expose-versioning-through-the-fme-server-rest-api.html

Thanks, this is the call being used in runneals workspace above. I have tested and this is working as needed. Thanks both.


ld
Participant
Forum|alt.badge.img+1
  • Author
  • Participant
  • December 16, 2019
ld wrote:

Thanks, this is the call being used in runneals workspace above. I have tested and this is working as needed. Thanks both.

For anyone stumbling across this in future, the headers needed are:

 

Content-Type = application/x-www-form-urlencoded

Accept = application/json

Authorization = fmetoken token=YourTokenHere


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings