/ Development  

The ultimate workspace wizardry; How to supercharge your WS with source control after creation

Hi there AppWorks fans,

Welcome to a new installment of AppWorks tips.

Maybe you recognize the situation…You’re moving into a new project, you create a brand-new workspace name with well-over-thought project-name, you start building fancy stuff for a day, and before you go home from the office you want to do a commit into source control for your fellow developers; This is the moment you feel sorry when you conclude forgetting to attach your workspace to a source control system like SVN or GIT (with later versions of the platform). Let me tell you…You’re far from going home my friend! This is where your misery starts, but not when you follow this post; At least if you have access to all the required resources to make it happen because your team-administration-mates saw this already and went home early today which was the smarter choice! 😁

Right…Let’s explain the high-over steps for this post…We’ll just go through them step by step:

  1. Create workspace and project without SVN/GIT (incl. an entity and a dummy BPM…because we can!)…You already have this; otherwise, you would not be reading this!
  2. Sync the WS and save its contents from the server on a separate backup location (that will be the root folder; the workspace folder!).
  3. Delete the WS (incl. the data on the server); So, we can create a new WS with the same name!
  4. Create that new workspace (with same name) and use a dummy-project…AND make an SVN/GIT connection.
  5. Sync the WS.
  6. Now copy your backup project (a sub-folder in the workspace folder) next to the dummy-project.
  7. Do a sync again.
  8. Delete the dummy-project.
  9. Do a commit!

After a drink I was just ReThinking! I think we can also do it via these steps (I leave these steps for you to try out…I stick with the initial plan for this post):

  1. Create that WS without SVN.
  2. Sync it to the server and copy it (as backup).
  3. Delete the WS…So far so good for the same steps.
  4. Go to your SVN/GIT and create a new repository.
  5. Check out this repo to your local machine (via Tortoise for example).
  6. Copy the backup workspace folder into it.
  7. Do a commit (from local machine).
  8. Now create a new workspace connected to your new source control location (which reconstructs everything back into AppWorks!).

So far all the thinking…Time for some practical action!


Let get right into it…

Spin up your VM, with your favorite AppWorks URL, and dive into your non-source-control-attached workspace with your developer account. I’m in a sandbox never attached to anything and this is my project to start with; I already created a simple entity and a simple one-activity dummy BPM (let’s say this was one day of hard work 😅):

git_001

The ‘Workspace Documents’ artifact is not showing these source control buttons (yet!):

git_002

With this project in place, it’s time to do a synchronization (from the context menu on the project); Some magic is happening in the background and when ready you need to have a look on the AppWorks server itself. For my Unix machine, this will be the location:
/opt/opentext/AppWorksPlatform/defaultInst/cws/sync/{organization_name}/{workspace_name}/{project_name}

Now you make a copy to a backup location of the {workspace_name} folder; This can be your local machine or just a location on the server itself: sudo cp -r /opt/opentext/AppWorksPlatform/defaultInst/cws/sync/appworks_tips ~

Back in AppWorks design-time, we go to the ‘Manage Workspaces’ section:

git_003

Here we can delete our non-source-control-attached workspace…

From my perspective I didn’t need to clean data on the server itself…It was already removed with the deletion of the workspace. Have a double-check as I’ve seen different in other projects!
Ohhh…And if you already have a deployment done in runtime for this project I would also remove the solution from /app/admin…Just to make sure, but I didn’t do a publication for this example. Do I hear anybody saying that this will remove also all the configuration kind of entity instances!? Correct! But as good low-code developer you automated the creation of these instances via a nice BPM…right? Otherwise, read this post.

So, all is gone…Time to create a new workspace; And this time you DO NOT forget to attach it to (in my case) GIT:

git_004

Read more about this GIT config here

If you see a Large File Storage (LFS) error passing by like this…
git_005
…just follow this manual for your repository; You’ll end up with a call like git lfs track "*.*"; This introduces a file .gitattributes for your repository with this content part *.* filter=lfs diff=lfs merge=lfs -text. This file must be available on the Git-repository to make it work properly! Ohwww…No need to do this LFS-track on the AppWorks server; Just on your local system is sufficient; As long is the file exists in the remote repository…That’s all!

This is the next step in the wizard:

git_006

After this step, you can add a new project name…I use dummy as we’ll remove it later…Finally, you can create it all with this as an end result:

git_007

For you to know; If you already did a local checkout, made the backup copy available, and did a commit to the remote repository, your project would have been found directly and picked up from the creation wizard! It’s just a tip…From the great ReThinking in the introduction of this post. 😊

Now what? Well, do a sync on the project… And copy the backup back to the original location: sudo cp -r ~/appworks_tips/ws_aw_tips_general/prj_general/ /opt/opentext/AppWorksPlatform/defaultInst/cws/sync/appworks_tips/ws_aw_tips_general/

Continue with a full re-sync with this as a result:

git_008

I also required some access on the files (probably from my copy ‘sudo’ commands!):

  • sudo chown tomcat:tomcat -R /opt/opentext/AppWorksPlatform/defaultInst/cws/
  • sudo chmod 777 -R /opt/opentext/AppWorksPlatform/defaultInst/cws/

You can now delete the ‘dummy’ project and commit the “real” project! How nice with this view in GitHub! 😎

git_009


Niceee…I love when a plan comes together 🤗 That’s a great “DONE” where we learned the tricks of project synchronization and attaching a project to a source control system (in our example GIT). Pick the fruits of this knowledge and share it with others…You all read this stuff only on AppWorks Tips!

Don’t forget to subscribe to get updates on the activities happening on this site. Have you noticed the quiz where you find out if you are also “The AppWorks guy”?