Skip to content

Commit b665ce7

Browse files
committed
Merge remote-tracking branch 'upstream/generator'
2 parents 29bf225 + 15c3183 commit b665ce7

File tree

4 files changed

+59
-18
lines changed

4 files changed

+59
-18
lines changed

.travis.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
11
# This provides us with GCC binary support so we can run bash
22
dist: trusty
3-
language: generic
3+
language: generic<number> commit message`
4+
45

56
git:
67
depth: 1
78

89
sudo: required
910

1011
script:
11-
- ./build1.sh
12+
- ./build1.sh |& tee log.txt
1213

1314
before_deploy:
1415
- sudo rm meilix-original.iso
1516
- export image_name="`echo *.iso`"
1617
- cat *.iso > "/home/travis/${image_name}"
18+
- curl --upload-file /home/travis/${image_name} https://transfer.sh/Meilix.ISO
1719

1820
on_success: always
1921

2022
deploy:
21-
- provider: releases
22-
skip_cleanup: true
23-
overwrite: true
24-
tag_name: $TRAVIS_TAG
25-
api_key:
26-
secure: "KsbMe/CzvYmGvWoflBRjfiw8urvAZhNE/oL51HceeIeAeQ+Kr0jM/BRV+kG0c6scKwePknr02A7XqBwAEmUAYWNGd0TiRo5lIQxCONpPsYXwEtHSuA2+0pRuVN4qG+6sgYHvlNO7UbWgVu/aAapufTpIkUctHWHQRJUDN8+hUrfeRm4CjeA7Tz4y1KYzRNY4SrwQyEVLwxoTZ/DOuSjj3m40jrwOsBnql/SSYe6D8N2r0tv5Acs/qmClEUhQW26OB4tRRRgS9jXU2gni2ZEYV0h6D5aKehW6gWlZpK5Rdn5QEY2py+Mar29wF2nxAojD+chLgzxx3zjB5Dm6ERpzEznjffMEpBxlEEMO3uniOJjokn0k2IVsoZTvM9rCbBfFuD7+Ihv5nhZYM7Mc5iKZE1Tx6XW2ZX9LW7ebjP+jNmqLuBHUu3oAVeD9ZscdmHVnNFr1TNE+ZVAvSDfA73AaT+sT3TNF5SwYPyAH7uk8lHfUhS+rIAmX8efrSIUoaVSwy1Wzop6c2YbYGJq4RxqEEkCiE0aB6ldgXAA95uUcYzTkKL/i1myJK/DLpu+qV3AXhxVIpYqekhTEZmLMpCnXXEzPwsAe1CfEy4h0VV2ax51u+cAOhLcKZBRzDAJOd7dqAA6GpV24OOfP3VKqRxCWfYPtsLPoei6h9QWvWrYuC80="
27-
28-
file_glob: true # http://stackoverflow.com/a/28579635/1320237
29-
file: "/home/travis/${image_name}"
23+
- provider: script
24+
script: curl --upload-file /home/travis/${image_name} https://transfer.sh/Meilix.ISO
3025
on:
31-
tags: true
26+
branch: upload-test
3227

3328
after_deploy:
34-
- ./mail.py
35-
36-
branch: master
37-
29+
- cd mail-scripts && ./mail.py
30+
31+
after_failure:
32+
- cd mail-scripts && ./mail-fail.py

build1.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,15 @@ chmod +x meilix-generator.sh browser.sh
4343
echo "$(<meilix-generator.sh)" #to test the file
4444
./meilix-generator.sh
4545
rm meilix-generator.sh
46+
47+
#change host name
48+
hostname ${TRAVIS_TAG}
49+
4650
./browser.sh
4751
rm browser.sh
4852
4953
chmod +x set-wallpaper.sh && ./set-wallpaper.sh
54+
5055
#delete temporary files
5156
rm meilix-generator.sh
5257
rm -rf /tmp/* ~/.bash_history

mail-scripts/mail-fail.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#! /usr/bin/env python3
2+
import http.client
3+
import os
4+
import datetime
5+
import base64
6+
7+
#attachment encoding
8+
with open('log.txt','rb') as f:
9+
data = f.read()
10+
f.close()
11+
12+
attachment = base64.b64encode(data)
13+
14+
conn = http.client.HTTPSConnection("api.sendgrid.com")
15+
16+
print (os.environ["email"])
17+
payload = "{\"personalizations\":[{\"to\":[{\"email\":\"" + os.environ["email"] + "\"}],\"subject\":\"Your ISO is Ready\"}],\"from\":{\"email\":\"[email protected]\",\"name\":\"Meilix Generator\"},\"reply_to\":{\"email\":\"[email protected]\",\"name\":\"Meilix Generator\"},\"subject\":\"Your ISO is ready\",\"content\":[{\"type\":\"text/html\",\"value\":\"<html><p>Hi,<br>Your Build Gave error please report it to the developer<br><br>Thank You,<br>Meilix Generator Team</p></html>\"}],\"attachments\":[{\"content\":\""+str(attachment)[2:-1]+"\",\"type\":\"text/plain\",\"filename\":\"log.txt\"}]}"
18+
19+
print (type(payload))
20+
21+
authorization = "Bearer " + os.environ["mail_api_key"]
22+
23+
headers = {
24+
'authorization': authorization,
25+
'content-type': "application/json"
26+
}
27+
28+
conn.request("POST", "/v3/mail/send", payload, headers)
29+
30+
res = conn.getresponse()
31+
data = res.read()
32+
33+
print(data.decode("utf-8"))

mail.py renamed to mail-scripts/mail.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,26 @@
22
import http.client
33
import os
44
import datetime
5+
import base64
6+
7+
#attachment encoding
8+
with open('log.txt','rb') as f:
9+
data = f.read()
10+
f.close()
11+
12+
attachment = base64.b64encode(data)
513

614
conn = http.client.HTTPSConnection("api.sendgrid.com")
715

816
date = datetime.datetime.now().strftime('%Y%m%d')
917
url = "https://github.com/xeon-zolt/meilix/releases/download/"+os.environ["TRAVIS_TAG"]+"/meilix-i386-custom.iso"
1018

1119
print (os.environ["email"])
12-
payload = "{\"personalizations\":[{\"to\":[{\"email\":\"" + os.environ["email"] + "\"}],\"subject\":\"Your ISO is Ready\"}],\"from\":{\"email\":\"[email protected]\",\"name\":\"Meilix Generator\"},\"reply_to\":{\"email\":\"[email protected]\",\"name\":\"Meilix Generator\"},\"subject\":\"Your ISO is ready\",\"content\":[{\"type\":\"text/html\",\"value\":\"<html><p>Hi,<br>Your ISO is ready<br>URL : "+url+"<br><br>Thank You,<br>Meilix Generator Team</p></html>\"}]}"
20+
payload = "{\"personalizations\":[{\"to\":[{\"email\":\"" + os.environ["email"] + "\"}],\"subject\":\"Your ISO is Ready\"}],\"from\":{\"email\":\"[email protected]\",\"name\":\"Meilix Generator\"},\"reply_to\":{\"email\":\"[email protected]\",\"name\":\"Meilix Generator\"},\"subject\":\"Your ISO is ready\",\"content\":[{\"type\":\"text/html\",\"value\":\"<html><p>Hi,<br>Your ISO is ready<br>URL : "+url+"<br><br>Thank You,<br>Meilix Generator Team</p></html>\"}],\"attachments\":[{\"content\":\""+str(attachment)[2:-1]+"\",\"type\":\"text/plain\",\"filename\":\"log.txt\"}]}"
1321

1422
print (type(payload))
1523

16-
authorization = "Bearer " + os.environ["mail_api_key"]
24+
authorization = "Bearer " + os.environ["mail_api_key"]
1725

1826
headers = {
1927
'authorization': authorization,

0 commit comments

Comments
 (0)