Month: May 2020

Amazon SES with Postfix in Ubuntu

Was looking at https://docs.aws.amazon.com/ses/latest/DeveloperGuide/postfix.html but it’s not really working as it’s missing some key commands.

1. Install packages

apt install -y postfix libsasl2-modules

* select ‘no configuration’

2. Config files

cp /usr/share/postfix/main.cf.debian /etc/postfix/main.cf

in /etc/postfix/main.cf

smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = encrypt
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
relayhost = [email-smtp.us-west-2.amazonaws.com]:587
smtp_sasl_auth_enable = yes
smtp_use_tls = yes
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
mydestination =

/etc/postfix/sasl_passwd

[email-smtp.us-west-2.amazonaws.com]:587 USERNAME:PASSWORD

3.Apply configs and restart the service

newaliases
postmap hash:/etc/postfix/sasl_passwd
systemctl restart postfix

4. (optional) Test

sendmail -f EMAIL@FROM.com EMAIL@TO.com
From: test <email@from.com>
Subject: test
.</email@from.com>

then in /var/log/mail.log
-snip- status=sent (250 Ok -snip-

Selenoid Parallel CI testing

Selenoid is handy tool to manage test runner with minimum efforts.
As it uses own dependent containers by itself, need to maintain single Selenoid run per build agent.

docker-compose.yml

services:   
e2e-test-runner:     
networks:       
selenoid: null     
depends_on:       
- selenoid     
build:       
context: .       
dockerfile: unittest/Dockerfile
volumes:       
- $PWD/unittest/build/reports:/app/unittest/build/reports       
- /var/run/docker.sock:/var/run/docker.sock 

selenoid:   
image: aerokube/selenoid:latest-release   
networks:     
selenoid: null   
volumes:     
- "/tmp/selenoid/video:/opt/selenoid/video:delegated"     
- "/tmp/selenoid/logs:/opt/selenoid/logs:delegated"     
- "$PWD/end-to-end/selenoid:/etc/selenoid:delegated"     
- "/var/run/docker.sock:/var/run/docker.sock"   
expose:     
- "4444"  
environment:     
- OVERRIDE_VIDEO_OUTPUT_DIR=/tmp/selenoid/video   
command: ["-conf", "browsers.json", "-video-output-dir", "/opt/selenoid/video", "-log-output-dir", "/opt/selenoid/logs","-save-all-logs","-disable-privileged", "-container-network", "selenoid"] 

CI Pipeline (BK)

 
agents:   
aws:
instance-id: "$BUILDKITE_AGENT_META_DATA_AWS_INSTANCE_ID"

first-step.sh

#!/bin/bash
echo --- :docker: Prep Selenoid docker network create selenoid || true 
docker pull selenoid/video-recorder:latest-release 
docker pull selenoid/vnc_chrome:79.0 
mkdir -p /tmp/selenoid/video 
mkdir -p /tmp/selenoid/logs

last-step.sh

 
#!/bin/bash
echo +++ :arrow_up: Upload Selenoid Artifacts 
buildkite-agent artifact upload "/tmp/selenoid/**/**" 
echo +++ :dusty_stick: Cleaning Up 
rm -rf /tmp/selenoid/logs 
rm -rf /tmp/selenoid/video 
docker-compose -f docker-compose.yml down