Skip to content

Commit

Permalink
Merge pull request #1 from applivery/develop
Browse files Browse the repository at this point in the history
v1.2.0
  • Loading branch information
CesarTrigo committed Apr 27, 2016
2 parents f76628c + caba760 commit be8964f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 12 deletions.
6 changes: 3 additions & 3 deletions bitrise.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
format_version: 1.1.0
format_version: 1.2.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git

app:
envs:
# define these in your .bitrise.secrets.yml
- APK_PATH: $APK_PATH
- API_TOKEN: $API_TOKEN
- APP_ID: $APP_ID
- API_TOKEN: $APPLIVERY_API_TOKEN
- APP_ID: $APPLIVERY_APP_ID

workflows:
test:
Expand Down
41 changes: 34 additions & 7 deletions step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,32 @@ if [ ! -f "${apk_path}" ] ; then
fi

# APPLIVERY API TOKEN
if [ -z "${APPLIVERY_API_TOKEN}" ] ; then
if [ -z "${api_token}" ] ; then
echo "# Error"
echo '* No App APPLIVERY_API_TOKEN provided as environment variable. Terminating...'
echo '* No APPLIVERY_API_TOKEN provided as environment variable. Terminating...'
echoStatusFailed
exit 1
fi

# APPLIVER APP ID
if [ -z "${APPLIVERY_APP_ID}" ] ; then
if [ -z "${app_id}" ] ; then
echo "# Error"
echo '* No App APPLIVERY_APP_ID provided as environment variable. Terminating...'
echo '* No APPLIVERY_APP_ID provided as environment variable. Terminating...'
echoStatusFailed
exit 1
fi

############# DEFINITIONS ##############

api_token="${APPLIVERY_API_TOKEN}"
app_id="${APPLIVERY_APP_ID}"
bitrise_build_number="${BITRISE_BUILD_NUMBER}"
git_repository_url="${GIT_REPOSITORY_URL}"
bitrise_app_url="${BITRISE_APP_URL}"
bitrise_build_url="${BITRISE_BUILD_URL}"
bitrise_build_trigger_timestamp="${BITRISE_BUILD_TRIGGER_TIMESTAMP}"
bitrise_git_branch="${BITRISE_GIT_BRANCH}"
bitrise_git_tag="${BITRISE_GIT_TAG}"
bitrise_git_commit="${BITRISE_GIT_COMMIT}"
bitrise_git_message="${BITRISE_GIT_MESSAGE}"

echo
echo "========== CONFIGS =========="
Expand All @@ -52,6 +59,16 @@ echo "* notify: ${notify}"
echo "* os: ${os}"
echo "* tags: ${tags}"
echo "* apk_path: ${apk_path}"
echo "***** Other variables *****"
echo "* bitrise_build_number: ${bitrise_build_number}"
echo "* git_repository_url: ${git_repository_url}"
echo "* bitrise_app_url: ${bitrise_app_url}"
echo "* bitrise_build_url: ${bitrise_build_url}"
echo "* bitrise_build_trigger_timestamp: ${bitrise_build_trigger_timestamp}"
echo "* bitrise_git_branch: ${bitrise_git_branch}"
echo "* bitrise_git_tag: ${bitrise_git_tag}"
echo "* bitrise_git_commit: ${bitrise_git_commit}"
echo "* bitrise_git_message: ${bitrise_git_message}"
echo

###########################
Expand All @@ -63,8 +80,18 @@ curl_cmd="$curl_cmd -F \"versionName=${version_name}\""
curl_cmd="$curl_cmd -F \"notes=${notes}\""
curl_cmd="$curl_cmd -F \"notify=${notify}\""
curl_cmd="$curl_cmd -F \"os=android\""
curl_cmd="$curl_cmd -F \"deployer=bitrise\""
curl_cmd="$curl_cmd -F \"tags=${tags}\""
curl_cmd="$curl_cmd -F \"package=@${apk_path}\""
curl_cmd="$curl_cmd -F \"bitrise_build_number=${bitrise_build_number}\""
curl_cmd="$curl_cmd -F \"git_repository_url=${git_repository_url}\""
curl_cmd="$curl_cmd -F \"bitrise_app_url=${bitrise_app_url}\""
curl_cmd="$curl_cmd -F \"bitrise_build_url=${bitrise_build_url}\""
curl_cmd="$curl_cmd -F \"bitrise_build_trigger_timestamp=${bitrise_build_trigger_timestamp}\""
curl_cmd="$curl_cmd -F \"bitrise_git_branch=${bitrise_git_branch}\""
curl_cmd="$curl_cmd -F \"bitrise_git_tag=${bitrise_git_tag}\""
curl_cmd="$curl_cmd -F \"bitrise_git_commit=${bitrise_git_commit}\""
curl_cmd="$curl_cmd -F \"bitrise_git_message=${bitrise_git_message}\""
curl_cmd="$curl_cmd https://dashboard.applivery.com/api/builds"

echo
Expand Down Expand Up @@ -117,4 +144,4 @@ envman add --key "APPLIVERY_DEPLOY_STATUS" --value "success"
# final results
echo "* Deploy Result: Success"

exit 0
exit 0
4 changes: 2 additions & 2 deletions step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ inputs:
summary: ""
description: ""
is_required: true
- api_token: ""
- api_token: "$APPLIVERY_API_TOKEN"
opts:
title: "Account API Key"
summary: ""
Expand All @@ -43,7 +43,7 @@ inputs:
click on Developers menu option from the left side menu and copy it from the
Account API Key section.
is_required: true
- app_id: ""
- app_id: "$APPLIVERY_APP_ID"
opts:
title: "Applivery: App ID"
summary: ""
Expand Down

0 comments on commit be8964f

Please sign in to comment.