Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-16226

CodeDeploy task ommits hidden files

    XMLWordPrintable

Details

    Description

      When using the CodeDeploy task in Bamboo 5.9.3, hidden files will not be archived/pushed to S3 when running a deployment.

      According to the documentation at http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-push-revision.html the --ignore-hidden-files flag is optional, but it appears to be always-on in Bamboo's CodeDeploy task.

      This causes issues when deploying (uncompressed) website sources that contain a .htaccess file for example.

      In my opinion hidden files should be included by default, or there would have to be a checkbox option to enable/disable hidden files when configuring the task.

      Proof:

      Source directory on the Bamboo agent that runs the CodeDeploy task:

      root@agent02:/home/bamboo/bamboo-agent-home/xml-data/build-dir/48758785-48889857/Web# ls -lsa
      total 40
      4 drwxr-xr-x 6 bamboo bamboo 4096 Aug 10 13:06 .
      4 drwxr-xr-x 4 bamboo bamboo 4096 Aug 10 13:06 ..
      8 -rw-r--r-- 1 bamboo bamboo 5050 Aug  7 14:06 .htaccess
      4 -rw-r--r-- 1 bamboo bamboo 1115 Apr 28 11:53 index.php
      4 drwxr-xr-x 4 bamboo bamboo 4096 Aug 10 13:00 Packages
      4 -rw-r--r-- 1 bamboo bamboo   25 Aug  7 14:06 robots.txt
      4 drwxr-xr-x 7 bamboo bamboo 4096 Aug 10 13:06 typo3
      4 drwxr-xr-x 3 bamboo bamboo 4096 Aug 10 13:06 typo3conf
      4 drwxr-xr-x 4 bamboo bamboo 4096 Aug 10 13:06 typo3_src
      

      Then, after deployment on an EC2 instance, in CodeDeploy's cache folder which is used as source where appspec.yml copies it's files from:

      [root@dii-usnv-web-t3ws-04 Web]# pwd
      /opt/codedeploy-agent/deployment-root/b1275288-2281-4ec4-97f4-174779de10bd/d-EBBJ5EJLA/deployment-archive/Web
      [root@dii-usnv-web-t3ws-04 Web]# ls -lsa
      totaal 20
      0 drwxr-xr-x. 6 root root   98 10 aug 11:08 .
      0 drwxr-xr-x. 4 root root   48 10 aug 11:08 ..
      4 -rw-r--r--. 1 root root 1115 10 aug 11:08 index.php
      0 drwxr-xr-x. 4 root root   39 10 aug 11:08 Packages
      4 -rw-r--r--. 1 root root   25 10 aug 11:08 robots.txt
      4 drwxr-xr-x. 7 root root 4096 10 aug 11:08 typo3
      4 drwxr-xr-x. 3 root root 4096 10 aug 11:08 typo3conf
      4 drwxr-xr-x. 4 root root 4096 10 aug 11:08 typo3_src
      [root@dii-usnv-web-t3ws-04 Web]#
      

      The .htaccess file was not deployed to the webserver, not copied to the siteroot, caused the ELB health check to fail and the instance not to come online in it's ELB group. Because the deployment is 'green' according to both CodeDeploy and Bamboo, it went ahead and deployed all other EC2 instances in the same fashion, causing every single webserver to go down in the ELB group. Not good!

      Note: The deployment appears to be 2 hours earlier than the source in Bamboo, but this due to UTC vs CEST timezone differences on the machines.

      Attachments

        Activity

          People

            jmajkutewicz Jan Majkutewicz (Inactive)
            e2d9b4164efe MaxServ
            Votes:
            27 Vote for this issue
            Watchers:
            33 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: