This file contains hidden or 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
| #!/bin/bash | |
| if [ $# -lt 3 ]; then echo "Missing parameters"; exit 1; fi | |
| curl -X POST https://content.dropboxapi.com/2/files/upload \ | |
| --header "Authorization: Bearer $1" \ | |
| --header "Dropbox-API-Arg: {\"path\": \"/builds/$2\",\"mode\": \"add\",\"autorename\": true,\"mute\": false,\"strict_conflict\": false}" \ | |
| --header "Content-Type: application/octet-stream" \ | |
| --data-binary @$3 > /dev/null |
This file contains hidden or 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
| #!/bin/bash | |
| if [ $# -lt 4 ]; then echo "Missing parameters"; exit 1; fi | |
| content=$(awk '{printf "%s\\n", $0}' $3) | |
| curl --request POST \ | |
| --url $4 \ | |
| --header 'content-type: application/json' \ | |
| --data "{ |
This file contains hidden or 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
| image: jangrewe/gitlab-ci-android | |
| before_script: | |
| - export GRADLE_USER_HOME=$(pwd)/.gradle | |
| - chmod +x ./gradlew | |
| cache: | |
| key: ${CI_PROJECT_ID} | |
| paths: | |
| - .gradle/ |
This file contains hidden or 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
| DROPBOX_UPLOAD_ARGS = { | |
| "path": None, | |
| "mode": "overwrite", | |
| "autorename": True, | |
| "strict_conflict": True | |
| } | |
| DROPBOX_UPLOAD_URL = 'https://content.dropboxapi.com/2/files/upload' | |
| DROPBOX_SHARE_DATA = { | |
| "path": None, |
This file contains hidden or 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
| ZAPIER_SEND_DATA = { | |
| "to": None, | |
| "subject": None, | |
| "body": None | |
| } | |
| def send_email(zapier_hook, to, subject, body): | |
| ZAPIER_SEND_DATA['to'] = to | |
| ZAPIER_SEND_DATA['subject'] = subject |
This file contains hidden or 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
| def get_app(release_dir): | |
| output_path = os.path.join(release_dir, 'output.json') | |
| with(open(output_path)) as app_output: | |
| json_data = json.load(app_output) | |
| app_version = json_data[0]['apkInfo']['versionName'] | |
| app_file = os.path.join(release_dir, json_data[0]['apkInfo']['outputFile']) | |
| return app_version, app_file |
This file contains hidden or 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
| def get_target_file_name(app_name, app_version): | |
| app_name = app_name.lower() | |
| app_version = app_version.replace('.', '_') | |
| return '{name}_{version}.apk'.format(name=app_name, version=app_version).replace(' ','') |
This file contains hidden or 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
| def get_changes(change_log_path): | |
| with(open(change_log_path)) as change_log_file: | |
| change_log = change_log_file.read() | |
| # Split by '##' and remove lines starting with '#' | |
| latest_version_changes = change_log.split('##')[0][:-1] | |
| latest_version_changes = re.sub('^#.*\n?', '', latest_version_changes, flags=re.MULTILINE) | |
| return latest_version_changes |
This file contains hidden or 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
| def get_email(app_name, app_version, app_url, changes, template_file_path): | |
| target_subject = 1 | |
| target_body = 2 | |
| target = 0 | |
| subject = "" | |
| body = "" | |
| template = "" |
This file contains hidden or 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
| curl --request POST \ | |
| --url https://hooks.zapier.com/hooks/catch/12345/abcd/ \ | |
| --header 'content-type: application/json' \ | |
| --data '{ | |
| "to": "me@myorg.com", | |
| "subject": "New App Version 1.0005", | |
| "body": "App is ready\nClick download" | |
| }' |
OlderNewer