Skip to content

Commit

Permalink
Merge pull request #77 from learningequality/develop
Browse files Browse the repository at this point in the history
Version Number Fix
  • Loading branch information
DXCanas authored Jan 27, 2021
2 parents dda52a7 + 32df10c commit 5e839cb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
1 change: 0 additions & 1 deletion .buildkite/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ else
docker rm $DOCKER_ID
fi

echo "--- :android: Build APK"
make run_docker

# Making folder structure match other installers (convention)
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ endif
.PHONY: kolibri.apk
# Build the debug version of the apk
kolibri.apk: p4a_android_distro preseeded_kolibri_home
echo "--- :android: Build APK"
pew build $(pew_release_flag) android ${ARCH}


Expand Down Expand Up @@ -84,4 +85,4 @@ run: install
sleep 1
adb logcat | grep -i -E "python|kolibr| `adb shell ps | grep ' org.learningequality.Kolibri$$' | tr -s [:space:] ' ' | cut -d' ' -f2` " | grep -E -v "WifiTrafficPoller|localhost:5000|NetworkManagementSocketTagger|No jobs to start"

launch: softbuild run
launch: softbuild run
21 changes: 20 additions & 1 deletion scripts/create_project_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,26 @@ def build_number():
Returns the build number for the apk. This is the mechanism used to understand whether one
build is newer than another. Uses buildkite build number with time as local dev backup
"""
return os.getenv('BUILDKITE_BUILD_NUMBER', datetime.now().strftime('%y%m%d%H%M'))

# Patch, due to a build error.
# Envar was not being passed into the container this runs in, and the
# build submitted to the play store ended up using the dev build number.
# We can't go backwards. So we're adding to the one submitted at first.
build_base_number = 2009000000

buildkite_build_number = os.getenv('BUILDKITE_BUILD_NUMBER')

print('--- Assigning Build Number')

if buildkite_build_number is not None:
build_number = build_base_number + int(buildkite_build_number)
print(build_number)
return str(build_number)

print('Buildkite build # not found, using dev alternative')
alt_build_number = datetime.now().strftime('%y%m%d%H%M')
print(alt_build_number)
return alt_build_number

def create_project_info():
"""
Expand Down
1 change: 1 addition & 0 deletions scripts/rundocker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CID_FILE=kolibri-android-app-container-id.cid.txt
docker create -it \
--mount type=volume,src=${P4A_CACHE},dst=${CONTAINER_HOME}/.local \
--mount type=volume,src=${PEW_CACHE},dst=${CONTAINER_HOME}/.pyeverywhere \
--env BUILDKITE_BUILD_NUMBER \
--env P4A_RELEASE_KEYSTORE=${CONTAINER_HOME}/$(basename "${P4A_RELEASE_KEYSTORE}") \
--env P4A_RELEASE_KEYALIAS \
--env P4A_RELEASE_KEYSTORE_PASSWD \
Expand Down

0 comments on commit 5e839cb

Please sign in to comment.