Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

CI/CD: EC2 template minor update (#768)

Rich Turner8777b1c809f3
diff --git a/.ci_cd/aws/cloudformation-create-ec2.yml b/.ci_cd/aws/cloudformation-create-ec2.yml
index 9f3756ef3..56716549c 100644
--- a/.ci_cd/aws/cloudformation-create-ec2.yml
+++ b/.ci_cd/aws/cloudformation-create-ec2.yml
@@ -177,7 +177,6 @@ Resources:
- docker_setup
- cron_setup
- env_vars
- - efs_setup
- dns_updater
- s3_backup_service
- deployment_local_dir
@@ -376,54 +375,6 @@ Resources:
systemctl enable dns-updater.service
systemctl start dns-updater.service
- efs_setup:
- packages:
- yum:
- amazon-efs-utils: []
- files:
- "/usr/local/bin/efs-mount":
- content: !Sub |
- #!/bin/bash
-
- # -------------------------------------------------------------------------------------------
- #
- # Script for checking if EFS filesystem called 'hosts-filesystem' exists and attempts to
- # mount it to /deployment.local/efs at boot time
- #
- # -------------------------------------------------------------------------------------------
-
- FILESYSTEMID=$(aws efs describe-file-systems --query "FileSystems[?Name=='hosts-filesystem'].FileSystemId" --output text --region ${AWS::Region})
-
- if [ -z "$FILESYSTEMID" ]; then
- echo "EFS Filesystem not found so nothing to mount"
- exit 0
- fi
-
- echo "Mounting EFS Filesystem '$FILESYSTEMID'"
- sudo mount -t efs $FILESYSTEMID /deployment.local/efs
- sudo chown -R ec2-user:ec2-user /deployment.local/efs
-
- "/lib/systemd/system/efs-mount.service":
- content: |
- [Unit]
- Description=Mounts hosts-filesystem EFS filesystem
- After=network-online.target firewalld.service
- Wants=network-online.target
-
- [Service]
- ExecStart=/usr/local/bin/efs-mount
-
- [Install]
- WantedBy=multi-user.target
- commands:
- 01_init_service:
- command: |
- mkdir -p /deployment.local/efs
- chmod +x /usr/local/bin/efs-mount
- systemctl daemon-reload
- systemctl enable efs-mount.service
- systemctl start efs-mount.service
-
env_vars:
files:
"/home/ec2-user/smtp_credentials_generate.py":
@@ -514,6 +465,15 @@ Resources:
if [ -n "${SMTPORArn}" ]; then
echo 'OR_EMAIL_X_HEADERS="X-SES-SOURCE-ARN: ${SMTPORArn}"' >> /etc/environment
fi
+ 02_efs_dns:
+ command: !Sub |
+ # Look for EFS filesystem called osts-filesystem and
+ FILESYSTEMID=$(aws efs describe-file-systems --query "FileSystems[?Name=='hosts-filesystem'].FileSystemId" --output text --region ${AWS::Region})
+
+ if [ -n "$FILESYSTEMID" ]; then
+ echo "EFS Filesystem found: $FILESYSTEMID"
+ echo "EFS_DNS=$FILESYSTEMID.efs.${AWS::Region}.amazonaws.com" >> /etc/environment
+ fi
docker_setup:
packages:
diff --git a/docker-compose.yml b/docker-compose.yml
index 172b7ce79..c9bfa90e0 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -11,7 +11,7 @@ volumes:
proxy-data:
temp-data:
postgresql-data:
- btmesh-data:
+# btmesh-data:
services:
@@ -85,6 +85,7 @@ services:
volumes:
- temp-data:/tmp
# - /var/run/dbus:/var/run/dbus
+# # Bluetooth mesh volume
# - btmesh-data:/btmesh
# devices:
# - /dev/ttyACM0:/dev/ttyS0