Skip to content

Commit

Permalink
Make travis.yml more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
rparadowski authored and rafalparadowski committed Jul 22, 2020
1 parent 72df636 commit 654ea91
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
5 changes: 2 additions & 3 deletions .cilibs/prepare_extra_directories.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash -e

echo "Prepare extra directories"
mkdir /floodgate
chmod 777 /floodgate
mkdir /floodgate/bin
mkdir -p /floodgate/bin
chmod 777 -R /floodgate
2 changes: 1 addition & 1 deletion .cilibs/setup_swagger.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash -e

export TERM=${TERM:-dumb} #Needed because sudo is used in CircleCi
GATE_API_BRANCH=$1

echo "Setup swagger-codegen"
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
command: sudo .cilibs/prepare_extra_directories.sh
- run:
name: Setup swagger
command: sudo .cilibs/setup_swagger.sh << parameters.gate_api_branch >>
command: .cilibs/setup_swagger.sh << parameters.gate_api_branch >>
- persist_to_workspace:
root: /floodgate
paths:
Expand Down
35 changes: 28 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,39 @@ dist: xenial
language: go
go:
- 1.14.1
env:
- REALESE_BRANCHES="release-v[0-9]+\.[0-9]+\.x" RELEASE_TAGS="v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?" BUILD_OS="$([ $TRAVIS_EVENT_TYPE == cron ] || [[ $TRAVIS_BRANCH =~ $RELEASE_BRANCHES ]] || [[ $TRAVIS_TAG =~ $RELEASE_TAGS ]] && echo darwin) linux" BUILD_ARCH=amd64 GATE_API_BRANCH=release-1.20.x SEND_COVERITY=send
env: |
REALESE_BRANCHES="release-v[0-9]+\.[0-9]+\.x"
RELEASE_TAGS="v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?"
BUILD_OS="$([ $TRAVIS_EVENT_TYPE == cron ] || [[ $TRAVIS_BRANCH =~ $RELEASE_BRANCHES ]] || [[ $TRAVIS_TAG =~ $RELEASE_TAGS ]] && echo darwin) linux"
BUILD_ARCH=amd64
GATE_API_BRANCH=release-1.20.x
SEND_COVERITY=send
services:
- docker

before_script:
- docker pull openjdk:11.0.3-stretch
- docker run -u root -w /workspace -v `pwd`:/workspace --entrypoint /workspace/.cilibs/generate_swagger.sh --rm openjdk:11.0.3-stretch release-1.20.x

script:
- docker pull golang:1.14.1-stretch
- for o in $BUILD_OS; do for a in $BUILD_ARCH; do docker run -e SERIESCI_TOKEN=$SERIESCI_TOKEN -e TRAVIS_COMMIT=$TRAVIS_COMMIT -u root -w /go/src/github.com/codilime/floodgate -v `pwd`:/go/src/github.com/codilime/floodgate --entrypoint /go/src/github.com/codilime/floodgate/.cilibs/build.sh --rm golang:1.14.1-stretch -g $GATE_API_BRANCH -o $o -a $a -c $SEND_COVERITY ; done; done
- sudo chown $SUDO_USER:$SUDO_USER -R .
- .cilibs/start_spinnaker.sh -a `echo $BUILD_ARCH | cut -d" " -f1` -o `echo $BUILD_OS | cut -d" " -f1` -g $GATE_API_BRANCH -e $FLOODGATE_EXTRA_PARAMS
script: |
docker pull golang:1.14.1-stretch
for o in $BUILD_OS
do
for a in $BUILD_ARCH
do
docker run -e SERIESCI_TOKEN=$SERIESCI_TOKEN \
-e TRAVIS_COMMIT=$TRAVIS_COMMIT \
-u root \
-w /go/src/github.com/codilime/floodgate \
-v `pwd`:/go/src/github.com/codilime/floodgate \
--entrypoint /go/src/github.com/codilime/floodgate/.cilibs/build.sh \
--rm golang:1.14.1-stretch \
-g $GATE_API_BRANCH -o $o -a $a -c $SEND_COVERITY
done
done
sudo chown $SUDO_USER:$SUDO_USER -R .
.cilibs/start_spinnaker.sh -a `echo $BUILD_ARCH | cut -d" " -f1` \
-o `echo $BUILD_OS | cut -d" " -f1` \
-g $GATE_API_BRANCH \
-e $FLOODGATE_EXTRA_PARAMS

0 comments on commit 654ea91

Please sign in to comment.