Get python app version tag deployed on elastic beanstalk

I would like to know how I can get the tag label attribute of a package deployed on an elastic beanstalk to show it in my application.

As far as I know, packages deployed using "git aws.push" are loaded into the S3 bucket. My goal is to get the version number and set it as an environment variable or get it dynamically so that it appears inside my django application.

thank

+4
source share
1 answer

. , , , , , AWS.

1:

(, ), .

, Makefile:

VERSION=$(shell git rev-parse --short HEAD)

deploy: requirements.txt
    echo $(VERSION) > version.txt
    eb deploy --label $(VERSION)
.PHONY: deploy

. , , sed, .

2: ()

EC2 , , , root:

[root@... ec2-user]# cat /opt/elasticbeanstalk/deploy/manifest
{"RuntimeSources":{"yourappname":{"app-VERSION":{"s3url":""}}},"DeploymentId":24,"Serial":26}
[ec2-user@... ~]$ ls -la /opt/elasticbeanstalk/deploy/manifest
-rw-rw---- 1 root awseb 98 Mar 22 17:57 /opt/elasticbeanstalk/deploy/manifest

, , , , . , .

: Elastic Beanstalk ? (, ).

0

Source: https://habr.com/ru/post/1544208/


All Articles