forked from fossasia/meilix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/generator'
- Loading branch information
Showing
4 changed files
with
59 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,32 @@ | ||
# This provides us with GCC binary support so we can run bash | ||
dist: trusty | ||
language: generic | ||
language: generic<number> commit message` | ||
|
||
|
||
git: | ||
depth: 1 | ||
|
||
sudo: required | ||
|
||
script: | ||
- ./build1.sh | ||
- ./build1.sh |& tee log.txt | ||
|
||
before_deploy: | ||
- sudo rm meilix-original.iso | ||
- export image_name="`echo *.iso`" | ||
- cat *.iso > "/home/travis/${image_name}" | ||
- curl --upload-file /home/travis/${image_name} https://transfer.sh/Meilix.ISO | ||
|
||
on_success: always | ||
|
||
deploy: | ||
- provider: releases | ||
skip_cleanup: true | ||
overwrite: true | ||
tag_name: $TRAVIS_TAG | ||
api_key: | ||
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=" | ||
|
||
file_glob: true # http://stackoverflow.com/a/28579635/1320237 | ||
file: "/home/travis/${image_name}" | ||
- provider: script | ||
script: curl --upload-file /home/travis/${image_name} https://transfer.sh/Meilix.ISO | ||
on: | ||
tags: true | ||
branch: upload-test | ||
|
||
after_deploy: | ||
- ./mail.py | ||
|
||
branch: master | ||
|
||
- cd mail-scripts && ./mail.py | ||
after_failure: | ||
- cd mail-scripts && ./mail-fail.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#! /usr/bin/env python3 | ||
import http.client | ||
import os | ||
import datetime | ||
import base64 | ||
|
||
#attachment encoding | ||
with open('log.txt','rb') as f: | ||
data = f.read() | ||
f.close() | ||
|
||
attachment = base64.b64encode(data) | ||
|
||
conn = http.client.HTTPSConnection("api.sendgrid.com") | ||
|
||
print (os.environ["email"]) | ||
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\"}]}" | ||
|
||
print (type(payload)) | ||
|
||
authorization = "Bearer " + os.environ["mail_api_key"] | ||
|
||
headers = { | ||
'authorization': authorization, | ||
'content-type': "application/json" | ||
} | ||
|
||
conn.request("POST", "/v3/mail/send", payload, headers) | ||
|
||
res = conn.getresponse() | ||
data = res.read() | ||
|
||
print(data.decode("utf-8")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,26 @@ | |
import http.client | ||
import os | ||
import datetime | ||
import base64 | ||
|
||
#attachment encoding | ||
with open('log.txt','rb') as f: | ||
data = f.read() | ||
f.close() | ||
|
||
attachment = base64.b64encode(data) | ||
|
||
conn = http.client.HTTPSConnection("api.sendgrid.com") | ||
|
||
date = datetime.datetime.now().strftime('%Y%m%d') | ||
url = "https://github.com/xeon-zolt/meilix/releases/download/"+os.environ["TRAVIS_TAG"]+"/meilix-i386-custom.iso" | ||
|
||
print (os.environ["email"]) | ||
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>\"}]}" | ||
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\"}]}" | ||
|
||
print (type(payload)) | ||
|
||
authorization = "Bearer " + os.environ["mail_api_key"] | ||
authorization = "Bearer " + os.environ["mail_api_key"] | ||
|
||
headers = { | ||
'authorization': authorization, | ||
|