1 |
#!/bin/bash
|
2 |
|
3 |
# get values from git commandline ------------
|
4 |
BRANCH=$(git rev-parse --abbrev-ref HEAD|sed -e 's# #%20#g'|sed -e 'sx#x%23xg'|sed -e 's#/#%2F#g'| grep -v HEAD || git name-rev --name-only HEAD|sed -e 's#^remotes/origin/##'|sed -e 's#^origin/##'|sed -e 's# #%20#g'|sed -e 'sx#x%23xg'|sed -e 's#/#%2F#g')
|
5 |
REPO="zanavi"
|
6 |
REPOUSER=$(git config --get remote.origin.url|cut -d'/' -f 4)
|
7 |
# get values from git commandline ------------
|
8 |
|
9 |
echo $BRANCH
|
10 |
echo $REPO
|
11 |
echo $REPOUSER
|
12 |
|
13 |
# debug
|
14 |
# https://circleci.com/api/v1/project/zoff99/zanavi/latest/artifacts/0/$CIRCLE_ARTIFACTS/android-studio-project.zip?filter=successful&branch=master
|
15 |
|
16 |
wget 'https://circleci.com/api/v1/project/'"$REPOUSER"'/'"$REPO"'/latest/artifacts/0/$CIRCLE_ARTIFACTS/android-studio-project.zip?filter=successful&branch='"$BRANCH" -O ./android-studio-project.zip
|
17 |
unzip -o ./android-studio-project.zip
|
18 |
ls -al ./android-studio-project.zip
|
19 |
rm -f ./android-studio-project.zip
|