Skip to content

Commit

Permalink
use env or project variables for bintray credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
Łukasz Paczos committed Feb 6, 2020
1 parent 01902b6 commit 390d1f7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 12 deletions.
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ allprojects {
jcenter()
maven { url 'https://plugins.gradle.org/m2' }
maven {
Properties localProperties = new Properties()
localProperties.load(project.rootProject.file("local.properties").newDataInputStream())
url 'https://mapbox.bintray.com/mapbox_private'
credentials {
username = localProperties.getProperty("BINTRAY_USER", "")
password = localProperties.getProperty("BINTRAY_API_KEY", "")
username = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER')
password = project.hasProperty('BINTRAY_API_KEY') ? project.property('BINTRAY_API_KEY') : System.getenv('BINTRAY_API_KEY')
}
}
maven { url 'https://mapbox.bintray.com/mapbox' }
Expand Down
56 changes: 48 additions & 8 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ jobs:
keys:
- jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- jars-
- run:
name: Generate Bintray credentials
command: |
if [ -n "${BINTRAY_USER}" ]; then
echo "BINTRAY_USER=$BINTRAY_USER
BINTRAY_API_KEY=$BINTRAY_API_KEY
GPG_PASSPHRASE=$GPG_PASSPHRASE"
fi
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
Expand Down Expand Up @@ -123,6 +131,14 @@ jobs:
keys:
- deps-{{ checksum "build.gradle" }}-{{ checksum "gradle/dependencies.gradle" }}-{{ checksum "libdirections-hybrid/build.gradle" }}-{{ checksum "libdirections-offboard/build.gradle" }}-{{ checksum "libdirections-onboard/build.gradle" }}-{{ checksum "liblogger/build.gradle" }}-{{ checksum "libnavigation-base/build.gradle" }}-{{ checksum "libnavigation-metrics/build.gradle" }}-{{ checksum "libnavigation-util/build.gradle" }}-{{ checksum "libnavigator/build.gradle" }}-{{ checksum "libtrip-notification/build.gradle" }}-{{ checksum "libnavigation-core/build.gradle" }}
- deps-
- run:
name: Generate Bintray credentials
command: |
if [ -n "${BINTRAY_USER}" ]; then
echo "BINTRAY_USER=$BINTRAY_USER
BINTRAY_API_KEY=$BINTRAY_API_KEY
GPG_PASSPHRASE=$GPG_PASSPHRASE"
fi
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
Expand Down Expand Up @@ -153,6 +169,14 @@ jobs:
keys:
- deps-{{ checksum "build.gradle" }}-{{ checksum "gradle/dependencies.gradle" }}-{{ checksum "examples/build.gradle" }}-{{ checksum "libdirections-hybrid/build.gradle" }}-{{ checksum "libdirections-offboard/build.gradle" }}-{{ checksum "libdirections-onboard/build.gradle" }}-{{ checksum "liblogger/build.gradle" }}-{{ checksum "libnavigation-base/build.gradle" }}-{{ checksum "libnavigation-metrics/build.gradle" }}-{{ checksum "libnavigation-util/build.gradle" }}-{{ checksum "libnavigator/build.gradle" }}-{{ checksum "libtrip-notification/build.gradle" }}-{{ checksum "libnavigation-core/build.gradle" }}
- deps-
- run:
name: Generate Bintray credentials
command: |
if [ -n "${BINTRAY_USER}" ]; then
echo "BINTRAY_USER=$BINTRAY_USER
BINTRAY_API_KEY=$BINTRAY_API_KEY
GPG_PASSPHRASE=$GPG_PASSPHRASE"
fi
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
Expand Down Expand Up @@ -206,6 +230,14 @@ jobs:
IS_LOCAL_DEVELOPMENT: false
steps:
- checkout
- run:
name: Generate Bintray credentials
command: |
if [ -n "${BINTRAY_USER}" ]; then
echo "BINTRAY_USER=$BINTRAY_USER
BINTRAY_API_KEY=$BINTRAY_API_KEY
GPG_PASSPHRASE=$GPG_PASSPHRASE"
fi
- run:
name: Generate and Validate License
command: |
Expand Down Expand Up @@ -254,6 +286,14 @@ jobs:
- image: mbgl/61abee1674:android-ndk-r18
steps:
- checkout
- run:
name: Generate Bintray credentials
command: |
if [ -n "${BINTRAY_USER}" ]; then
echo "BINTRAY_USER=$BINTRAY_USER
BINTRAY_API_KEY=$BINTRAY_API_KEY
GPG_PASSPHRASE=$GPG_PASSPHRASE"
fi
- run:
name: Build Navigation SDK 1.0 (release)
command: make 1.0-build-release
Expand All @@ -264,14 +304,6 @@ jobs:
# - run:
# name: Check public documentation
# command: sh scripts/dokka-validate.sh
- run:
name: Generate Bintray credentials
command: |
if [ -n "${BINTRAY_USER}" ]; then
echo "BINTRAY_USER=$BINTRAY_USER
BINTRAY_API_KEY=$BINTRAY_API_KEY
GPG_PASSPHRASE=$GPG_PASSPHRASE"
fi
- deploy:
name: Publish Navigation SDK 1.0 to Bintray
command: |
Expand Down Expand Up @@ -299,6 +331,14 @@ jobs:
keys:
- jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- jars-
- run:
name: Generate Bintray credentials
command: |
if [ -n "${BINTRAY_USER}" ]; then
echo "BINTRAY_USER=$BINTRAY_USER
BINTRAY_API_KEY=$BINTRAY_API_KEY
GPG_PASSPHRASE=$GPG_PASSPHRASE"
fi
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
Expand Down

0 comments on commit 390d1f7

Please sign in to comment.