1

I'm using S3 archive deployment app to deploy a zip file generated from build process. When I deploy to several servers I notice that the absolute path generated by the deployment are different on each servers. Apparently the path is using the deployment time and each servers can deploy the app in different seconds.

e.g.

Server1: /srv/www/myapp/releases/20141112085530/
Server2: /srv/www/myapp/releases/20141112085520/
Server3: /srv/www/myapp/releases/20141112085515/

In the app I have a script that requires absolute path of the app, so the return of the script will be different from each servers. This will be inconvenient if I use non sticky session ELB.

My current solution is that the script will require a hash generated for every build instead of absolute path.

But I'm just wondering if there is minimum way to config the OpsWorks to make the absolute path of the deployment consistent for each servers for S3 deployment.

Petra Barus
  • 121
  • 1
  • 5

1 Answers1

1

The current version of the app is symlinked via a current symlink in the app's directory. So srv/www/myapp/current will link to (the currently running version of the app)

RyanWilcox
  • 111
  • 3
  • but the absolute path is different, right? – Petra Barus Dec 10 '14 at 22:45
  • You should be able to point to that symlink and use that as the absolute path. Sure, where the symlink points to will be different on each machine, but you do have a consistent way to get the most currently deployed version of your app... – RyanWilcox Dec 11 '14 at 00:48