image_builder: use BUILD_DIR in Travis

This commit is contained in:
Artem Smirnov
2018-09-22 00:01:58 +03:00
parent 0e791c7bf7
commit e47824b1ff

View File

@@ -9,12 +9,13 @@ env:
- IMAGE_VERSION="${TRAVIS_BRANCH}_$(echo ${TRAVIS_COMMIT} | cut -c1-7)"
- IMAGE_PATH="$(pwd)/image/$(basename -s '.git' ${TARGET_REPO})_${IMAGE_VERSION}.img"
- IMAGE_NAME="$(basename ${IMAGE_PATH})"
- BUILD_DIR="$(dirname ${IMAGE_PATH})"
git:
depth: 1
before_script:
- docker pull ${DOCKER}
script:
- docker run --privileged --rm -v /dev:/dev -v $(pwd)/image:/builder/image -e "TARGET_REPO=${TARGET_REPO}" -e "TARGET_REF=${TRAVIS_BRANCH}" ${DOCKER}
- docker run --privileged --rm -v /dev:/dev -v ${BUILD_DIR}:/builder/image -e "TARGET_REPO=${TARGET_REPO}" -e "TARGET_REF=${TRAVIS_BRANCH}" ${DOCKER}
#after_failure:
# - skip_deploy: true
before_deploy:
@@ -22,7 +23,7 @@ before_deploy:
- git config --local user.name "urpylka"
- git config --local user.email "urpylka@gmail.com"
- git tag "$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)"
- cd $(pwd)/image && zip ${IMAGE_NAME}.zip ${IMAGE_NAME}
- cd ${BUILD_DIR} && zip ${IMAGE_NAME}.zip ${IMAGE_NAME}
deploy:
provider: releases
api_key: ${GITHUB_OAUTH_TOKEN}