Prepare website files using SVN (template/duplicate)



Learn how to setup a new project from a template on SVN

You can either duplicate a previous project to a new unique project which you will then modify.

OR

You can create a new unique project from our boilerplate template 

# 2 > Duplicate Project

If you want to duplicate a project. Open up terminal and run the following commands:

First create the new project folder

svn mkdir https://svn.undologic.com/updateCase.com/NewProjectName --message 'Duplicating a project'

Then you can copy the old project to the new name

svn cp https://svn.undologic.com/updateCase.com/OldProject/trunk https://svn.undologic.com/updateCase.com/NewProjectName/trunk --message 'Duplicating a project'

You can now checkout the project to your computer using:

svn co https://svn.undologic.com/updateCase.com/NewProjectName/trunk 

# 3 > Create from template

Using terminal run the following command to create a new project from a template

First check which projects exist in the current year folder
svn list https://svn.undologic.com/updateCase.com

Now create a new project folder as long as it wasn't created above
svn mkdir https://svn.undologic.com/updateCase.com/newProject --message 'new Project'

Now we are coping the template to our trunk folder
svn copy https://svn.undologic.com/updateCase.com/_template/trunk https://svn.undologic.com/updateCase.com/newProject/trunk --message 'creating new project from template'

This will setup the project and you can now checkout the project and start working and committing to the new location: 'https://svn.undologic.com/updateCase.com/newProject'


# 4 > Restoring from an achived location

Using terminal run the following command to restore a project from an archive

First check which projects exist in the current year folder
svn list https://SVNDOMAIN.net/svn/undologic/2016

Now create a new project folder as long as it wasn't created above
svn mkdir https://SVNDOMAIN.net/svn/undologic/2016/newProject --message 'new Project'

Now restore the project from an archived year use this format:
svn copy https://SVNDOMAIN.net/svn/undologic/2014/projectName/trunk https://SVNDOMAIN.net/svn/undologic/2016/newProject/trunk --message 'creating new project from archived year'

This will setup the project and you can now checkout the project and start working and committing to the new location: 'https://SVNDOMAIN.net/svn/undologic/2016/newProject'


# 5 > Archive current project to prepare for new project

If you are creating a new website and want to archive your current website (on SVN) located in the trunk direction (main directory)
-> Follow these instructions how to move your trunk TO a folder in the branches directory. 
-> After you can then create a NEW trunk folder with your new website files. 

Step 1: Ensure branches is created in your svn folder (if it is already created you can skip this step) 
$ svn mkdir https://svn.undologic.com/updateCase.com/settleSpam/branches --message 'Can be changed to anything for your logs'

Step 2: Move the TRUNK folder to BRANCHES, in our example we are changing TRUNK -> 2016-oldsite
$ svn mv https://svn.undologic.com/updateCase.com/settleSpam/trunk https://svn.undologic.com/updateCase.com/settleSpam/branches/2016-oldsite --message 'moving trunk to branches'
Your entire trunk folder is now in branches

Step 3: Trunk has been moved to branches, use the list command to see this
$ svn list https://svn.undologic.com/updateCase.com/settleSpam/
You will see only 'branches' (since we no longer have a trunk folder)
$ svn list https://svn.undologic.com/updateCase.com/settleSpam/branches
You will now see '2016-oldsite' this WAS the trunk folder but it has been renamed

Step 4: You can now follow the instructions how to create a new project


# 6 > Ignore TMP files with SVN

How to ignore TMP directory

In terminal navigate to the tmp folder we will start ignoring

cd app/tmp

Delete the current contents of your temp folder

svn rm * --force

Commit into the REPO the changes

svn ci -m 'cleaning/ignoring tmp'

OPTIONAL: If you get an error perform an update

svn up

Ignore EVERYTHIHG inside the tmp folder moving forward

svn propset svn:ignore '*' .

Now moving forward no folders or files inside of tmp will be included during the commit


# 7 > Ignoring .IDEA folders from SVN

How to ignore .IDEA directory

In terminal navigate to the trunk folder we will start ignoring (unless you are already at that point)

cd ../../../trunk

Delete the current contents of your temp folder

svn rm .idea --force

Commit into the REPO the changes

svn ci -m 'cleaning/ignoring .idea'

OPTIONAL: If you get an error perform an update

svn up

Ignore EVERYTHIHG inside the tmp folder moving forward

svn propset svn:ignore .idea .

Now moving forward no folders or files inside of tmp will be included during the commit


# 8 > UpdateCase -> Create new customer

We now need to create our new customer in UpdateCase
-> This will allow our customers to login
-> Click 'Menu'
-> Click Admin 
-> Top right 'Add'

Fill in the 
-> Name: what is the customers name
-> Check 'active' - allows to login
-> Reseller -> choose if the customer see's the undoLogic branding or the branding of another company 
-> Checkbox which apps the customer has access to 


# 9 > Create Website

A customer has now been created
-> Scroll to the bottom of the list and click 'Switch'
-> Click 'Websites'
-> Top right click 'Add a site'

Fill-in:
- name: Name of the website
- checkbox 'active' meaning it is allowed to be used
- Group: who this website belongs to
- Click 'submit'


# 10 > Create new updateCase project

We are now ready to duplicate our 'layout' into our new customer
-> Click Menu
-> Click Admin
-> Click Switch on the undoLogic customer
-> Click Websites 
-> Click 'variants' in the updateCase-layoutD site
-> Click 'duplicate' on the 'Current' variant'

Modify the 'name' and the new 'connectivity' links


# 11 > Import

We now have an empty variant
-> Click 'import_current' which will copy all the pages into our NEW variant (that will be used for our new project)


# 12 > Re-assign

We have now: Duplicated our variant, imported the content from our layoutD
-> It is now time to re-assign to our new customer

Click edit on our new variant
-> Click the dropdown 'Site' and find the new website you created for your new customer. 

After you 'save' you will now find this variant in your new customer
-> Switch
-> Click 'Menu'
-> Click 'Admin'
-> Click 'Switch' on your new customer


Other Instructions

Below are many other instructions that show you how to use your UpdateCase application