2017-01-09 3 views
0

Ich versuche, nach der Bereitstellung auf AWS EB einige Dinge abgeschlossen zu bekommen. Ich habe meine .ebextensions zum Git-Repository hinzugefügt und ich habe nur eine Datei 01_container_commands.config, scheint es nicht zu laufen, wenn ich die /var/log/eb-activity.log Schwanz an einem Punkt lief es und war auf Befehl 05 unten aufgeführt fehlgeschlagen, so dass ich 05 entfernt, aber jetzt tut es überhaupt nicht laufen.AWS ElasticBeanstalk .exextensions wird nicht ausgeführt

container_commands: 
    01_user_permission: 
    command: /usr/sbin/usermod -a -G webapp ec2-user 
    02_remove_storage_directory: 
    command: rm -rf /var/app/current/storage 
    03_create_storage_directories: 
    command: mkdir /var/app/current/storage /var/app/current/storage/framework /var/app/current/storage/framework/session /var/app/current/storage/framework/views /var/app/current/storage/framework/cache 
    04_set_storage_permissions: 
    command: chmod -fR 755 /var/app/current/storage 
    05_copy_env_file 
    command: cp /var/app/current/.aws.env /var/app/current/.env 

Es scheint, dass es meine ebextensions nicht ausgeführt wird, irgendwelche Ideen, was ich herausfinden, warum überprüfen könnte?

Als eine Randnotiz habe ich versucht, meine Befehle mit doppelten Anführungszeichen zu umhüllen, das schien auch nicht zu helfen.

Wie Sie unten sehen können, wird mein Skript überhaupt nicht ausgeführt.

[2017-01-09T19:59:09.615Z] INFO [26612] - [Application update [email protected]/AppDeployStage0/AppDeployPreHook/12_update_permissions.sh] : Starting activity... 
[2017-01-09T19:59:20.431Z] INFO [26612] - [Application update [email protected]/AppDeployStage0/AppDeployPreHook/12_update_permissions.sh] : Completed activity. Result: 
    ++ /opt/elasticbeanstalk/bin/get-config container -k app_user 
    + EB_APP_USER=webapp 
    ++ /opt/elasticbeanstalk/bin/get-config container -k app_base_dir 
    + EB_APP_BASE_DIR=/var/app 
    ++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir 
    + EB_APP_STAGING_DIR=/var/app/ondeck 
    ++ /opt/elasticbeanstalk/bin/get-config container -k app_logs_dir 
    + EB_APP_LOGS_DIR=/var/app/support/logs 
    + cd /var/app/ondeck 
    + chown -R webapp:webapp /var/app 
    + chown -R webapp:webapp /var/log/httpd 
    + '[' -f app/SymfonyRequirements.php ']' 
[2017-01-09T19:59:20.431Z] INFO [26612] - [Application update [email protected]/AppDeployStage0/AppDeployPreHook] : Completed activity. Result: 
    Successfully execute hooks in directory /opt/elasticbeanstalk/hooks/appdeploy/pre. 
[2017-01-09T19:59:20.432Z] INFO [26612] - [Application update [email protected]/AppDeployStage0/EbExtensionPostBuild] : Starting activity... 
[2017-01-09T19:59:21.040Z] INFO [26612] - [Application update [email protected]/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild] : Starting activity... 
[2017-01-09T19:59:21.040Z] INFO [26612] - [Application update [email protected]/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild] : Completed activity. 
[2017-01-09T19:59:21.075Z] INFO [26612] - [Application update [email protected]/AppDeployStage0/EbExtensionPostBuild] : Completed activity. 
[2017-01-09T19:59:21.076Z] INFO [26612] - [Application update [email protected]/AppDeployStage0/InfraCleanEbextension] : Starting activity... 
[2017-01-09T19:59:21.157Z] INFO [26612] - [Application update [email protected]/AppDeployStage0/InfraCleanEbextension] : Completed activity. Result: 
    Cleaned ebextensions subdirectories from /var/app/ondeck. 
