-
Notifications
You must be signed in to change notification settings - Fork 9
Travis CI configuration #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rparadowski
wants to merge
18
commits into
master
Choose a base branch
from
travis
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1e82c8c
add travis configuration
rafalparadowski 12e305b
fixed volume path
rafalparadowski 03b7c23
+x permission on scripts
rafalparadowski e1370d6
execute docker as root
rafalparadowski 33c9125
Parametrize build (different workflow for cron and releases)
rafalparadowski 170cfe6
Add proper bash parameters
rafalparadowski 0fb87e6
rm swp file
rafalparadowski 7b88bff
Unified circleci and travis scripts
rafalparadowski 862b1b5
positive spiannaker test is obligatory to job success
rafalparadowski 2f7820c
commit id var can be obtained from circleCi or travis
rafalparadowski c90457d
pass TRAVIS variables to docker
rafalparadowski feca96b
merged generating swagger into one script
rparadowski 88c41c7
moved yaml files to separate directory
rparadowski 0013bef
make RELEASE and COMMIT_ID variables universal
rparadowski 72df636
added missing descriptions of executed commands
rparadowski 654ea91
Make travis.yml more readable
rparadowski b1b8281
reduce code in preparing directories
rparadowski 58bbec4
typo
rafalparadowski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| GATE_VERSION=release-1.20.x | ||
| BUILD_OS=linux | ||
| BUILD_ARCH=amd64 | ||
|
|
||
|
|
||
| while getopts "o:a:g:c:" opt; do | ||
| case ${opt} in | ||
| o) #Build OS | ||
| BUILD_OS=${OPTARG} | ||
| ;; | ||
| a) #Build arch | ||
| BUILD_ARCH=${OPTARG} | ||
| ;; | ||
| g) #Gate version | ||
| GATE_VERSION=${OPTARG} | ||
| ;; | ||
| c) #Send Coverity | ||
| SEND_COVERITY=${OPTARG} | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| .cilibs/get_dependencies.sh | ||
|
|
||
| .cilibs/examine_source_code_with_go_get.sh | ||
|
|
||
| .cilibs/execute_go_tests.sh | ||
|
|
||
| .cilibs/compile_code.sh -o ${BUILD_OS} -a ${BUILD_ARCH} -g ${GATE_VERSION} | ||
|
|
||
| .cilibs/calculate_code_coverage.sh $SEND_COVERITY | ||
|
|
||
| .cilibs/check_linting.sh | ||
|
|
||
| .cilibs/copy_binaries_for_later_use.sh | ||
|
|
||
| .cilibs/generate_checksum.sh -o ${BUILD_OS} -a ${BUILD_ARCH} -g ${GATE_VERSION} | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| SEND_COVERITY=$1 | ||
| COMMIT_ID="${CIRCLE_SHA1:-$TRAVIS_COMMIT}" | ||
|
|
||
|
|
||
| echo "Calculate code coverage" | ||
| REQUIREDCODECOVERAGE=60 | ||
| go tool cover -func cover.out | tee codecoverage.txt | ||
| CURRENTCODECOVERAGE=$(grep 'total:' codecoverage.txt | awk '{print substr($3, 1, length($3)-1)}') | ||
|
|
||
| echo "Send coverity report to SeriesCI" | ||
| if [[ $SEND_COVERITY == "send" ]] | ||
| then | ||
| curl \ | ||
| --header "Authorization: Token ${SERIESCI_TOKEN}" \ | ||
| --header "Content-Type: application/json" \ | ||
| --data "{\"value\":\"${CURRENTCODECOVERAGE} %\",\"sha\":\"${COMMIT_ID}\"}" \ | ||
| https://seriesci.com/api/codilime/floodgate/coverage/one | ||
| else | ||
| echo "Skipping" | ||
| fi | ||
| if [ ${CURRENTCODECOVERAGE%.*} -lt ${REQUIREDCODECOVERAGE} ] | ||
| then | ||
| echo "Not enough code coverage!" | ||
| echo "Current code coverage: ${CURRENTCODECOVERAGE}%" | ||
| echo "Required code coverage: ${REQUIREDCODECOVERAGE}%" | ||
| exit 1 | ||
| else | ||
| echo "Code coverage is at least ${REQUIREDCODECOVERAGE}% : OK" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| echo "Check linting" | ||
| for GOSRCFILE in $( find . -type f -name '*.go' -not -path './gateapi/*') | ||
| do | ||
| golint -set_exit_status $GOSRCFILE | ||
| done | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| GATE_VERSION=release-1.20.x | ||
| BUILD_OS=linux | ||
| BUILD_ARCH=amd64 | ||
| COMMIT_ID="${CIRCLE_SHA1:-$TRAVIS_COMMIT}" | ||
|
|
||
|
|
||
| while getopts "o:a:g:" opt; do | ||
| case ${opt} in | ||
| o) #Build OS | ||
| BUILD_OS=${OPTARG} | ||
| ;; | ||
| a) #Build arch | ||
| BUILD_ARCH=${OPTARG} | ||
| ;; | ||
| g) #Gate version | ||
| GATE_VERSION=${OPTARG} | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| if [ ! -z "$TRAVIS_BRANCH" ] | ||
| then | ||
| export RELEASE=$TRAVIS_BRANCH | ||
| elif [ -z "$CIRCLE_BRANCH" ] | ||
| then | ||
| export RELEASE=$(echo $CIRCLE_TAG | sed 's/^v[0-9]\+\.[0-9]\+\.[0-9]\+-\?//') | ||
| else | ||
| export RELEASE=$CIRCLE_BRANCH | ||
| fi | ||
|
|
||
| echo "Compile code" | ||
|
|
||
| env GOOS=${BUILD_OS} GOARCH=${BUILD_ARCH} go build -ldflags \ | ||
| "-X github.com/codilime/floodgate/version.GitCommit=$COMMIT_ID \ | ||
| -X github.com/codilime/floodgate/version.BuiltDate=$(date +%Y-%m-%d_%H:%M:%S) \ | ||
| -X github.com/codilime/floodgate/version.Release=$RELEASE \ | ||
| -X github.com/codilime/floodgate/version.GoVersion=$GOLANG_VERSION \ | ||
| -X github.com/codilime/floodgate/version.GateVersion=$(echo ${GATE_API_BRANCH} | sed 's/release-//') \ | ||
| " | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| echo "Copy binaries for later use" | ||
| mkdir -p /floodgate/bin | ||
| chmod 777 /floodgate/bin | ||
| cp /go/src/github.com/codilime/floodgate/floodgate /floodgate/bin/floodgate | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| echo "Examine source code with go vet" | ||
| go vet -v ./... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| echo "Execute go tests" | ||
| go test -v ./... -coverprofile cover.out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| GATE_API_BRANCH=release-1.20.x | ||
| BUILD_OS=linux | ||
| BUILD_ARCH=amd64 | ||
|
|
||
|
|
||
| while getopts "o:a:g:" opt; do | ||
| case ${opt} in | ||
| o) #Build OS | ||
| BUILD_OS=${OPTARG} | ||
| ;; | ||
| a) #Build arch | ||
| BUILD_ARCH=${OPTARG} | ||
| ;; | ||
| g) #Gate version | ||
| GATE_API_BRANCH=${OPTARG} | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| echo "Generate checksum" | ||
| cd /go/src/github.com/codilime/floodgate/ | ||
| cp floodgate floodgate-$GATE_API_BRANCH.$BUILD_OS.$BUILD_ARCH | ||
| sha1sum floodgate-$GATE_API_BRANCH.$BUILD_OS.$BUILD_ARCH > floodgate-$GATE_API_BRANCH.$BUILD_OS.$BUILD_ARCH.sha1sum | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| GATE_API_BRANCH=$1 | ||
|
|
||
| .cilibs/prepare_extra_directories.sh | ||
|
|
||
| .cilibs/setup_swagger.sh $GATE_API_BRANCH | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| echo "Get dependencies" | ||
| go mod download | ||
| go get -u golang.org/x/lint/golint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| GATE_API_BRANCH=$1 | ||
|
|
||
| echo Install Spinnaker and configure Floodgate | ||
| export NEED_SPINNAKER_VERSION=$( echo $GATE_API_BRANCH | egrep -o "[0-9]\.[0-9]+" ) | ||
| .cilibs/install-and-run-spinnaker.sh | ||
| until [ $( curl -w '%{http_code}' -o /dev/null http://spinnaker/api/v1 ) -eq 302 ] | ||
| do | ||
| echo "Waiting for Spinnaker" | ||
| sleep 10 | ||
| done | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-$(uname)-amd64 | ||
| chmod +x ./kind | ||
| sudo mv ./kind /usr/local/bin/ | ||
| curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl | ||
| chmod +x ./kubectl | ||
| sudo mv ./kubectl /usr/local/bin/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| BUILD_OS=linux | ||
| BUILD_ARCH=amd64 | ||
|
|
||
| sudo bash -c "source .cilibs/prepare_extra_directories.sh" | ||
| mkdir -p /floodgate/libs | ||
| mkdir -p /floodgate/resources | ||
| cp -r sponnet /floodgate/libs/ | ||
| cp -r examples /floodgate/resources/ | ||
| cp floodgate /floodgate/bin/ | ||
| chmod +x /floodgate/bin/floodgate | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| echo "Prepare extra directories" | ||
| mkdir -p /floodgate/bin | ||
| chmod 777 -R /floodgate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/bin/bash -e | ||
| export TERM=${TERM:-dumb} #Needed because sudo is used in CircleCi | ||
| GATE_API_BRANCH=$1 | ||
|
|
||
| echo "Setup swagger-codegen" | ||
| SWAGGER_VERSION=$(cat gateapi/.swagger-codegen/VERSION) | ||
| wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${SWAGGER_VERSION}/swagger-codegen-cli-${SWAGGER_VERSION}.jar -O swagger-codegen-cli.jar | ||
| wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${SWAGGER_VERSION}/swagger-codegen-cli-${SWAGGER_VERSION}.jar.sha1 -O swagger-codegen-cli.jar.sha1 | ||
| echo ' swagger-codegen-cli.jar' >> swagger-codegen-cli.jar.sha1 | ||
| sha1sum -c swagger-codegen-cli.jar.sha1 | ||
| mv swagger-codegen-cli.jar /floodgate/bin/ | ||
|
|
||
| echo "Get gate code" | ||
| git clone https://github.com/spinnaker/gate.git -b ${GATE_API_BRANCH} /floodgate/gate | ||
|
|
||
| echo "Generate swagger.json" | ||
| cd /floodgate/gate | ||
| ./gradlew clean | ||
| ./gradlew gate-web:test --tests *GenerateSwagger* --max-workers 2 | ||
| cat gate-web/swagger.json | json_pp > ./gate-swagger.json | ||
|
|
||
| echo "Generate gateapi go code" | ||
| java -jar /floodgate/bin/swagger-codegen-cli.jar generate -l go -i /floodgate/gate/gate-swagger.json -o /floodgate/gateapi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| while getopts "o:a:g:e:" opt; do | ||
| case ${opt} in | ||
| o) #Build OS | ||
| BUILD_OS=${OPTARG} | ||
| ;; | ||
| a) #Build arch | ||
| BUILD_ARCH=${OPTARG} | ||
| ;; | ||
| g) #Gate version | ||
| GATE_VERSION=${OPTARG} | ||
| ;; | ||
| e) #Floodgate extra params | ||
| FLOODGATE_EXTRA_PARAMS=${OPTARG} | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
|
|
||
| .cilibs/prepare_directories.sh | ||
|
|
||
| .cilibs/install_toolset.sh | ||
|
|
||
| .cilibs/update_hosts.sh | ||
|
|
||
| .cilibs/wait_for_dpkg.sh | ||
|
|
||
| .cilibs/install_spinnaker_and_configure_floodgate.sh $GATE_API_BRANCH | ||
|
|
||
| .cilibs/test_floodgate_against_running_spinnaker_instance.sh $FLOODGATE_EXTRA_PARAMS |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
.cilibs/test_floodgate_against_running_spinnaker_instance.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| FLOODGATE_EXTRA_PARAMS=$1 | ||
|
|
||
| echo Test Floodgate against running Spinnaker instance | ||
|
|
||
| echo "Print version using version flag" | ||
| /floodgate/bin/floodgate --version | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe you can add some info about what is happening before executing this commands?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added printing as was in .circleci/config.yml |
||
| echo "Print version using version command" | ||
| /floodgate/bin/floodgate version | ||
| echo "Comare changes - clean Spinnaker" | ||
| /floodgate/bin/floodgate $FLOODGATE_EXTRA_PARAMS --config ~/floodgate.yaml compare && exit 1 || echo "Found changes" | ||
| echo "Apply local resources" | ||
| /floodgate/bin/floodgate $FLOODGATE_EXTRA_PARAMS --config ~/floodgate.yaml sync | ||
| echo "Compare changes - synced resources" | ||
| /floodgate/bin/floodgate $FLOODGATE_EXTRA_PARAMS --config ~/floodgate.yaml compare | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.