views:

187

answers:

3

I have CruiseControl.NET setup on a server. I had everything working perfectly. Everything meaning, pull the code from SVN, build it, upon successful build, kick off a project setup with a project trigger to deploy the code to the DEV environment. I added some internal security settings, mainly just groups of users. I'm using LDAP security. When I added the security features in, my automated deployment to the DEV server quit working. I can force build the project to make it deploy, but when project #1 builds successfully, I get the error below when the trigger of the deploy project kicks off (I replaced the project name with PROJECT for security purposes):

2010-07-20 13:28:19,354 [PROJECT:DEBUG] Retrieving ProjectStatus from server: tcp://localhost:21234/CruiseManager.rem
2010-07-20 13:28:19,355 [PROJECT:ERROR] Exception: The project 'PROJECT' does not exist on the CCNet server.

ThoughtWorks.CruiseControl.Remote.NoSuchProjectException: The project 'PROJECT' does not exist on the CCNet server.
at ThoughtWorks.CruiseControl.Core.Triggers.ProjectTrigger.GetCurrentProjectStatus()
at ThoughtWorks.CruiseControl.Core.Triggers.ProjectTrigger.Fire()
at ThoughtWorks.CruiseControl.Core.Triggers.MultipleTrigger.Fire()
at ThoughtWorks.CruiseControl.Core.ProjectIntegrator.PollTriggers()
at ThoughtWorks.CruiseControl.Core.ProjectIntegrator.Integrate()
at ThoughtWorks.CruiseControl.Core.ProjectIntegrator.Run()

I have an active directory account setup for CruiseControl, and the service is running under that user account (which has admin rights). I have given the CruiseControl user full access to all the projects by adding the user to the my "admin" group in the internal settings section of the CruiseControl config.

Any ideas on how to make the project accessible to CruiseControl so it can see an execute the auto deployment?

A: 

Here is the auto deployment code, which monitors the web project, once successfully built, this should fire off. And, this does work without the internal security configuration:

<cb:scope ProjectName="$(projMhWebDevDeploy)">
<project name="$(projMhWebDevDeploy)" queue="Q1" queuePriority="1">
  <cb:define safeProjectName="MH_Web_Dev_Branch_Deployment"/>
  <cb:define projectDirectory="$(ccnetDirectory)\Projects\$(safeProjectName)"/>

  <triggers>
    <projectTrigger project="$(projMhWeb)">
      <triggerStatus>Success</triggerStatus>
      <innerTrigger type="intervalTrigger" seconds="5" buildCondition="IfModificationExists" />
    </projectTrigger>
    <projectTrigger project="$(projMhWeb)">
      <triggerStatus>Success</triggerStatus>
      <innerTrigger type="intervalTrigger" seconds="5" buildCondition="ForceBuild" />
    </projectTrigger>
  </triggers>

  <category>DEV Deployments</category>
  <webURL>$(urlCcnetDashBoard)</webURL>
  <workingDirectory>$(projectDirectory)</workingDirectory>
  <artifactDirectory>$(ccnetDirectory)\BuildFiles\$(safeProjectName)</artifactDirectory>

  <tasks>
    <!-- Deploy Code -->
    <exec>
      <executable>$(deployCodeBat)</executable>
      <buildArgs>
        $(ccnetDirectory)\Projects\MH_Web\Web
        $(deployMhWebDev)
        brh
      </buildArgs>
      <baseDirectory>$(ccnetDirectory)\BatchFiles\</baseDirectory>
    </exec>
    <!-- Deploy Helicon HTTPD -->
    <exec>
      <executable>$(deployHeliconBat)</executable>
      <buildArgs>
        $(ccnetDirectory)\Projects\MH_Web\Web
        "$(deployHeliconDev)"
        httpd.conf
      </buildArgs>
      <baseDirectory>$(ccnetDirectory)\BatchFiles\</baseDirectory>
    </exec>
  </tasks>
  <publishers>
    <xmllogger />
    <modificationHistory onlyLogWhenChangesFound="true" />
    <email mailport="25" includeDetails="true" useSSL="false" from="FROM" mailhost="SERVER">
      <users>
        EMAIL ADDRESSES ARE HERE
      </users>
      <groups>
        <group name="BuildMaster">
          <notifications>
            <notificationType>Always</notificationType>
          </notifications>
        </group>
      </groups>
    </email>
  </publishers>
  <security type="defaultProjectSecurity" defaultRight="Deny">
    <permissions>
      <rolePermission name="Developers" ref="Developers"/>
      <rolePermission name="Admin" ref="Admin"/>
    </permissions>
  </security>
</project>   
</cb:scope>
Lee
A: 

I think that you will need to define the security settings for your roles - I don't see any internal security markup there. It's all well and good that you have the AD perms and accounts, but you need to tell CCNet what those mean. Try adding the below inside of your project tags (after changing the domain and group names, of course):

<internalSecurity>        
    <permissions>
        <!-- Roles -->
        <rolePermission name="Admin" forceBuild="Allow" startProject="Allow" >
            <users>
                <userName name="DOMAIN\GROUP1\"/>
            </users>         
        </rolePermission>
        <rolePermission name="Developers" forceBuild="Deny" startProject="Deny">
            <users>
                <userName name="DOMAIN\GROUP2\"/>
            </users>
        </rolePermission>
    </permissions>
</internalSecurity>
Josh E
A: 

I already did that... Here's the code (I changed the user names for security purposes):

<internalSecurity>
<cache type="inMemoryCache" duration="30" mode="sliding" />
<audit>
  <xmlFileAudit location="C:\ccnet\SecurityLogs\CCNet_Audit.xml"/>
</audit>
<auditReader type="xmlFileAuditReader" location="C:\ccnet\SecurityLogs\CCNet_Audit.xml"/>
<users>
  <ldapUser name="user1" domain="$(securityDomain)"/>
  <ldapUser name="user2" domain="$(securityDomain)"/>
  <ldapUser name="user3" domain="$(securityDomain)"/>
  <ldapUser name="CruiseControl" domain="$(securityDomain)"/>
</users>
<permissions>
  <rolePermission name="Admin" defaultRight="Allow">
    <users>
      <userName name="user1"/>
      <userName name="user2"/>
      <userName name="CruiseControl"/>
    </users>
  </rolePermission>
  <rolePermission name="Developers" forceBuild="Allow" viewProject="Allow" defaultRight="Deny">
    <users>
      <userName name="user3"/>
    </users>
  </rolePermission>
</permissions>
</internalSecurity>
Lee