[2017-01-09T19:59:21.157Z] INFO [26612] - [Application update [email protected]/AppDeployStage0] : Completed activity. Result: 
    Application update - Command CMD-AppDeploy stage 0 completed 
[2017-01-09T19:59:21.158Z] INFO [26612] - [Application update [email protected]/AppDeployStage1] : Starting activity... 
[2017-01-09T19:59:21.158Z] INFO [26612] - [Application update [email protected]/AppDeployStage1/AppDeployEnactHook] : Starting activity... 
[2017-01-09T19:59:21.158Z] INFO [26612] - [Application update [email protected]/AppDeployStage1/AppDeployEnactHook/01_flip.sh] : Starting activity... 
[2017-01-09T19:59:21.535Z] INFO [26612] - [Application update [email protected]/AppDeployStage1/AppDeployEnactHook/01_flip.sh] : Completed activity. Result: 
    ++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir 
    + EB_APP_STAGING_DIR=/var/app/ondeck 
    ++ /opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir 
    + EB_APP_DEPLOY_DIR=/var/app/current 
    + '[' -d /var/app/current ']' 
    + mv /var/app/current /var/app/current.old 
    + mv /var/app/ondeck /var/app/current 
    + nohup rm -rf /var/app/current.old 
[2017-01-09T19:59:21.535Z] INFO [26612] - [Application update [email protected]/AppDeployStage1/AppDeployEnactHook/99_reload_app_server.sh] : Starting activity... 
[2017-01-09T19:59:21.677Z] INFO [26612] - [Application update [email protected]/AppDeployStage1/AppDeployEnactHook/99_reload_app_server.sh] : Completed activity. Result: 
    Equivalent Upstart operations: start httpd, stop httpd, restart httpd, status httpd 
    Gracefully restarting httpd 
    [OK] 
[2017-01-09T19:59:21.677Z] INFO [26612] - [Application update [email protected]/AppDeployStage1/AppDeployEnactHook] : Completed activity. Result: 
    Successfully execute hooks in directory /opt/elasticbeanstalk/hooks/appdeploy/enact. 
[2017-01-09T19:59:21.678Z] INFO [26612] - [Application update [email protected]/AppDeployStage1/AppDeployPostHook] : Starting activity... 
[2017-01-09T19:59:21.678Z] INFO [26612] - [Application update [email protected]/AppDeployStage1/AppDeployPostHook/01_monitor_httpd_pid.sh] : Starting activity... 
[2017-01-09T19:59:22.168Z] INFO [26612] - [Application update [email protected]/AppDeployStage1/AppDeployPostHook/01_monitor_httpd_pid.sh] : Completed activity. Result: 
    + chmod 0755 /var/run/httpd 
    + /opt/elasticbeanstalk/bin/healthd-track-pidfile --proxy httpd 
[2017-01-09T19:59:22.168Z] INFO [26612] - [Application update [email protected]/AppDeployStage1/AppDeployPostHook] : Completed activity. Result: 
    Successfully execute hooks in directory /opt/elasticbeanstalk/hooks/appdeploy/post. 
[2017-01-09T19:59:22.169Z] INFO [26612] - [Application update [email protected]/AppDeployStage1] : Completed activity. Result: 
    Application version switch - Command CMD-AppDeploy stage 1 completed 
[2017-01-09T19:59:22.169Z] INFO [26612] - [Application update [email protected]/AddonsAfter] : Starting activity... 
[2017-01-09T19:59:22.169Z] INFO [26612] - [Application update [email protected]/AddonsAfter/ConfigLogRotation] : Starting activity... 
[2017-01-09T19:59:22.170Z] INFO [26612] - [Application update [email protected]/AddonsAfter/ConfigLogRotation/10-config.sh] : Starting activity... 
[2017-01-09T19:59:22.611Z] INFO [26612] - [Application update [email protected]/AddonsAfter/ConfigLogRotation/10-config.sh] :  Completed activity. Result: 
    Disabled forced hourly log rotation. 
