-
Notifications
You must be signed in to change notification settings - Fork 11
/
.travis.yml
43 lines (43 loc) · 2.17 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
language: python
python:
- "3.6"
jobs:
include:
- stage: Version Updation for sdk config
language: python
if: tag IS present
script:
- git clone https://$BITBUCKET_USER:[email protected]/shoonyacloud/esper-sdk-config.git
- cd esper-sdk-config
- export SDK_VERSION=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/esper-io/esper-api-spec | cut --delimiter='/' --fields=3 | tail --lines=1 | cut -b 2-)
- python3 update_version.py
- git config --global user.email "[email protected]"
- git config --global user.name "Travis CI"
- git add sdk-config/python-config.json
- git diff-index --quiet HEAD || git commit -m "(Travis build $TRAVIS_BUILD_NUMBER) Update SDK Version number"
- git push -u origin master
- stage: SDK Generation
language: java
jdk: openjdk8
if: tag IS present
before_script:
- git clone https://github.com/esper-io/esper-api-spec.git
- cd esper-api-spec
- export COMMIT_MESSAGE=$(git log --format='%b' --merges -1 origin/master)
- export SDK_VERSION=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/esper-io/esper-api-spec | cut --delimiter='/' --fields=3 | tail --lines=1)
script:
- git clone https://$BITBUCKET_USER:[email protected]/shoonyacloud/esper-sdk-config.git
- cd esper-sdk-config
- ./pull_api_spec.sh
- wget -q https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.4/swagger-codegen-cli-2.4.4.jar
- git clone https://[email protected]/esper-io/esper-client-py.git
- java -jar swagger-codegen-cli-2.4.4.jar generate -i ./esper-api-spec.yaml -l python -c ./sdk-config/python-config.json --template-dir ./sdk-templates/python/ -o esper-client-py
- cd esper-client-py
- git config --global user.email "[email protected]"
- git config --global user.name "Travis CI"
- git add .
- git status
- git diff-index --quiet HEAD || git commit -m "$COMMIT_MESSAGE"
- git push -u origin master
- git tag -a $SDK_VERSION -m "$COMMIT_MESSAGE"
- git push origin $SDK_VERSION