Jump to content

"Continuous integration" of Field and Template changes


mindplay.dk

Recommended Posts

EDIT, seems like the answer to my question is yes: https://github.com/jeanrajotte/upgradewire

-----

Hi there,

Slight newbie question about continuous integration:

Sorry if this has been covered already - lengthy thread!

Isn't it the case that if I would use the API to add/edit my fields and templates, (Everything can be done from the API, I guess?) I could script and automate any data model migration?

Not using the GUI seems like a small price to pay for being able to do something similar to "migrate up" and have the server apply the latest data model changes?

I could, already today, have a control file that look like something like:

Current version: 2

version 1
migrate up:
  add field X
migrate down:
  remove field X

version 2:
migrate up:
  rename field X to Y
migrate down:
  rename field Y to X

The import / export json thing is super awesome, but it's not for automated migration, I guess?

Would this work? What do you think about it?

J

  • Like 1
Link to comment
Share on other sites

@joe_g this is basically what the module I've been working on does - except, it writes this file for you (as flat JSON files for source-control friendliness) creating a repeatable record of every change made to templates and fields.

I don't work with ProcessWire in my day job anymore, and probably won't get around to finishing this... I wonder if I should go ahead and release it as-is. Would anyone be interested in taking over this project?

  • Like 1
Link to comment
Share on other sites

Hey @mindplay.dk, 

I like to have a look at code, and if possible will try to contribute .

Thank you.


Like @joe_g mentioned, I was also having a similar thought of exporting the json via API and keeping on the module. And later exporting via the api than doing via the GUI .

May be we can somehow add it to Wireshell ?

  • Like 2
Link to comment
Share on other sites

I understand, but to avoid all edge cases and have a stable solution already today — I could do this hand scripted version? Then, since I would test each migration locally I would be sure that it's working as it should before doing any migration on another server..?

Link to comment
Share on other sites

  • 3 months later...

I don't work with ProcessWire in my day job anymore, and probably won't get around to finishing this... I wonder if I should go ahead and release it as-is. Would anyone be interested in taking over this project?

AWW MANNN, I just read 120+ posts to get here, thinking a solution was near, lol.

Amazing thread. I love all the ideas here. Like Joss, I am a poor coder and wish I could take over this project for you and our users :( 

Hopefully someone will come along and continue your work :D 

Thank you, for your contribution!!!

Link to comment
Share on other sites

AWW MANNN, I just read 120+ posts to get here, thinking a solution was near, lol.

Yeah, sorry about that. I just added an "EDIT" in bold to the original post, so others can decide whether they want to read through it all ;-)

  • Like 1
Link to comment
Share on other sites

  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...