[2017-01-09T19:59:22.612Z] INFO [26612] - [Application update [email protected]/AddonsAfter/ConfigLogRotation] : Completed activity. Result: 
    Successfully execute hooks in directory /opt/elasticbeanstalk/addons/logpublish/hooks/config. 
[2017-01-09T19:59:22.612Z] INFO [26612] - [Application update [email protected]/AddonsAfter/ConfigCWLAgent] : Starting activity... 
[2017-01-09T19:59:22.613Z] INFO [26612] - [Application update [email protected]/AddonsAfter/ConfigCWLAgent/10-config.sh] : Starting activity... 
[2017-01-09T19:59:22.923Z] INFO [26612] - [Application update [email protected]/AddonsAfter/ConfigCWLAgent/10-config.sh] : Completed activity. Result: 
    Log streaming option setting is not specified, ignore cloudwatch logs setup. 

    Disabled log streaming. 
[2017-01-09T19:59:22.923Z] INFO [26612] - [Application update [email protected]/AddonsAfter/ConfigCWLAgent] : Completed activity. Result: 
    Successfully execute hooks in directory /opt/elasticbeanstalk/addons/logstreaming/hooks/config. 
[2017-01-09T19:59:22.923Z] INFO [26612] - [Application update [email protected]/AddonsAfter] : Completed activity. 
[2017-01-09T19:59:22.924Z] INFO [26612] - [Application update [email protected]] : Completed activity. Result: 
    Application update - Command CMD-AppDeploy succeeded 
+0

Wie stellen Sie es in EB bereit? – pgratton

+0

Ich benutze die CLI Tools '' 'eb deploy''', die Bereitstellung funktioniert gut, aber die Konfigurationsdatei wird nur manchmal und nicht immer mit jeder Bereitstellung ausgeführt. In jüngerer Zeit scheint es, als hätte es einfach aufgehört, alles zusammen auszuführen. –

Antwort

0

Pro the documentation, sollten Ihre Befehle doppelt zitiert werden, wie unten. Sie haben auch einen Doppelpunkt nach 05_copy_env_file vermisst.

Ich weiß, dass Sie gesagt haben, dass Sie versucht haben, doppelt zu quotieren, aber können Sie es wiederholen, nachdem Sie sowohl das Zitat als auch den Doppelpunkt korrigiert haben? Bitte aktualisieren Sie Ihre Frage mit Ihrer neuen 01_container_commands.config Datei und der gesamten /var/log/eb-activity.log Datei. Vielen Dank!

container_commands: 
    01_user_permission: 
    command: "/usr/sbin/usermod -a -G webapp ec2-user" 
    02_remove_storage_directory: 
    command: "rm -rf /var/app/current/storage" 
    03_create_storage_directories: 
    command: "mkdir /var/app/current/storage /var/app/current/storage/framework /var/app/current/storage/framework/session /var/app/current/storage/framework/views /var/app/current/storage/framework/cache" 
    04_set_storage_permissions: 
    command: "chmod -fR 755 /var/app/current/storage" 
    05_copy_env_file: 
    command: "cp /var/app/current/.aws.env /var/app/current/.env" 
+0

Ich hatte mit und ohne Anführungszeichen versucht .. Das war nicht das Problem, auch nach dem Fixieren von denen es nicht funktionierte. Der Grund ist, weil ich dieses Zeug "post-deployment" tun musste, was nicht wirklich dokumentiert ist, dieser Artikel hat Dinge für mich arbeiten lassen. http://junkheap.net/blog/2013/05/20/elastic-beanstalk-post-deployment-scripts/ –

+1

Gut zu hören, dass es funktioniert! Ich wünschte, AWS würde offiziell die "Post-Deployment" -Technik unterstützen, aber wie Sie fanden, funktioniert es gut. Das heißt, Ihr '01_user_permission'-Schritt sollte als regulärer' container_command' funktionieren, da er '/ var/app/current' nicht beeinflusst. – Brian

Verwandte Themen