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 7872027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:05:17+00:00 2026-06-03T02:05:17+00:00

I am trying to automate the deployment of code from a private github repo

  • 0

I am trying to automate the deployment of code from a private github repo using phing but having trouble trying to find something that works like an SVN export.

I have read a few post on git archive and git checkout-index but have struggled to get these working with github. I get the impression that they are keen for us to use the zip download as they can cache this etc.

I wouldn’t mind downloading the zip from github if there was a simple task in Phing to do this, a simple http task didn’t work as it’s over https and I guess some sort of authentication is needed first.

I managed to use gitclone task in Phing but the “.git” hidden folder is cloned too which is causing massive headaches…mainly because on subsequent builds I can’t delete the build folder as it suggests certain git files, namely *.idx or *.pack are in use.

Has anyone had any luck with phing and a private github repo?

Thanks

  • 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-06-03T02:05:19+00:00Added an answer on June 3, 2026 at 2:05 am

    @AYK My bad, have recently been exploring deployment options and think will roll with Capistrano…

    Anyway this was my build script I ended up using temporarily with people’s advice…

    • Let’s assume my app lives in “C:\app”
    • Let’s assume this build.xml file lives in “C:\app”
    • Let’s assume my app also contains a git repo “C:\app.git”
    • Delete any build & deploy directories “C:\app\build” and “C:\app\deploy” that may exist from a previous build
    • Make directories “C:\app\build” and “C:\app\deploy”, will hold the git checkout and final code to deploy
    • Excuting the git checkout as suggested checks out code from git and puts it into “C:\app\build”
    • There are certain directories like docs I don’t want to go out so I copy files I want to deploy to “C:\app\deploy”

    • The problem I had with Phing is the scp part, needed ssh2 dll in PHP which I didn’t have nor did I want to spend time trying to compile source for it.

    • So all in all I achieved what I originally wanted with Phing but after spending an evening with Capistrano I’m converted

    == build.xml ==

    <?xml version="1.0" encoding="UTF-8"?>
    
    <project description="" name="MyProject" default="build" basedir=".">
    
        <property file="build.properties" />
        <tstamp>
        <format property="build.time" pattern="%Y%m%d_%H%I" />
        </tstamp>
    
        <!-- ============================================  -->
        <!-- Target: prepare                                 -->
        <!-- ============================================  -->
        <target name="prepare">
        <echo msg="Deleting old build and deploy dirs" />
        <delete dir="./build/" includeemptydirs="true" failonerror="true" />
        <delete dir="./deploy/" includeemptydirs="true" failonerror="true" />
        </target>
    
        <!-- ============================================  -->
        <!-- Target: create                                -->
        <!-- ============================================  -->
        <target name="create" depends="prepare">
        <echo msg="Creating fresh build and deploy directories" />
        <mkdir dir="./build/" />
        <mkdir dir="./deploy/" />
        </target>
    
        <!-- ============================================  -->
        <!-- Target: gitclone                              -->
        <!-- ============================================  -->
        <target name="gitcheckout" depends="create">
        <echo msg="Checking out latest code" />
        <exec command="git checkout-index --prefix ./build/ -a"></exec>
        </target>
    
        <!-- ============================================  -->
        <!-- Target: preparedeploy                         -->
        <!-- ============================================  -->
        <target name="preparedeploy" depends="gitcheckout">
        <echo msg="Preparing deploy" />
        <copy todir="./deploy/" >
            <fileset dir=".">
            <include name="cgi-bin/**" />
            <include name="htdocs/**" />
            </fileset>
        </copy>
        <mkdir dir="./deploy/logs" />
        </target>
    
        <!-- ============================================  -->
        <!-- Target: cleanup                                 -->
        <!-- ============================================  -->
        <target name="cleanup" depends="preparedeploy">
        <echo msg="Deleting build dir" />
        <delete dir="./build/" includeemptydirs="true" failonerror="true" />
        </target>
    
        <!-- ============================================  -->
        <!-- Target: build                                 -->
        <!-- ============================================  -->
        <target name="build" depends="cleanup, preparedeploy, gitcheckout, create, prepare">
        <echo msg="Starting build ${build.time}" />
        </target>
    
    </project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to automate my deployment using phing. I get the below error
I am trying to automate some Weka classification using Java code. I'm getting the
I'm trying to automate the selection of items (using jQuery) from the autocomplete dropdown
I'm trying to automate the download of some data from a webform. I'm using
I am trying to automate a Jquery UI slider using watir-webdriver and ruby but
I am trying to automate our build/deployment process. So far I am using: a
My team is currently trying to automate the deployment of our .Net and PHP
We are trying to setup an automated deployment environemt with Git/Github. We have 3
I'm trying to automate a gdb session using the --command flag. I'm trying to
Assuming I'm trying to automate the installation of something on windows and I want

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.