Deploy issue with aws codedeploy & ubuntu on ec2 -


i deploying ruby code using aws codedeplo plugin jenkins. jenkins triggering deployment , deployment successful. successful meant copying files server success.

the server runnung on ubuntu 14.04 ruby2.3.1

post deployment, there .sh files executed. these details maintained via appspec.yml file. mentioned in appspec.yml file execute user:devops

the .sh files getting executed, result not successful.

the issues below: 1. commands in .sh file includes gem installations. 2. execution of execution resulting in error referring ruby 1.9.3 not 2.3.1

we anlysed directories / code deployment log file & found below: 1. codedeploy agent directory owned user 4 digit numeric value e.g.3456 2. when printing ruby-v printing 1.9.3, terminal shows 2.3.1 3. log shows error gem installation failed there no permission write in gems/1.9.1 directory

when execute .sh file terminal execution successful.

can focus on have done wrong?

codedeploy agent doesn't have shell env.

since using rvm on machine code deployed , on top of .sh files put

#!/bin/bash source /etc/profile.d/rvm.sh rvm use 2.3.0  #rest of commands 

this works fine me.


Comments