Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7070507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:34:29+00:00 2026-05-28T05:34:29+00:00

I have the following problem. I need to organize automatic upload to deploy server

  • 0

I have the following problem. I need to organize automatic upload to deploy server from svn repository, but with some feautures.
There is how I wrote it:

# $1 - project; $2 - version (optional)
#   rm -rf $projectDir
if [ "$2" == '' ]; then
    svn export $trunk $projectDir --force >> $log
    version=`svn info $trunk | grep Revision | awk '{print$2}'`
    svn copy $trunk $tags/$version -m "created while uploading last version of $1"
    echo "New stable version #$version of $1 is created
    Uploading to last version is completed successfully"
else
    version=$2
    svn export $tags/$version/ $projectDir --force >> $log
    echo "Revert to version #$version is completed successfully"
fi

echo $version > $projectDir/version

chown -R $1:$1 $projectDir

But svn export doesn’t delete deleted via svn files, so I need to clean directory before export every time. It’s not good.
Before this, I work with checkout for deploy like this:

svn co $trunk >> $log
cp -ruf trunk/* $projectDir
svn info $trunk | grep Revision > $projectDir/version
chown -R $project:$project $projectDir
echo "uploading finished"

This work very well and very very faster (it changes only changed files) than the export, but:

  1. without automatic tag creating;
  2. without opportunity for nice reverting.

In my last script co doesn’t work, because it trying to checkout in one directory from different repository directories (trunk/some tag), which isn’t real.

So, question:

  1. Can I relocate project before checkout?
  2. Can I find the diff with co version and existing version before export?
  3. What can I do with diff result? (remove unneeded files after export?)

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:34:30+00:00Added an answer on May 28, 2026 at 5:34 am

    For the basis for the solution was taken following code:

    It’s simpler and fully solves the problem as for me.

    if [ "$2" == '' ]; then
        version=`svn info ${trunk} | grep Revision | awk '{print$2}'`
        if [ `cat ${projectWWW}/version` == "${version}" ]; then
            resultMessage="Project is up to date"
        else
            svn co ${trunk} ${projectRoot}/co >> ${log}
            cp -ruf ${projectRoot}/co/ ${projectRoot}/releases/${version}
            chown -R $1:$1 ${projectRoot}/releases/${version}
            resultMessage="New stable version #$version of $1 is created
            Uploading to last version is completed successfully"
       fi
    else
        version=$2
        resultMessage="Revert to version #$version is completed successfully"
    fi
    
    ln -s ${projectRoot}/releases/${version} ${projectWWW}
    echo ${version} > ${projectWWW}/version
    echo ${resultMessage} >> ${log}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem: I need to get a ConfigurationSection - object from
I have the following problem: I have a form I need to serialize but
i have the following problem: i need to send some custom info with every
I have the following problem: We need to find the next august. I other
I have the following problem: I need to use XSLFO to generate a 2-column
Hy guys! I have the following problem: I need to hash an unsigned byte
I have the following problem and I need to know if there´s a way
We have following problem. Developers frequently need to make small changes to our web
I have the following problem: I need to insert N rows after row X.
I have the following problem: i need to convert a decimal number to string.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.