Skip to content

Commit

Permalink
[ci] Travis build tag as sdk version
Browse files Browse the repository at this point in the history
  • Loading branch information
CODeRUS authored and Andrey Kozhevnikov committed Apr 30, 2019
1 parent 40de9ee commit d66e0c9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
20 changes: 12 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
language: generic

env:
- RELEASE=3.0.2.8
branches:
except:
- master

services:
- docker

before_install:
- if [ -z "$TRAVIS_TAG" ]; then exit 0; fi
- docker pull coderus/sailfishos-baseimage
- docker run --rm --privileged -it
-e RELEASE=$RELEASE
-e RELEASE=$TRAVIS_TAG
-v $(pwd):/share -w /share
coderus/sailfishos-baseimage
bash build-all.sh

script:
- if [ -z "$TRAVIS_TAG" ]; then exit 0; fi
- docker import build/platformsdk-i486.tar coderus/sailfishos-platform-sdk-base:latest
- docker tag coderus/sailfishos-platform-sdk-base:latest coderus/sailfishos-platform-sdk-base:$RELEASE
- docker build --build-arg RELEASE=$RELEASE -t coderus/sailfishos-platform-sdk:latest .
- docker tag coderus/sailfishos-platform-sdk:latest coderus/sailfishos-platform-sdk:$RELEASE
- docker tag coderus/sailfishos-platform-sdk-base:latest coderus/sailfishos-platform-sdk-base:$TRAVIS_TAG
- docker build --build-arg RELEASE=$TRAVIS_TAG -t coderus/sailfishos-platform-sdk:latest .
- docker tag coderus/sailfishos-platform-sdk:latest coderus/sailfishos-platform-sdk:$TRAVIS_TAG
- sudo rm -rf build

deploy:
provider: script
script: bash docker_push
on:
branch: master
tags: true
script: bash docker_push
6 changes: 4 additions & 2 deletions docker_push
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash

if [ -z "$TRAVIS_TAG" ]; then exit 0; fi

echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

docker push coderus/sailfishos-platform-sdk-base:latest
docker push coderus/sailfishos-platform-sdk-base:$RELEASE
docker push coderus/sailfishos-platform-sdk-base:$TRAVIS_TAG

docker push coderus/sailfishos-platform-sdk:latest
docker push coderus/sailfishos-platform-sdk:$RELEASE
docker push coderus/sailfishos-platform-sdk:$TRAVIS_TAG

0 comments on commit d66e0c9

Please sign in to comment.