-
Notifications
You must be signed in to change notification settings - Fork 140
Cleanup jenkins scripts #7648
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
Cleanup jenkins scripts #7648
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| [*.sh] | ||
| indent_style = space | ||
| indent_size = 4 | ||
| shell_variant = bash | ||
| binary_next_line = false | ||
| switch_case_indent = true | ||
| space_redirects = true | ||
| keep_padding = true | ||
| function_next_line = false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Copyright 2025-Present Couchbase, Inc. | ||
| # | ||
| # Use of this software is governed by the Business Source License included | ||
| # in the file licenses/BSL-Couchbase.txt. As of the Change Date specified | ||
| # in that file, in accordance with the Business Source License, use of this | ||
| # software will be governed by the Apache License, Version 2.0, included in | ||
| # the file licenses/APL2.txt. | ||
|
|
||
| name: shell | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| # Only run when we change a shell script | ||
| paths: | ||
| - "*.sh" | ||
| branches: | ||
| - "main" | ||
| - "release/*" | ||
| - "feature/*" | ||
| - "CBG*" | ||
| - "ci-*" | ||
| pull_request: | ||
| # Only run when we change a shell script | ||
| paths: | ||
| - "*.sh" | ||
| branches: | ||
| - "main" | ||
| - "release/*" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: ${{ !contains(github.ref, 'release/')}} | ||
|
|
||
| jobs: | ||
| shellcheck: | ||
| name: Shellcheck | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: Run ShellCheck | ||
| uses: ludeeus/action-shellcheck@master | ||
| with: | ||
| ignore_paths: | | ||
| ./build.sh | ||
| ./bootstrap.sh | ||
| ./bench.sh | ||
| ./integration-test/service-test.sh | ||
| ./integration-test/service-install-tests.sh | ||
| ./rewrite-manifest.sh | ||
| ./snap-manifest.sh | ||
| ./set-version-stamp.sh | ||
| ./service/sync_gateway_service_install.sh | ||
| ./service/sync_gateway_service_uninstall.sh | ||
| ./service/sync_gateway_service_upgrade.sh | ||
| ./test-integration-init.sh | ||
| ./test.sh |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #/bin/sh | ||
| #!/bin/bash | ||
|
|
||
| # Copyright 2024-Present Couchbase, Inc. | ||
| # | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -10,32 +10,42 @@ | |||||
| DEFAULT_PACKAGE_TIMEOUT="45m" | ||||||
|
|
||||||
| set -u | ||||||
| set -e # Abort on errors | ||||||
|
|
||||||
| if [ "${1:-}" == "-m" ]; then | ||||||
| echo "Running in automated master integration mode" | ||||||
| # Set automated setting parameters | ||||||
| SG_COMMIT="master" | ||||||
| TARGET_PACKAGE="..." | ||||||
| TARGET_TEST="ALL" | ||||||
| RUN_WALRUS="true" | ||||||
| USE_GO_MODULES="true" | ||||||
| DETECT_RACES="false" | ||||||
| SG_EDITION="EE" | ||||||
| XATTRS="true" | ||||||
| RUN_COUNT="1" | ||||||
| # CBS server settings | ||||||
| COUCHBASE_SERVER_PROTOCOL="couchbase" | ||||||
| COUCHBASE_SERVER_VERSION="enterprise-7.6.6" | ||||||
| SG_TEST_BUCKET_POOL_SIZE="3" | ||||||
| SG_TEST_BUCKET_POOL_DEBUG="true" | ||||||
| export SG_TEST_BUCKET_POOL_DEBUG="true" | ||||||
| GSI="true" | ||||||
| TLS_SKIP_VERIFY="false" | ||||||
| SG_CBCOLLECT_ALWAYS="false" | ||||||
| fi | ||||||
|
|
||||||
| set -e # Abort on errors | ||||||
| set -x # Output all executed shell commands | ||||||
| REQUIRED_VARS=( | ||||||
| COUCHBASE_SERVER_PROTOCOL | ||||||
| COUCHBASE_SERVER_VERSION | ||||||
| GSI | ||||||
| TARGET_TEST | ||||||
| TARGET_PACKAGE | ||||||
| TLS_SKIP_VERIFY | ||||||
| SG_EDITION | ||||||
| ) | ||||||
|
|
||||||
| for var in "${REQUIRED_VARS[@]}"; do | ||||||
| if [ -z "${!var:-}" ]; then | ||||||
| echo "${var} environment variable is required to be set." | ||||||
| exit 1 | ||||||
| fi | ||||||
| done | ||||||
| # Use Git SSH and define private repos | ||||||
| git config --global --replace-all url."[email protected]:".insteadOf "https://github.com/" | ||||||
| export GOPRIVATE=github.com/couchbaselabs/go-fleecedelta | ||||||
|
|
@@ -44,37 +54,21 @@ export GOPRIVATE=github.com/couchbaselabs/go-fleecedelta | |||||
| SG_COMMIT_HASH=$(git rev-parse HEAD) | ||||||
| echo "Sync Gateway git commit hash: $SG_COMMIT_HASH" | ||||||
|
|
||||||
| # Use Go modules (3.1 and above) or bootstrap for legacy Sync Gateway versions (3.0 and below) | ||||||
| if [ "${USE_GO_MODULES:-}" == "false" ]; then | ||||||
| mkdir -p sgw_int_testing # Make the directory if it does not exist | ||||||
| cp bootstrap.sh sgw_int_testing/bootstrap.sh | ||||||
| cd sgw_int_testing | ||||||
| chmod +x bootstrap.sh | ||||||
| ./bootstrap.sh -c ${SG_COMMIT} -e ee | ||||||
| export GO111MODULE=off | ||||||
| go get -u -v github.com/tebeka/go2xunit | ||||||
| go get -u -v github.com/axw/gocov/gocov | ||||||
| go get -u -v github.com/AlekSi/gocov-xml | ||||||
| else | ||||||
| # Install tools to use | ||||||
| go install github.com/axw/gocov/gocov@latest | ||||||
| go install github.com/AlekSi/gocov-xml@latest | ||||||
| go install gotest.tools/gotestsum@latest | ||||||
| fi | ||||||
| echo "Downloading tool dependencies..." | ||||||
| go install github.com/axw/gocov/gocov@latest | ||||||
| go install github.com/AlekSi/gocov-xml@latest | ||||||
| go install gotest.tools/gotestsum@latest | ||||||
|
|
||||||
| if [ "${SG_TEST_X509:-}" == "true" -a "${COUCHBASE_SERVER_PROTOCOL}" != "couchbases" ]; then | ||||||
| if [ "${SG_TEST_X509:-}" == "true" ] && [ "${COUCHBASE_SERVER_PROTOCOL}" != "couchbases" ]; then | ||||||
| echo "Setting SG_TEST_X509 requires using couchbases:// protocol, aborting integration tests" | ||||||
| exit 1 | ||||||
| fi | ||||||
|
|
||||||
| # Set environment vars | ||||||
| GO_TEST_FLAGS="-v -p 1 -count=${RUN_COUNT:-1}" | ||||||
| GO_TEST_FLAGS=(-v -p 1 "-count=${RUN_COUNT:-1}") | ||||||
| INT_LOG_FILE_NAME="verbose_int" | ||||||
|
|
||||||
| if [ -d "godeps" ]; then | ||||||
| export GOPATH=$(pwd)/godeps | ||||||
| fi | ||||||
| export PATH=$PATH:$(go env GOPATH)/bin:~/go/bin | ||||||
| export PATH=$PATH:~/go/bin | ||||||
| echo "PATH: $PATH" | ||||||
|
|
||||||
| if [ "${TEST_DEBUG:-}" == "true" ]; then | ||||||
|
|
@@ -83,38 +77,38 @@ if [ "${TEST_DEBUG:-}" == "true" ]; then | |||||
| fi | ||||||
|
|
||||||
| if [ "${TARGET_TEST}" != "ALL" ]; then | ||||||
| GO_TEST_FLAGS="${GO_TEST_FLAGS} -run ${TARGET_TEST}" | ||||||
| GO_TEST_FLAGS+=(-run "${TARGET_TEST}") | ||||||
| fi | ||||||
|
|
||||||
| if [ "${PACKAGE_TIMEOUT:-}" != "" ]; then | ||||||
| GO_TEST_FLAGS="${GO_TEST_FLAGS} -test.timeout=${PACKAGE_TIMEOUT}" | ||||||
| GO_TEST_FLAGS+=(-test.timeout="${PACKAGE_TIMEOUT}") | ||||||
| else | ||||||
| echo "Defaulting package timeout to ${DEFAULT_PACKAGE_TIMEOUT}" | ||||||
| GO_TEST_FLAGS="${GO_TEST_FLAGS} -test.timeout=${DEFAULT_PACKAGE_TIMEOUT}" | ||||||
| GO_TEST_FLAGS+=(-test.timeout="${DEFAULT_PACKAGE_TIMEOUT}") | ||||||
| fi | ||||||
|
|
||||||
| if [ "${DETECT_RACES:-}" == "true" ]; then | ||||||
| GO_TEST_FLAGS="${GO_TEST_FLAGS} -race" | ||||||
| GO_TEST_FLAGS=(-race) | ||||||
|
||||||
| GO_TEST_FLAGS=(-race) | |
| GO_TEST_FLAGS+=(-race) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment was an accurate one FWIW
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why
docker exec curlhere and not on line 88?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably hit this with accidental debugging, I'd rather have it call curl from inside the container than outside given we don't know the network constraints.