├── .gitignore ├── README.md ├── cbdeps ├── CBDepsMacros.cmake ├── breakpad │ └── CMakeLists.txt ├── build-all-sherlock.sh ├── curl │ └── CMakeLists.txt ├── erlang │ ├── CMakeLists.txt │ ├── bash_profile │ └── erlang_windows_build.sh ├── icu4c │ └── CMakeLists.txt ├── jemalloc │ └── CMakeLists.txt ├── libevent │ └── CMakeLists.txt ├── libstdc++ │ └── CMakeLists.txt ├── snappy │ └── CMakeLists.txt ├── utils │ └── GenericCopyCMakeLists.txt.in ├── v8 │ └── CMakeLists.txt └── windows │ └── curl │ ├── CMakeLists.txt │ └── compile_curl.bat ├── docker └── buildslaves │ ├── centos-69 │ ├── sdk-nodevtoolset │ │ ├── .gitignore │ │ ├── .wgetrc │ │ ├── Dockerfile │ │ └── go │ └── sdk │ │ ├── .gitignore │ │ ├── .wgetrc │ │ ├── Dockerfile │ │ └── go │ ├── centos-70 │ └── sdk │ │ ├── .gitignore │ │ ├── Dockerfile │ │ └── go │ ├── ubuntu-14.04 │ ├── analytics │ │ ├── .gitignore │ │ ├── Dockerfile │ │ └── go │ └── sdk │ │ ├── .gitignore │ │ ├── .ssh │ │ └── known_hosts │ │ ├── Dockerfile │ │ ├── couchhook.sh │ │ └── go │ └── util │ └── couchbuilder_start.sh ├── gerrit ├── conf │ └── config ├── cron │ ├── crontab.txt │ └── restart_gerrit ├── hooks │ ├── change-abandoned │ ├── change-merged │ ├── cla-signed │ ├── patchset-created │ └── ref-updated └── review_site │ ├── bin │ ├── gerrit.sh │ └── push_all.sh │ ├── etc │ ├── gerrit.config │ ├── mail │ │ ├── Abandoned.vm.example │ │ ├── ChangeFooter.vm.example │ │ ├── ChangeSubject.vm │ │ ├── ChangeSubject.vm.example │ │ ├── ChangeSubject.vm.inprogress │ │ ├── Comment.vm.example │ │ ├── CommentFooter.vm.example │ │ ├── CommitMessageEdited.vm.example │ │ ├── Footer.vm.example │ │ ├── MergeFail.vm.example │ │ ├── Merged.vm.example │ │ ├── NewChange.vm.example │ │ ├── RebasedPatchSet.vm.example │ │ ├── RegisterNewEmail.vm.example │ │ ├── ReplacePatchSet.vm.example │ │ ├── Restored.vm.example │ │ ├── Reverted.vm.example │ │ └── junk.txt │ └── replication.config │ └── plugins │ └── same-changeid.js ├── license └── README ├── qualys ├── file_delete_scan.xml └── was-scan.py ├── scripts ├── docs │ └── client │ │ ├── build-java-docs.sh │ │ ├── build-java-unified-docs.sh │ │ ├── build-ruby-docs.sh │ │ ├── build-sdk-docs-page.pl │ │ ├── build-spy-docs.sh │ │ └── build-unified-java.sh ├── jenkins │ ├── build_trigger │ │ ├── server_buildbot_trigger.sh │ │ └── single-repo-change.py │ ├── commit_validation │ │ ├── allcommits.py │ │ ├── alldependencies.py │ │ ├── allopenparents.py │ │ ├── archive_core_files.sh │ │ ├── cbsasl │ │ │ └── cbsasl-gerrit.sh │ │ ├── checkout_dependencies.py │ │ ├── clang-LICENSE.TXT │ │ ├── clang-tidy-diff.py │ │ ├── couchbase-cli │ │ │ └── couchbase-cli-gerrit.sh │ │ ├── couchdb │ │ │ ├── couchdb-gerrit │ │ │ ├── couchdb-gerrit-views │ │ │ ├── couchdb-gerrit-views-pre-merge │ │ │ ├── couchdb-gerrit-views-pre-merge.bat │ │ │ ├── couchdb-gerrit-views.bat │ │ │ └── couchdb-gerrit.bat │ │ ├── couchdbx-app │ │ │ └── couchdbx-app-gerrit.sh │ │ ├── couchstore │ │ │ └── couchstore-gerrit.sh │ │ ├── ep-engine │ │ │ ├── ep-engine-gerrit.sh │ │ │ ├── ep-simple-test.sh │ │ │ └── ep-unit-tests.sh │ │ ├── fetch_project.bat │ │ ├── fetch_project.sh │ │ ├── geocouch │ │ │ └── geocouch-gerrit.sh │ │ ├── git-clang-format │ │ ├── github │ │ │ └── make-simple.sh │ │ ├── libmemcached │ │ │ └── libmemcached-gerrit.sh │ │ ├── libvbucket │ │ │ └── libvbucket-gerrit.sh │ │ ├── memcached │ │ │ └── memcached-gerrit.sh │ │ ├── moxi │ │ │ └── moxi-gerrit.sh │ │ ├── ns_server │ │ │ └── ns_server-gerrit.sh │ │ ├── platform │ │ │ └── platform-gerrit.sh │ │ ├── portsigar │ │ │ └── portsigar-gerrit.sh │ │ ├── remove_irrelevant_memcheck_results.py │ │ ├── single-project-cbnt │ │ ├── single-project-clang-format │ │ ├── single-project-clang-static-analyzer │ │ ├── single-project-clang-tidy │ │ ├── single-project-code-coverage │ │ ├── single-project-gerrit │ │ ├── single-project-gerrit-newpatch │ │ ├── single-project-gerrit-newpatch.bat │ │ ├── single-project-gerrit.bat │ │ ├── single-project-gerrit.sh │ │ ├── single-project-valgrind │ │ ├── testrunner │ │ │ └── testrunner-gerrit.sh │ │ └── tlm │ │ │ └── tlm-gerrit.sh │ ├── couchbase-edge-server │ │ ├── couchbase-edge-server-linux-package.sh │ │ ├── deb_templates │ │ │ ├── README.Debian.tmpl │ │ │ ├── changelog.tmpl │ │ │ ├── compat.tmpl │ │ │ ├── control.tmpl │ │ │ ├── copyright.tmpl │ │ │ ├── postinst.tmpl │ │ │ ├── preinst.tmpl │ │ │ ├── rules.tmpl │ │ │ └── watch.tmpl │ │ ├── package-deb.rb │ │ ├── package-rpm.rb │ │ ├── rpm_templates │ │ │ └── rpm.spec.tmpl │ │ └── service │ │ │ └── couchbase-edge-server.service │ ├── couchbase_server │ │ ├── download_file.py │ │ ├── run-go-tests.sh │ │ ├── server-linux-build.sh │ │ ├── server-simple-test.sh │ │ ├── server-windows-build.bat │ │ ├── server_macosx_build.sh │ │ ├── sherlock-poller.sh │ │ ├── sherlock-trigger.sh │ │ ├── update_jira_for_s3_uploads │ │ ├── watson-poller.sh │ │ └── watson-trigger.sh │ ├── groovy │ │ ├── custom-text.groovy │ │ └── email_to.groovy │ ├── lite-android │ │ ├── android-maven-verification.sh │ │ ├── lite-android-publish.sh │ │ ├── maven-publish-verification │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── hello │ │ │ │ └── HelloWorld.java │ │ └── settings.xml │ ├── lite-c │ │ ├── CMakeLists.txt │ │ ├── deb_templates │ │ │ ├── README.Debian.tmpl │ │ │ ├── changelog.tmpl │ │ │ ├── compat.tmpl │ │ │ ├── control.tmpl │ │ │ ├── copyright.tmpl │ │ │ ├── rules.tmpl │ │ │ └── watch.tmpl │ │ ├── manifest.cmake │ │ └── package-deb.rb │ ├── lite-core │ │ ├── CMakeLists.txt │ │ ├── do-android-build.sh │ │ ├── do-unix-build.sh │ │ ├── do-windows-build.bat │ │ └── manifest.cmake │ ├── lite-ios │ │ ├── carthage-publish.py │ │ ├── cocoapods-publish.py │ │ └── update-cocoapods.sh │ ├── lite-java │ │ ├── java-maven-verification.sh │ │ ├── lite-java-publish.sh │ │ ├── maven-publish-verification │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── hello │ │ │ │ └── HelloWorld.java │ │ └── settings.xml │ ├── lite-net │ │ └── do-windows-build.ps1 │ ├── merge-report.sh │ ├── mobile │ │ ├── ami │ │ │ ├── README-ENDUSER.md │ │ │ ├── README.md │ │ │ └── user-data.sh │ │ ├── build_cblite_android.sh │ │ ├── build_cblite_ios.sh │ │ ├── build_cblite_ios_liteserv.sh │ │ ├── build_cblite_java.sh │ │ ├── build_cblite_net.sh │ │ ├── build_sync_gateway__SET_param.sh │ │ ├── cbl-docs-publish.sh │ │ ├── job_configs │ │ │ ├── couchbase-lite-android-JavaScript_Listener-build.xml │ │ │ ├── couchbase-lite-android-build.xml │ │ │ ├── couchbase-lite-android-create-zip.xml │ │ │ ├── couchbase-lite-java-build.xml │ │ │ └── couchbase-lite-java-create-zip.xml │ │ ├── mobile-functional-tests-android.sh │ │ ├── mobile-functional-tests-ios.sh │ │ ├── package_cblite_net.sh │ │ ├── package_phonegap_plugin.sh │ │ ├── package_sync_gateway.sh │ │ ├── prepare_release_android.sh │ │ ├── prepare_release_ios.sh │ │ ├── prepare_release_sgw.sh │ │ ├── robots.txt │ │ ├── sgw_unix_build.sh │ │ ├── sgw_windows_build.bat │ │ ├── upload-to-maven.sh │ │ ├── upload_mobile_to_s3.sh │ │ └── zip_jars │ │ │ ├── LICENSE.TXT │ │ │ ├── assembly.xml │ │ │ ├── pom.xml │ │ │ ├── settings.xml │ │ │ └── zip_jars.sh │ ├── moxi │ │ └── moxi-linux-build.sh │ ├── query │ │ ├── build_tuqtng.sh │ │ ├── go-manifest │ │ └── go-set-versions │ ├── release │ │ ├── auto-release.sh │ │ ├── auto-staging.sh │ │ ├── auto-undo.sh │ │ ├── mobile-release.sh │ │ ├── mobile-staging.sh │ │ ├── mobile-undo.sh │ │ ├── server-release.sh │ │ ├── server-staging.sh │ │ └── server-undo.sh │ ├── reports │ │ ├── changelog-report-current-build.sh │ │ ├── changelog-report.sh │ │ ├── check-30x-branches.sh │ │ ├── coverity-scan.sh │ │ ├── gerrit-commit-check.sh │ │ ├── gerrit-github-sync-monitor.sh │ │ └── overall-commit-validation.sh │ ├── sdk │ │ ├── build_java_sdk.sh │ │ ├── launch_instances.py │ │ ├── monitor_sdk_win_instance.py │ │ ├── nunit3-xunit.xslt │ │ ├── php_unit_test.sh │ │ ├── sdk_aws_instance.py │ │ ├── setup_cluster.sh │ │ ├── setup_multi_node_cluster.sh │ │ └── start.sh │ ├── sonar │ │ ├── couchbase-lite-android.json │ │ ├── couchbase-lite-core.json │ │ ├── couchbase-lite-ios.json │ │ ├── couchbase-lite-java.json │ │ ├── couchbase-lite-net.json │ │ ├── couchbase-sdk.json │ │ ├── couchbase-server.json │ │ ├── sonar_scan.py │ │ └── sync_gateway.json │ └── system_test │ │ └── build-sanity │ │ ├── build-sanity-trigger.py │ │ ├── run_sanity.sh │ │ └── run_sanity_aws.sh ├── release │ ├── add_tag.sh │ ├── create_tarball.sh │ ├── purge_jenkins_results.sh │ ├── upload_3x.sh │ └── upload_4x.sh └── setup │ └── go │ ├── hello.go │ ├── setup_cross_compile.sh │ └── test.h ├── tools └── iOS │ └── bin │ ├── JavaScriptCore.framework │ ├── Headers │ │ ├── JSBase.h │ │ ├── JSContextRef.h │ │ ├── JSObjectRef.h │ │ ├── JSStringRef.h │ │ ├── JSStringRefCF.h │ │ ├── JSValueRef.h │ │ ├── JavaScript.h │ │ ├── JavaScriptCore.h │ │ └── WebKitAvailability.h │ ├── Info.plist │ └── JavaScriptCore │ └── README └── winbins └── gcc.exe /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.pyc 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | build 2 | ===== 3 | 4 | This repository is used to store scripts used by automation tools like Jenkins, cgi 5 | scripts for querying build history data, and tools used in the release process. It 6 | also contains copies of internal server configuration, such as for Gerrit. 7 | 8 | _Credentials for build robots and for access to resources will be kept in a separate, private repository._ 9 | 10 | ---- 11 | -------------------------------------------------------------------------------- /cbdeps/build-all-sherlock.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # 3 | # This script builds all of the dependencies in sherlock with their 4 | # "correct" versions. "unfortunately" the versions that the server 5 | # really use is stored in "tlm/deps/manifest.cmake" so it _might_ be 6 | # that the version number there differs from what's stored in this 7 | # file. 8 | # 9 | 10 | JEMALLOC_VERSION=5d9732f-cb4 11 | BREAKPAD_VERSION=1e455b5-cb5 12 | LIBEVENT_VERSION=2.0.21-cb1 13 | CURL_VERSION=7.39.0-cb1 14 | SNAPPY_VERSION=1.1.1-cb1 15 | V8_VERSION=e24973a-cb1 16 | ICU4C_VERSION=263593-cb3 17 | ERLANG_VERSION=mb11917-cb6 18 | 19 | # In order to use this script you should just create a "build" directory, 20 | # and start building the dependencies like: 21 | # 22 | # trond@ok compile> mkdir obj && cd obj 23 | # trond@ok compile/obj> ../build/cbdeps/build-all-sherlock.sh 24 | # 25 | # You should now be able to copy all of the prebuilt dependencies from 26 | # the "output" subdirectory. 27 | # 28 | # Please note that the script will only try to build dependencies that 29 | # isn't already present, so if you try to run the script twice it'll 30 | # skip everything it'll find a subdirectory for. This means that if you'd 31 | # like to build everything but jemalloc, you can just create a directory 32 | # named jemalloc before invoking the script. 33 | # 34 | 35 | export LC_ALL=C 36 | cwd=`pwd` 37 | cd `dirname $0` 38 | root=`pwd` 39 | cd $cwd 40 | platform=`uname -s` 41 | set -e 42 | 43 | mkdir -p output 44 | 45 | build() { 46 | name=$1 47 | version=$2 48 | if [ -d ${name} ] 49 | then 50 | echo "Skipping ${name} (already built)" 51 | else 52 | mkdir ${name} 53 | pushd ${name} 54 | cmake -D DEP_VERSION=${version} ${root}/${name} 55 | make 56 | cp output/${name}/${version}/${name}-*-${version}.* ../output/ 57 | popd 58 | fi 59 | } 60 | 61 | build jemalloc ${JEMALLOC_VERSION} 62 | build breakpad ${BREAKPAD_VERSION} 63 | build libevent ${LIBEVENT_VERSION} 64 | build curl ${CURL_VERSION} 65 | build snappy ${SNAPPY_VERSION} 66 | build v8 ${V8_VERSION} 67 | build icu4c ${ICU4C_VERSION} 68 | build erlang ${ERLANG_VERSION} 69 | 70 | pushd output > /dev/zero 71 | for f in *md5 72 | do 73 | echo $f | sed -e s,.md5,, | awk -F - '{ printf("DECLARE_DEP(%s VERSION %s-%s PLATFORMS %s)\n", $1, $4, $5, $2);}' 74 | done > manifest.cmake 75 | popd > /dev/zero 76 | echo "Created manifest at output/manifest.cmake" 77 | -------------------------------------------------------------------------------- /cbdeps/erlang/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Downloads the declared version of Erlang/OTP source code, builds it, 2 | # and creates a .tgz ready for uploading to our third-party deps repo. 3 | # 4 | # Resulting files (.tgz amd .md5) placed in the output/ 5 | # subdir of the Jenkins workspace. 6 | 7 | project(cb_dep_erlang NONE) 8 | 9 | CMAKE_MINIMUM_REQUIRED (VERSION 2.8) 10 | 11 | SET (DEP_NAME "erlang") 12 | 13 | get_filename_component(PARENT_DIR ${CMAKE_CURRENT_LIST_DIR} PATH) 14 | SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PARENT_DIR}) 15 | include(CBDepsMacros) 16 | 17 | include(CPack) 18 | include(ExternalProject) 19 | 20 | find_package(Git REQUIRED) 21 | 22 | ### Download, configure and build Erlang #################################### 23 | SET(ERL_CFLAGS "-fno-strict-aliasing -O3 -ggdb3 -DOPENSSL_NO_EC=1") 24 | ExternalProject_Add(erlang 25 | GIT_REPOSITORY https://github.com/couchbaselabs/otp.git 26 | GIT_TAG ${GIT_TAG} 27 | 28 | CONFIGURE_COMMAND ./otp_build autoconf 29 | COMMAND touch /lib/debugger/SKIP 30 | /lib/megaco/SKIP 31 | /lib/observer/SKIP 32 | /lib/wx/SKIP 33 | COMMAND /configure --prefix= 34 | --enable-smp-support 35 | --disable-hipe 36 | --disable-fp-exceptions 37 | CFLAGS=${ERL_CFLAGS} 38 | 39 | BUILD_IN_SOURCE 1 40 | BUILD_COMMAND make -j8 41 | 42 | INSTALL_DIR ${CMAKE_BINARY_DIR}/install 43 | INSTALL_COMMAND make install 44 | COMMAND ${CMAKE_COMMAND} -E echo "FILE(COPY bin lib DESTINATION \"\${CMAKE_INSTALL_PREFIX}\")" > /CMakeLists.txt 45 | # Invoke Erlang 'Install' to update the Erlang ROOTDIR 46 | COMMAND ${CMAKE_COMMAND} -E echo "EXECUTE_PROCESS(COMMAND \${CMAKE_INSTALL_PREFIX}/lib/erlang/Install -minimal \${CMAKE_INSTALL_PREFIX}/lib/erlang)" >> /CMakeLists.txt 47 | ) 48 | 49 | # OS X-only: Custom post-build step to set the shared library install name. 50 | #if (APPLE) 51 | #ExternalProject_Add_Step(erlang install_name 52 | # COMMAND install_name_tool -id @rpath/libjemalloc.2.dylib lib/libjemalloc.2.dylib 53 | # DEPENDEES build 54 | # DEPENDERS install 55 | # WORKING_DIRECTORY 56 | #) 57 | #endif(APPLE) 58 | 59 | # Custom packaging step to actually create a tar.gz 60 | set(OUTPUT_DIR "$ENV{WORKSPACE}/output/${DEP_NAME}/${DEP_VERSION}") 61 | set(OUTPUT_FILE "${OUTPUT_DIR}/${DEP_NAME}-${PLATFORM}-${HOST_ARCH}-${DEP_VERSION}") 62 | 63 | ExternalProject_Add_Step(erlang package 64 | COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTPUT_DIR} 65 | COMMAND ${CMAKE_COMMAND} -E tar czf ${OUTPUT_FILE}.tgz . 66 | DEPENDEES install 67 | WORKING_DIRECTORY 68 | ) 69 | 70 | _GENERATE_MD5_FILE(${OUTPUT_FILE}.tgz ${OUTPUT_FILE}.md5) 71 | -------------------------------------------------------------------------------- /cbdeps/erlang/erlang_windows_build.sh: -------------------------------------------------------------------------------- 1 | echo start build at `date` 2 | 3 | thisdir=`pwd` 4 | version="5.10.4.0.0.1" 5 | release="R16B03-1" 6 | 7 | ## get the source code 8 | git clone https://github.com/couchbasedeps/erlang otp_src_${release} 9 | cd otp_src_${release} 10 | git checkout couchbase-watson 11 | 12 | ## per instructions, get tcl from erlang website 13 | ## without this the build will fail 14 | ## (alternative is to create a lib/gs/SKIP file) 15 | wget http://www.erlang.org/download/tcltk85_win32_bin.tar.gz 16 | gunzip tcltk85_win32_bin.tar.gz 17 | tar xf tcltk85_win32_bin.tar 18 | 19 | ## build the source, as per instructions 20 | eval `./otp_build env_win32 x64` 21 | ./otp_build autoconf > autoconf.out 2>&1 22 | ./otp_build configure > configure.out 2>&1 23 | ./otp_build boot -a > boot.out 2>&1 24 | ./otp_build release -a > release.out 2>&1 25 | ./otp_build debuginfo_win32 -a > dbginfo.out 2>&1 26 | 27 | ## what the "release -a" command generates above in release/win32 28 | ## is not ## what is packaged in the installer executable. 29 | ## the installer executable also has other files like 30 | ## lib, bin -- some of which are partly also in the release/win32 31 | ## folder but there are some extra files 32 | ## so, generate an installer and use that to install it to default 33 | ## location 34 | ./otp_build installer_win32 > installerwin32.out 2>&1 35 | ./release/win32/otp_win64_${release}.exe /S 36 | 37 | installdir=/cygdrive/c/Program\ Files/erl${version} 38 | 39 | ## we need VERSION.txt, erl.in.ini and CMakeLists.txt for our internal 40 | ## cbdeps consumption. We could check the files in with placeholder 41 | ## tokens for version. But I am just generating them here dynamically 42 | ## because they are tiny files 43 | echo $release > VERSION.txt 44 | echo "[erlang] 45 | Bindir=\${CMAKE_INSTALL_PREFIX}/erts-${version}/bin 46 | Progname=erl 47 | Rootdir=\${CMAKE_INSTALL_PREFIX} 48 | " > erl.ini.in 49 | 50 | echo "# Just copy contents to CMAKE_INSTALL_PREFIX 51 | FILE (COPY bin erts-${version} lib releases usr DESTINATION \"\${CMAKE_INSTALL_PREFIX}\") 52 | 53 | # And install erl.ini with correct paths 54 | CONFIGURE_FILE(\${CMAKE_CURRENT_SOURCE_DIR}/erl.ini.in \${CMAKE_INSTALL_PREFIX}/bin/erl.ini) 55 | " > CMakeLists.txt 56 | 57 | ## tar 'em up 58 | cp VERSION.txt erl.ini.in CMakeLists.txt "${installdir}" 59 | cd "${installdir}" 60 | tar zcf ${thisdir}/erlang-windows_msvc-amd64-${release}-cb2.tgz * --exclude="Install.exe" --exclude="Install.ini" --exclude="Uninstall.exe" 61 | rm -f VERSION.txt erl.ini.in CMakeLists.txt 62 | 63 | ## uninstall the erlang installation 64 | "${installdir}/Uninstall.exe" /S 65 | 66 | echo end build at `date` 67 | -------------------------------------------------------------------------------- /cbdeps/jemalloc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Downloads the declared version of jemalloc source code, builds it, 2 | # and creates a .tgz ready for uploading to our third-party deps repo. 3 | # 4 | # Resulting files (.tgz amd .md5) placed in the output/ 5 | # subdir of the Jenkins workspace. 6 | 7 | project(cb_dep_jemalloc NONE) 8 | 9 | CMAKE_MINIMUM_REQUIRED (VERSION 2.8) 10 | 11 | SET (DEP_NAME "jemalloc") 12 | 13 | get_filename_component(PARENT_DIR ${CMAKE_CURRENT_LIST_DIR} PATH) 14 | SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PARENT_DIR}) 15 | include(CBDepsMacros) 16 | 17 | include(CPack) 18 | include(ExternalProject) 19 | 20 | find_package(Git REQUIRED) 21 | 22 | if (${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") 23 | set(EXTRA_CONFIGURE_OPTIONS "--disable-tls") 24 | endif(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") 25 | 26 | ### Download, configure and build jemalloc #################################### 27 | ExternalProject_Add(jemalloc 28 | GIT_REPOSITORY https://github.com/jemalloc/jemalloc.git 29 | GIT_TAG ${GIT_TAG} 30 | 31 | CONFIGURE_COMMAND autoconf /configure.ac > /configure 32 | COMMAND chmod u+x /configure 33 | COMMAND /configure --prefix= --with-jemalloc-prefix=je_ 34 | ${EXTRA_CONFIGURE_OPTIONS} 35 | 36 | # Build in source so jemalloc correctly detects it git version. 37 | BUILD_IN_SOURCE 1 38 | BUILD_COMMAND make build_lib_shared 39 | 40 | INSTALL_DIR ${CMAKE_BINARY_DIR}/install 41 | INSTALL_COMMAND make install_lib_shared install_include 42 | COMMAND ${CMAKE_COMMAND} -E echo FILE "(COPY lib include DESTINATION \"\${CMAKE_INSTALL_PREFIX}\")" > /CMakeLists.txt 43 | ) 44 | 45 | # OS X-only: Custom post-build step to set the shared library install name. 46 | if (APPLE) 47 | ExternalProject_Add_Step(jemalloc install_name 48 | COMMAND install_name_tool -id @rpath/libjemalloc.2.dylib lib/libjemalloc.2.dylib 49 | DEPENDEES build 50 | DEPENDERS install 51 | WORKING_DIRECTORY 52 | ) 53 | endif(APPLE) 54 | 55 | # Custom packaging step to actually create a tar.gz 56 | set(OUTPUT_DIR "$ENV{WORKSPACE}/output/${DEP_NAME}/${DEP_VERSION}") 57 | set(OUTPUT_FILE "${OUTPUT_DIR}/${DEP_NAME}-${PLATFORM}-${HOST_ARCH}-${DEP_VERSION}") 58 | 59 | ExternalProject_Add_Step(jemalloc package 60 | COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTPUT_DIR} 61 | COMMAND ${CMAKE_COMMAND} -E tar czf ${OUTPUT_FILE}.tgz . 62 | DEPENDEES install 63 | WORKING_DIRECTORY 64 | ) 65 | 66 | _GENERATE_MD5_FILE(${OUTPUT_FILE}.tgz ${OUTPUT_FILE}.md5) 67 | -------------------------------------------------------------------------------- /cbdeps/libstdc++/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copies the libstdc++ from the host system into a tgz ready for uploading to 2 | # our third-party deps repo. 3 | # 4 | # Resulting files (.tgz amd /lib && cp /libstdc++.so.6 /lib/ 31 | COMMAND ${CMAKE_COMMAND} -E echo FILE "(COPY lib DESTINATION \"\${CMAKE_INSTALL_PREFIX}\")" > /CMakeLists.txt 32 | ) 33 | 34 | # Custom packaging step to actually create a tar.gz 35 | set(OUTPUT_DIR "$ENV{WORKSPACE}/output/${DEP_NAME}/${DEP_VERSION}") 36 | set(OUTPUT_FILE "${OUTPUT_DIR}/${DEP_NAME}-${PLATFORM}-${HOST_ARCH}-${DEP_VERSION}") 37 | 38 | ExternalProject_Add_Step(libstdcxx package 39 | COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTPUT_DIR} 40 | COMMAND ${CMAKE_COMMAND} -E tar czf ${OUTPUT_FILE}.tgz lib CMakeLists.txt 41 | DEPENDEES install 42 | WORKING_DIRECTORY 43 | ) 44 | 45 | _GENERATE_MD5_FILE(${OUTPUT_FILE}.tgz ${OUTPUT_FILE}.md5) 46 | -------------------------------------------------------------------------------- /cbdeps/snappy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Downloads the declared version of libsnappy source code, builds it, 2 | # and creates a .tgz ready for uploading to our third-party deps repo. 3 | # 4 | # Resulting files (.tgz amd .md5) placed in the output/ 5 | # subdir of the Jenkins workspace. 6 | 7 | project(cb_dep_snappy NONE) 8 | 9 | CMAKE_MINIMUM_REQUIRED (VERSION 2.8) 10 | 11 | SET (DEP_NAME "snappy") 12 | 13 | get_filename_component(PARENT_DIR ${CMAKE_CURRENT_LIST_DIR} PATH) 14 | SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PARENT_DIR}) 15 | include(CBDepsMacros) 16 | 17 | include(CPack) 18 | include(ExternalProject) 19 | 20 | ### Download, configure and build snappy #################################### 21 | ExternalProject_Add(snappy 22 | URL https://snappy.googlecode.com/files/snappy-${GIT_TAG}.tar.gz 23 | 24 | CONFIGURE_COMMAND /configure --prefix= 25 | --enable-shared 26 | --disable-static 27 | --disable-dependency-tracking 28 | --disable-gtest 29 | 30 | BUILD_COMMAND make all 31 | 32 | INSTALL_DIR ${CMAKE_BINARY_DIR}/install 33 | INSTALL_COMMAND make install 34 | COMMAND rm -r /share 35 | COMMAND rm /lib/libsnappy.la 36 | 37 | COMMAND ${CMAKE_COMMAND} -E echo FILE "(COPY lib include DESTINATION \"\${CMAKE_INSTALL_PREFIX}\")" > /CMakeLists.txt 38 | ) 39 | 40 | # OS X-only: Custom post-build step to set the shared library install name. 41 | if (APPLE) 42 | ExternalProject_Add_Step(snappy install_name 43 | COMMAND install_name_tool -id @rpath/libsnappy.1.dylib /.libs/libsnappy.1.dylib 44 | DEPENDEES build 45 | DEPENDERS install 46 | WORKING_DIRECTORY 47 | ) 48 | endif(APPLE) 49 | 50 | # Custom packaging step to actually create a tar.gz 51 | set(OUTPUT_DIR "$ENV{WORKSPACE}/output/${DEP_NAME}/${DEP_VERSION}") 52 | set(OUTPUT_FILE "${OUTPUT_DIR}/${DEP_NAME}-${PLATFORM}-${HOST_ARCH}-${DEP_VERSION}") 53 | 54 | ExternalProject_Add_Step(snappy package 55 | COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTPUT_DIR} 56 | COMMAND ${CMAKE_COMMAND} -E tar czf ${OUTPUT_FILE}.tgz . 57 | DEPENDEES install 58 | WORKING_DIRECTORY 59 | ) 60 | 61 | _GENERATE_MD5_FILE(${OUTPUT_FILE}.tgz ${OUTPUT_FILE}.md5) 62 | -------------------------------------------------------------------------------- /cbdeps/utils/GenericCopyCMakeLists.txt.in: -------------------------------------------------------------------------------- 1 | # Just copy contents to CMAKE_INSTALL_PREFIX 2 | FILE (COPY bin lib include DESTINATION "${CMAKE_INSTALL_PREFIX}") 3 | -------------------------------------------------------------------------------- /cbdeps/v8/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Downloads the declared version of v8 source code, builds it, 2 | # and creates a .tgz ready for uploading to our third-party deps repo. 3 | # 4 | # Resulting files (.tgz amd .md5) placed in the output/ 5 | # subdir of the Jenkins workspace. 6 | 7 | project(cb_dep_v8 NONE) 8 | 9 | CMAKE_MINIMUM_REQUIRED (VERSION 2.8) 10 | 11 | SET (DEP_NAME "v8") 12 | 13 | get_filename_component(PARENT_DIR ${CMAKE_CURRENT_LIST_DIR} PATH) 14 | SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PARENT_DIR}) 15 | include(CBDepsMacros) 16 | 17 | include(CPack) 18 | include(ExternalProject) 19 | 20 | find_package(Git REQUIRED) 21 | 22 | 23 | ### Download, configure and build v8 #################################### 24 | 25 | if (APPLE) 26 | SET(LIBRARY_FILES "/out/x64.release/libv8.dylib") 27 | else (APPLE) 28 | SET(LIBRARY_FILES "/out/x64.release/lib.target/libv8.so") 29 | endif (APPLE) 30 | 31 | ExternalProject_Add(v8 32 | GIT_REPOSITORY https://github.com/trondn/v8.git 33 | GIT_TAG ${GIT_TAG} 34 | 35 | CONFIGURE_COMMAND make dependencies 36 | 37 | BUILD_IN_SOURCE 1 38 | BUILD_COMMAND make -j 8 library=shared x64 39 | 40 | INSTALL_DIR ${CMAKE_BINARY_DIR}/install 41 | 42 | INSTALL_COMMAND mkdir -p /lib /include 43 | COMMAND cp ${LIBRARY_FILES} /lib 44 | COMMAND cp /include/v8-debug.h /include 45 | COMMAND cp /include/v8-preparser.h /include 46 | COMMAND cp /include/v8-profiler.h /include 47 | COMMAND cp /include/v8-testing.h /include 48 | COMMAND cp /include/v8.h /include 49 | COMMAND cp /include/v8config.h /include 50 | COMMAND cp /include/v8stdint.h /include 51 | COMMAND ${CMAKE_COMMAND} -E echo FILE "(COPY lib include DESTINATION \"\${CMAKE_INSTALL_PREFIX}\")" > /CMakeLists.txt 52 | ) 53 | 54 | # OS X-only: Custom post-build step to set the shared library install name. 55 | if (APPLE) 56 | ExternalProject_Add_Step(v8 install_name 57 | COMMAND install_name_tool -id @rpath/libv8.dylib out/x64.release/libv8.dylib 58 | DEPENDEES build 59 | DEPENDERS install 60 | WORKING_DIRECTORY 61 | ) 62 | endif(APPLE) 63 | 64 | # Custom packaging step to actually create a tar.gz 65 | set(OUTPUT_DIR "$ENV{WORKSPACE}/output/${DEP_NAME}/${DEP_VERSION}") 66 | set(OUTPUT_FILE "${OUTPUT_DIR}/${DEP_NAME}-${PLATFORM}-${HOST_ARCH}-${DEP_VERSION}") 67 | 68 | ExternalProject_Add_Step(v8 package 69 | COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTPUT_DIR} 70 | COMMAND ${CMAKE_COMMAND} -E tar czf ${OUTPUT_FILE}.tgz . 71 | DEPENDEES install 72 | WORKING_DIRECTORY 73 | ) 74 | 75 | _GENERATE_MD5_FILE(${OUTPUT_FILE}.tgz ${OUTPUT_FILE}.md5) 76 | -------------------------------------------------------------------------------- /cbdeps/windows/curl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Downloads the declared version of libcurl source code, builds it, 2 | # and creates a .tgz ready for uploading to our third-party deps repo. 3 | 4 | PROJECT (cb_dep_curl_windows NONE) 5 | 6 | CMAKE_MINIMUM_REQUIRED (VERSION 2.8) 7 | 8 | SET (_curlfile "curl-${DEP_VERSION}.zip") 9 | MESSAGE (STATUS "Downloading ${_curlfile}...") 10 | FILE (DOWNLOAD "http://curl.haxx.se/download/${_curlfile}" 11 | "${CMAKE_BINARY_DIR}/${_curlfile}" STATUS _stat SHOW_PROGRESS) 12 | LIST (GET _stat 0 _retval) 13 | IF (_retval) 14 | LIST (GET _stat 1 _message) 15 | MESSAGE (FATAL_ERROR "Error downloading: ${_message}") 16 | ENDIF (_retval) 17 | SET (_explodedir "${CMAKE_BINARY_DIR}/curl.exploded") 18 | FILE (MAKE_DIRECTORY "${_explodedir}") 19 | 20 | # Yes, "cmake -E tar" handles zipfiles. 21 | EXECUTE_PROCESS (COMMAND "${CMAKE_COMMAND}" -E 22 | tar xf "${CMAKE_BINARY_DIR}/${_curlfile}" 23 | WORKING_DIRECTORY "${_explodedir}") 24 | 25 | # Defer to .bat script to invoke MSVC 26 | # QQQ hard-coding amd64 for the moment 27 | EXECUTE_PROCESS ( 28 | COMMAND "${CMAKE_SOURCE_DIR}/compile_curl.bat" AMD64 29 | WORKING_DIRECTORY "${_explodedir}/curl-${DEP_VERSION}/winbuild" 30 | RESULT_VARIABLE _retval) 31 | MESSAGE (STATUS "Complete with ${_retval}") 32 | 33 | # Here's where the results are! 34 | SET (_resultdir 35 | "${_explodedir}/curl-${DEP_VERSION}/builds/libcurl-vc-x64-release-dll-ipv6-sspi-spnego-winssl") 36 | # Add the generic CMakeLists.txt 37 | CONFIGURE_FILE ("${CMAKE_SOURCE_DIR}/../../utils/GenericCopyCMakeLists.txt.in" 38 | "${_resultdir}/CMakeLists.txt" COPY_ONLY) 39 | 40 | # tgz up the results 41 | SET (_outputdir "$ENV{WORKSPACE}/output/${DEP_NAME}/${DEP_VERSION}") 42 | # QQQ again hard-coded AMD64 43 | SET (_outputfile "${_outputdir}/${DEP_NAME}-windows-AMD64-${DEP_VERSION}") 44 | FILE (MAKE_DIRECTORY "${_outputdir}") 45 | EXECUTE_PROCESS (COMMAND "${CMAKE_COMMAND}" -E 46 | tar cvf "${_outputfile}.tgz" 47 | WORKING_DIRECTORY "${_resultdir}") 48 | FILE (MD5 "${_outputfile}.tgz" _md5) 49 | FILE (WRITE "${_outputfile}.md5" ${_md5}) 50 | -------------------------------------------------------------------------------- /cbdeps/windows/curl/compile_curl.bat: -------------------------------------------------------------------------------- 1 | rem Parameters 2 | set target_arch=%1 3 | 4 | if "%target_arch%" == "AMD64" goto setup_amd64 5 | if "%target_arch%" == "x86" goto setup_x86 6 | 7 | :setup_x86 8 | echo Setting up Visual Studio environment for x86 9 | call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 10 | set machine=x64 11 | goto build_curl 12 | 13 | :setup_amd64 14 | echo Setting up Visual Studio environment for amd64 15 | call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64 16 | set machine=x64 17 | goto build_curl 18 | 19 | :build_curl 20 | nmake /f Makefile.vc mode=dll MACHINE=%machine% DEBUG=no 21 | -------------------------------------------------------------------------------- /docker/buildslaves/centos-69/sdk-nodevtoolset/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | 3 | -------------------------------------------------------------------------------- /docker/buildslaves/centos-69/sdk-nodevtoolset/.wgetrc: -------------------------------------------------------------------------------- 1 | check_certificate=off 2 | -------------------------------------------------------------------------------- /docker/buildslaves/centos-69/sdk-nodevtoolset/Dockerfile: -------------------------------------------------------------------------------- 1 | # Docker container for Centos 6.5 2 | 3 | FROM centos:6.9 4 | MAINTAINER build-team@couchbase.com 5 | 6 | USER root 7 | RUN yum install -y openssh-server sudo && yum clean packages 8 | RUN yum install --setopt=keepcache=0 -y ed \ 9 | glibc.i686 \ 10 | make \ 11 | man \ 12 | ncurses-devel \ 13 | numactl-devel \ 14 | openssh-clients openssl-devel \ 15 | python-devel \ 16 | redhat-lsb-core \ 17 | rpm-build \ 18 | ruby rubygems rubygem-rake \ 19 | tar \ 20 | unzip \ 21 | which \ 22 | wget 23 | 24 | RUN yum groupinstall -y "Development Tools" 25 | RUN yum install -y libevent-devel openssl-devel 26 | RUN yum install -y glibc-devel.i686 glibc-devel libstdc++-devel.i686 27 | RUN yum install -y git 28 | 29 | # * CMake (from cmake.org) 30 | RUN mkdir /tmp/deploy && \ 31 | curl https://cmake.org/files/v2.8/cmake-2.8.12.2-Linux-i386.sh -o /tmp/deploy/cmake.sh && \ 32 | (echo y; echo n) | sh /tmp/deploy/cmake.sh --prefix=/usr/local && \ 33 | rm -fr /tmp/deploy 34 | 35 | 36 | # Set up for SSH daemon 37 | RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config && \ 38 | sed -ri 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config && \ 39 | /etc/init.d/sshd start 40 | 41 | # Create couchbase user with password-less sudo privs, and give 42 | # ownership of /opt/couchbase 43 | RUN groupadd -g1000 couchbase && \ 44 | useradd couchbase -g couchbase -u1000 -G wheel -m -s /bin/bash && \ 45 | mkdir /opt/couchbase && chown -R couchbase:couchbase /opt/couchbase && \ 46 | echo 'couchbase:couchbase' | chpasswd && \ 47 | echo '%wheel ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/wheel_group && \ 48 | echo 'Defaults:%wheel !requiretty' >> /etc/sudoers.d/wheel_group && \ 49 | chmod 440 /etc/sudoers.d/wheel_group 50 | 51 | # JDK for Jenkins. 52 | RUN yum -y install java-1.8.0-openjdk && yum clean packages 53 | 54 | # pip/paramiko/boto3 55 | RUN rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm && \ 56 | yum install -y python-pip libffi-devel && \ 57 | pip install -U setuptools==33.1.1 && \ 58 | pip install PyNaCl==1.1.2 && \ 59 | pip install paramiko && \ 60 | pip install boto3 61 | 62 | # Expose SSH daemon and run our builder startup script 63 | EXPOSE 22 64 | ADD .wgetrc /home/couchbase/.wgetrc 65 | COPY build/couchbuilder_start.sh /usr/sbin/ 66 | ENTRYPOINT [ "/usr/sbin/couchbuilder_start.sh" ] 67 | CMD [ "default" ] 68 | -------------------------------------------------------------------------------- /docker/buildslaves/centos-69/sdk-nodevtoolset/go: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Bump this when rebuilding with changes 4 | TAG=20180809 5 | 6 | IMAGE=couchbase/centos-69-sdk-nodevtoolset-build 7 | 8 | mkdir -p build 9 | cp -a ../../util/couchbuilder_start.sh build 10 | docker build -t ${IMAGE}:$TAG . 11 | docker tag ${IMAGE}:$TAG ${IMAGE}:latest 12 | if [ "$1" = "--publish" ] 13 | then 14 | docker push ${IMAGE}:$TAG 15 | docker push ${IMAGE}:latest 16 | fi 17 | -------------------------------------------------------------------------------- /docker/buildslaves/centos-69/sdk/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | 3 | -------------------------------------------------------------------------------- /docker/buildslaves/centos-69/sdk/.wgetrc: -------------------------------------------------------------------------------- 1 | check_certificate=off 2 | -------------------------------------------------------------------------------- /docker/buildslaves/centos-69/sdk/go: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Bump this when rebuilding with changes 4 | TAG=20180806 5 | 6 | mkdir -p build 7 | cp -a ../../util/couchbuilder_start.sh build 8 | docker build -t couchbase/centos-69-sdk-build:$TAG . 9 | docker tag couchbase/centos-69-sdk-build:$TAG couchbase/centos-69-sdk-build:latest 10 | if [ "$1" = "--publish" ] 11 | then 12 | docker push couchbase/centos-69-sdk-build:$TAG 13 | docker push couchbase/centos-69-sdk-build:latest 14 | fi 15 | -------------------------------------------------------------------------------- /docker/buildslaves/centos-70/sdk/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | 3 | -------------------------------------------------------------------------------- /docker/buildslaves/centos-70/sdk/go: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | # Bump this when rebuilding with changes 4 | TAG=20180808 5 | 6 | mkdir -p build 7 | cp -a ../../util/couchbuilder_start.sh build 8 | docker build -t couchbase/centos-70-sdk-build:$TAG . 9 | docker tag couchbase/centos-70-sdk-build:$TAG couchbase/centos-70-sdk-build:latest 10 | if [ "$1" = "--publish" ] 11 | then 12 | docker push couchbase/centos-70-sdk-build:$TAG 13 | docker push couchbase/centos-70-sdk-build:latest 14 | fi 15 | -------------------------------------------------------------------------------- /docker/buildslaves/ubuntu-14.04/analytics/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | 3 | -------------------------------------------------------------------------------- /docker/buildslaves/ubuntu-14.04/analytics/Dockerfile: -------------------------------------------------------------------------------- 1 | # Docker container for Ubuntu 14.04 Couchbase Analytics build 2 | 3 | # See https://github.com/ceejatec/naked-docker/ for details about the 4 | # construction of the base image. 5 | 6 | FROM ceejatec/naked-ubuntu:14.04 7 | MAINTAINER ceej@couchbase.com 8 | 9 | USER root 10 | 11 | # Install SSH server (required to serve as Jenkins slave). 12 | RUN apt-get update && \ 13 | apt-get install -y openssh-server curl && \ 14 | rm -f /var/cache/apt/archives/*.deb && \ 15 | mkdir /var/run/sshd # update 2 16 | 17 | # Create couchbase user with password-less sudo privs 18 | RUN useradd couchbase -G sudo -m -s /bin/bash && \ 19 | echo 'couchbase:couchbase' | chpasswd && \ 20 | sed -ri 's/ALL\) ALL/ALL) NOPASSWD:ALL/' /etc/sudoers 21 | 22 | # Oracle JDK. 23 | RUN mkdir /tmp/deploy && \ 24 | cd /tmp/deploy && \ 25 | curl -L --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \ 26 | http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.tar.gz -o jdk.tgz && \ 27 | cd /usr/local && \ 28 | tar xvzf /tmp/deploy/jdk.tgz && \ 29 | ln -s jdk* java && \ 30 | for file in /usr/local/java/bin/*; do ln -s $file /usr/local/bin; done && \ 31 | rm -rf /tmp/deploy 32 | ENV JAVA_HOME=/usr/local/java 33 | 34 | # Maven. 35 | RUN mkdir /tmp/deploy && \ 36 | cd /tmp/deploy && \ 37 | curl -L http://mirror.cogentco.com/pub/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz \ 38 | -o maven.tar.gz && \ 39 | cd /usr/local && \ 40 | tar xzf /tmp/deploy/maven.tar.gz && \ 41 | ln -s /usr/local/apache-maven-3.3.9/bin/mvn /usr/local/bin/mvn && \ 42 | rm -rf /tmp/deploy 43 | 44 | # CMake (for cbq). 45 | RUN mkdir /tmp/deploy && \ 46 | curl https://cmake.org/files/v3.6/cmake-3.6.1-Linux-x86_64.sh -o /tmp/deploy/cmake.sh && \ 47 | (echo y ; echo n) | sh /tmp/deploy/cmake.sh --prefix=/usr/local && \ 48 | rm -rf /tmp/deploy 49 | 50 | # C build essentials (required by C callouts from CBQ Go code). 51 | RUN apt-get update && \ 52 | apt-get install -y make gcc && \ 53 | rm -f /var/cache/apt/archives/*.deb 54 | 55 | # Expose SSH daemon and run our builder startup script 56 | EXPOSE 22 57 | RUN mkdir /home/couchbase/.ssh && chown couchbase:couchbase /home/couchbase/.ssh 58 | COPY build/couchbuilder_start.sh /usr/sbin/ 59 | ENTRYPOINT [ "/usr/sbin/couchbuilder_start.sh" ] 60 | CMD [ "default" ] 61 | 62 | -------------------------------------------------------------------------------- /docker/buildslaves/ubuntu-14.04/analytics/go: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Bump this when rebuilding with changes 4 | TAG=20160901 5 | 6 | mkdir -p build 7 | cp -a ../../util/couchbuilder_start.sh build 8 | docker build -t ceejatec/ubuntu-1404-analytics-build:$TAG . 9 | docker tag ceejatec/ubuntu-1404-analytics-build:$TAG ceejatec/ubuntu-1404-analytics-build:latest 10 | if [ "$1" = "--publish" ] 11 | then 12 | docker push ceejatec/ubuntu-1404-analytics-build:$TAG 13 | docker push ceejatec/ubuntu-1404-analytics-build:latest 14 | fi 15 | 16 | -------------------------------------------------------------------------------- /docker/buildslaves/ubuntu-14.04/sdk/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | 3 | -------------------------------------------------------------------------------- /docker/buildslaves/ubuntu-14.04/sdk/.ssh/known_hosts: -------------------------------------------------------------------------------- 1 | github.com,192.30.252.129 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== 2 | |1|zBhvuLl2kxjo3W6phpAsuIMlHzY=|JcRNV7zqOxPP3pOYbU6TLwyVTwM= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2nZIYj7osVcfdmfi5ynCkb55Q/IWDua58Tp0iKTBKBHwsWhnTn7YfuXzxE6AaPAXm3jZzlqoNUVA0wsrXk02QbQBYnv3FlqanCnZTYE8JwslHgNLCJ+mNsWiMHy2Dkm/zo3kIVEaDDTjd/8deRwgOL03OlWCtHWLu3mr7umAtBDSeshdxPdlNiHkJOhc0O9t/Sr12Z524N7SRfsf6LV2ZIL+hxFB86MDpZfpuf9/0ZvyQKhXzGyTcsP0P6P0HQKDjeGsrGaWgNjG0LhiMa7WrUSu4vD6aR4SmrS6REwJxE5IOobFCeM65X/9SzVO8i2URtuQ9rOq4LJV8HA7rNo6EQ== 3 | |1|VqP7za5t/lJuGUrXkyfmlB8MxGU=|BYXI7bpo07BGpzXua70JnVDbc4I= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2nZIYj7osVcfdmfi5ynCkb55Q/IWDua58Tp0iKTBKBHwsWhnTn7YfuXzxE6AaPAXm3jZzlqoNUVA0wsrXk02QbQBYnv3FlqanCnZTYE8JwslHgNLCJ+mNsWiMHy2Dkm/zo3kIVEaDDTjd/8deRwgOL03OlWCtHWLu3mr7umAtBDSeshdxPdlNiHkJOhc0O9t/Sr12Z524N7SRfsf6LV2ZIL+hxFB86MDpZfpuf9/0ZvyQKhXzGyTcsP0P6P0HQKDjeGsrGaWgNjG0LhiMa7WrUSu4vD6aR4SmrS6REwJxE5IOobFCeM65X/9SzVO8i2URtuQ9rOq4LJV8HA7rNo6EQ== 4 | -------------------------------------------------------------------------------- /docker/buildslaves/ubuntu-14.04/sdk/couchhook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Enable the live s3cfg 4 | cp -a /home/couchbase/.ssh/live.s3cfg /home/couchbase/.s3cfg 5 | 6 | -------------------------------------------------------------------------------- /docker/buildslaves/ubuntu-14.04/sdk/go: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Bump this when rebuilding with changes 4 | TAG=20180806 5 | 6 | mkdir -p build 7 | cp -a ../../util/couchbuilder_start.sh build 8 | docker build -t couchbase/ubuntu-1404-sdk-build:$TAG . 9 | docker tag couchbase/ubuntu-1404-sdk-build:$TAG couchbase/ubuntu-1404-sdk-build:latest 10 | if [ "$1" = "--publish" ] 11 | then 12 | docker push couchbase/ubuntu-1404-sdk-build:$TAG 13 | docker push couchbase/ubuntu-1404-sdk-build:latest 14 | fi 15 | 16 | -------------------------------------------------------------------------------- /docker/buildslaves/util/couchbuilder_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Script intended to be ENTRYPOINT for Couchbase build containers 4 | 5 | # First, copy any files in /ssh to /home/couchbase/.ssh, changing ownership to 6 | # user couchbase and maintaining permissions 7 | if [ -d /ssh ] && [ "$(ls -A /ssh)" ] 8 | then 9 | cp -a /ssh/* /home/couchbase/.ssh 10 | fi 11 | chown -R couchbase:couchbase /home/couchbase/.ssh 12 | chmod 600 /home/couchbase/.ssh/* 13 | 14 | # Hook for build image-specific steps 15 | if [[ -e /usr/sbin/couchhook.sh ]] 16 | then 17 | /usr/sbin/couchhook.sh 18 | fi 19 | 20 | # Start sshd (as new, long-running, foreground process) 21 | [[ "$1" == "default" ]] && { 22 | exec /usr/sbin/sshd -D 23 | } 24 | 25 | exec "$@" 26 | 27 | -------------------------------------------------------------------------------- /gerrit/conf/config: -------------------------------------------------------------------------------- 1 | Host localhost 2 | IdentityFile ~/review_site/etc/ssh_host_rsa_key 3 | -------------------------------------------------------------------------------- /gerrit/cron/crontab.txt: -------------------------------------------------------------------------------- 1 | # m h dom mon dow command 2 | 0 0 * * 6 /etc/cron.weekly/restart_gerrit 3 | @reboot nohup svscan $HOME/service & 4 | -------------------------------------------------------------------------------- /gerrit/cron/restart_gerrit: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | GERRIT_PID=`ps -aef | grep GerritCodeReview | grep -v grep | awk '{print $2}'` 4 | 5 | kill -9 $GERRIT_PID 6 | -------------------------------------------------------------------------------- /gerrit/hooks/change-abandoned: -------------------------------------------------------------------------------- 1 | curl "http://52.202.15.20:4455/gerrit?change-abandoned" 2 | 3 | -------------------------------------------------------------------------------- /gerrit/hooks/cla-signed: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | RCPTS="brett@couchbase.com matt@couchbase.com" 4 | 5 | echo "$@" | mail -s 'A user has signed a CLA' $RCPTS 6 | 7 | curl "http://52.202.15.20:4455/gerrit?cla-signed" 8 | 9 | -------------------------------------------------------------------------------- /gerrit/hooks/patchset-created: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | RS=/home/gerrit/review_site 4 | BUILD=/home/gerrit/build/gerrit 5 | 6 | # patchset-created --change --change-url 7 | # --project --branch 8 | # --uploader --commit 9 | # --patchset 10 | 11 | while [ $# -gt 0 ] 12 | do 13 | arg=$1 14 | shift 15 | 16 | case "$arg" in 17 | --change) 18 | change=$1 19 | ;; 20 | --change-url) 21 | change_url=$1 22 | ;; 23 | --change-owner) 24 | change_owner=$1 25 | ;; 26 | --project) 27 | project=$1 28 | ;; 29 | --branch) 30 | branch=$1 31 | ;; 32 | --submitter) 33 | submitter=$1 34 | ;; 35 | --uploader) 36 | uploader=$1 37 | ;; 38 | --commit) 39 | commit=$1 40 | ;; 41 | --patchset) 42 | patchset=$1 43 | ;; 44 | --is-draft) 45 | is_draft=$1 46 | ;; 47 | --kind) 48 | kind=$1 49 | ;; 50 | *) 51 | echo "Unexpected arg: $arg" 52 | exit 1 53 | ;; 54 | esac 55 | shift 56 | done 57 | 58 | exec >>$HOME/review_site/logs/hook.log 2>&1 59 | 60 | echo ============================= 61 | echo "Patchset Created Hook (currently does nothing)" 62 | echo "date: `date`" 63 | echo "change: $change" 64 | echo "change_url: $change_url" 65 | echo "project: $project" 66 | echo "branch: $branch" 67 | echo "uploader: $uploader" 68 | echo "submitter: $submitter" 69 | echo "commit: $commit" 70 | echo "patchset: $patchset" 71 | 72 | -------------------------------------------------------------------------------- /gerrit/hooks/ref-updated: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Called whenever a ref has been updated. 4 | # 5 | # ref-updated --oldrev --newrev --refname --project --submitter 7 | 8 | touch $HOME/review_site/logs/hook.log 9 | exec >>$HOME/review_site/logs/hook.log 2>&1 10 | 11 | echo ============================= 12 | echo "Ref Updated Hook" 13 | 14 | while [ $# -gt 0 ] 15 | do 16 | arg=$1 17 | shift 18 | 19 | case "$arg" in 20 | --oldrev) 21 | oldrev=$1 22 | ;; 23 | --newrev) 24 | newrev=$1 25 | ;; 26 | --project) 27 | project=$1 28 | ;; 29 | --refname) 30 | refname=$1 31 | ;; 32 | --submitter) 33 | submitter=$1 34 | ;; 35 | *) 36 | echo "Unexpected arg: $arg" 37 | exit 1 38 | ;; 39 | esac 40 | shift 41 | done 42 | 43 | case $project in 44 | analytics_ns_server) 45 | repo="ssh://git@github.com/couchbaselabs/$project.git" 46 | ;; 47 | asterix-opt) 48 | repo="ssh://git@github.com/couchbaselabs/$project.git" 49 | ;; 50 | *) 51 | repo="git@github.com:couchbase/$project.git" 52 | ;; 53 | esac 54 | 55 | echo "date: `date`" 56 | echo "PWD: `pwd`" 57 | echo "refname: $refname" 58 | echo "oldrev: $oldrev" 59 | echo "newrev: $newrev" 60 | echo "project: $project" 61 | echo "submitter: $submitter" 62 | echo "repo: $repo" 63 | 64 | null=0000000000000000000000000000000000000000 65 | 66 | case "$refname" in 67 | */tags/*) 68 | echo "Pushing tag." 69 | 70 | git push --tags $repo 71 | git gc --auto 72 | ;; 73 | refs/heads/*) 74 | echo "Head ref, pushing to github" 75 | git push $repo $newrev:$refname 76 | ;; 77 | *) 78 | echo "Non-head ref, doing nothing" 79 | ;; 80 | esac 81 | -------------------------------------------------------------------------------- /gerrit/review_site/bin/push_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rp=$HOME/review_site 4 | 5 | push() { 6 | project=`basename $1 .git` 7 | 8 | case $project in 9 | membase) 10 | repo="git@github.com:northscale/ep-engine.git" 11 | ;; 12 | spymemcached) 13 | repo="git@github.com:dustin/java-memcached-client.git" 14 | ;; 15 | *) 16 | repo="git@github.com:northscale/$project.git" 17 | ;; 18 | esac 19 | 20 | echo "Pushing $project to $repo" 21 | 22 | cd $rp/git/$1 23 | git push $repo 24 | } 25 | 26 | cd $rp/git 27 | for i in * 28 | do 29 | push $i 30 | done 31 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/gerrit.config: -------------------------------------------------------------------------------- 1 | [gerrit] 2 | basePath = git 3 | canonicalWebUrl = http://review.couchbase.org/ 4 | [database] 5 | type = h2 6 | database = db/ReviewDB 7 | [auth] 8 | type = OPENID 9 | allowGoogleAccountUpgrade = true 10 | contributorAgreements = true 11 | [sendemail] 12 | smtpServer = localhost 13 | from = Code Review 14 | [container] 15 | user = gerrit 16 | javaHome = /usr/lib/jvm/java-6-openjdk/jre 17 | [sshd] 18 | listenAddress = *:29418 19 | cipher = +none 20 | [httpd] 21 | listenUrl = http://*:8080/ 22 | [cache] 23 | directory = cache 24 | [cache "web_sessions"] 25 | maxAge = 1w 26 | [commentlink "bugzilla"] 27 | match = "([Bb][Uu][Gg]:?\\s+#?)(\\d+)" 28 | link = http://bugs.northscale.com/show_bug.cgi?id=$2 29 | [commentlink "jira"] 30 | # match = ([MmCc][Bb](\\w+)*[-\\s]?\\d+) 31 | match = ((JSCBC|NCBC|CCBC|CBHADOOP|JCBC|CBMA|CBMI|PCBC|PYCBC|CBQE|RCBC|MB|CBD|CB|SITES|CBSE|FORUM|GC|RCBCEM|SPY)(\\w+)*[-\\s]?\\d+) 32 | link = http://www.couchbase.org/issues/browse/$1 33 | 34 | [trackingid "jira-bug"] 35 | footer = Bugfix: 36 | match = [Mm][Bb]-\\d{2,8} 37 | system = JIRA 38 | 39 | [trackingid "jira-feature"] 40 | footer = Feature 41 | match = MB-(\\d{2,8}) 42 | system = JIRA 43 | 44 | [download] 45 | scheme = ssh 46 | 47 | [core] 48 | packedGitOpenFiles = 512 49 | 50 | [mimetype "image/*"] 51 | safe = true 52 | 53 | [gitweb] 54 | cgi = /usr/lib/cgi-bin/gitweb.cgi 55 | # cgi = /var/www/htdocs/cgit/cgit.cgi 56 | # type = cgit 57 | 58 | [theme] 59 | backgroundColor = ffffff 60 | topMenuColor = f5f5f5 61 | textColor = 000000 62 | trimColor = f5f5f5 63 | selectionColor = cccccc 64 | 65 | # [gitweb] 66 | # type = custom 67 | # url = http://github.com/northscale/ 68 | # revision = ${project}/commit/${commit} 69 | # project = ${project} 70 | # branch = ${project}/commits/${branch} 71 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/Abandoned.vm.example: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2010 The Android Open Source Project 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | ## 15 | ## 16 | ## Template Type: 17 | ## ------------- 18 | ## This is a velocity mail template, see: http://velocity.apache.org and the 19 | ## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates. 20 | ## 21 | ## Template File Names and extensions: 22 | ## ---------------------------------- 23 | ## Gerrit will use templates ending in ".vm" but will ignore templates ending 24 | ## in ".vm.example". If a .vm template does not exist, the default internal 25 | ## gerrit template which is the same as the .vm.example will be used. If you 26 | ## want to override the default template, copy the .vm.example file to a .vm 27 | ## file and edit it appropriately. 28 | ## 29 | ## This Template: 30 | ## -------------- 31 | ## The Abandoned.vm template will determine the contents of the email related 32 | ## to a change being abandoned. It is a ChangeEmail: see ChangeSubject.vm and 33 | ## ChangeFooter.vm. 34 | ## 35 | $fromName has abandoned this change. 36 | 37 | Change subject: $change.subject 38 | ...................................................................... 39 | 40 | 41 | #if ($coverLetter) 42 | $coverLetter 43 | 44 | #end 45 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/ChangeFooter.vm.example: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2010 The Android Open Source Project 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | ## 15 | ## 16 | ## Template Type: 17 | ## ------------- 18 | ## This is a velocity mail template, see: http://velocity.apache.org and the 19 | ## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates. 20 | ## 21 | ## Template File Names and extensions: 22 | ## ---------------------------------- 23 | ## Gerrit will use templates ending in ".vm" but will ignore templates ending 24 | ## in ".vm.example". If a .vm template does not exist, the default internal 25 | ## gerrit template which is the same as the .vm.example will be used. If you 26 | ## want to override the default template, copy the .vm.example file to a .vm 27 | ## file and edit it appropriately. 28 | ## 29 | ## This Template: 30 | ## -------------- 31 | ## The ChangeFooter.vm template will determine the contents of the footer 32 | ## text that will be appended to ALL emails related to changes. 33 | ## 34 | #set ($SPACE = " ") 35 | --$SPACE 36 | #if ($email.changeUrl) 37 | To view, visit $email.changeUrl 38 | #set ($notblank = 1) 39 | #end 40 | #if ($email.settingsUrl) 41 | To unsubscribe, visit $email.settingsUrl 42 | #set ($notblank = 1) 43 | #end 44 | #if ($notblank == 1) 45 | 46 | #end 47 | Gerrit-MessageType: $messageClass 48 | Gerrit-Change-Id: $changeId 49 | Gerrit-PatchSet: $patchSet.patchSetId 50 | Gerrit-Project: $projectName 51 | Gerrit-Branch: $branch.shortName 52 | Gerrit-Owner: $email.getNameEmailFor($change.owner) 53 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/ChangeSubject.vm: -------------------------------------------------------------------------------- 1 | ## Copied from: ... 2 | ## 3 | ## changes subject line to include initial [TAG] for easy sorting and writing email client rules 4 | ## 5 | ## so instead of a subject like: 6 | ## 7 | ## Change in ns_server[master]: WIP: XDCR-MEMCACHED protocal change 8 | ## 9 | ## we get a subject like: 10 | ## 11 | ## ABANDONED: ns_server[master]: WIP: XDCR-MEMCACHED protocal change 12 | ## COMMENT: 13 | ## MERGED: 14 | ## MERGE FAILED: 15 | ## PATCHSET: 16 | ## REQUEST: 17 | ## RESTORED: 18 | ## REVERTED: 19 | ## 20 | ## unknown: 21 | ## 22 | #macro(elipses $length $str) 23 | #if($str.length() > $length)${str.substring(0,$length)}...#else$str#end 24 | #end 25 | #if( $messageClass == "comment" ) 26 | #set( $subject_prefix = "COMMENT: " ) 27 | #elseif( $messageClass == "merged" ) 28 | #set( $subject_prefix = "MERGED: " ) 29 | #elseif( $messageClass == "newchange" ) 30 | #set( $subject_prefix = "REQUEST: " ) 31 | #elseif( $messageClass == "newpatchset" ) 32 | #set( $subject_prefix = "PATCHSET: " ) 33 | #elseif( $messageClass == "abandon" ) 34 | #set( $subject_prefix = "ABANDONED: " ) 35 | #elseif( $messageClass == "restore" ) 36 | #set( $subject_prefix = "RESTORED: " ) 37 | #elseif( $messageClass == "revert" ) 38 | #set( $subject_prefix = "REVERTED: " ) 39 | #elseif( $messageClass == "merge-failed" ) 40 | #set( $subject_prefix = "MERGE FAILED: " ) 41 | #else 42 | #set( $subject_prefix = "unknown: " ) 43 | #end 44 | $subject_prefix $projectName.replaceAll('/.*/', '...')[$branch.shortName]: #elipses(60, $change.subject) 45 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/ChangeSubject.vm.example: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2010 The Android Open Source Project 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | ## 15 | ## 16 | ## Template Type: 17 | ## ------------- 18 | ## This is a velocity mail template, see: http://velocity.apache.org and the 19 | ## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates. 20 | ## 21 | ## Template File Names and extensions: 22 | ## ---------------------------------- 23 | ## Gerrit will use templates ending in ".vm" but will ignore templates ending 24 | ## in ".vm.example". If a .vm template does not exist, the default internal 25 | ## gerrit template which is the same as the .vm.example will be used. If you 26 | ## want to override the default template, copy the .vm.example file to a .vm 27 | ## file and edit it appropriately. 28 | ## 29 | ## This Template: 30 | ## -------------- 31 | ## The ChangeSubject.vm template will determine the contents of the email 32 | ## subject line for ALL emails related to changes. 33 | ## 34 | #macro(ellipsis $length $str) 35 | #if($str.length() > $length)#set($length = $length - 3)${str.substring(0,$length)}...#else$str#end 36 | #end 37 | Change in $projectName.replaceAll('/.*/', '...')[$branch.shortName]: #ellipsis(63, $change.subject) 38 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/ChangeSubject.vm.inprogress: -------------------------------------------------------------------------------- 1 | ## Copied from: ... 2 | ## 3 | ## changes subject line to include initial [TAG] for easy sorting and writing email client rules 4 | ## 5 | ## so instead of a subject like: 6 | ## 7 | ## Change in ns_server[master]: WIP: XDCR-MEMCACHED protocal change 8 | ## 9 | ## we get a subject like: 10 | ## 11 | ## ABANDONED: ns_server[master]: WIP: XDCR-MEMCACHED protocal change 12 | ## COMMENT: 13 | ## MERGED: 14 | ## MERGE FAILED: 15 | ## PATCHSET: 16 | ## REQUEST: 17 | ## RESTORED: 18 | ## REVERTED: 19 | ## 20 | ## unknown: 21 | ## 22 | #macro(elipses $length $str) 23 | #if($str.length() > $length)${str.substring(0,$length)}...#else$str#end 24 | #end 25 | #if( $messageClass == "comment" ) 26 | #set( $subject_prefix = "COMMENT: " ) 27 | #elseif( $messageClass == "merged" ) 28 | #set( $subject_prefix = "MERGED: " ) 29 | #elseif( $messageClass == "newchange" ) 30 | #set( $subject_prefix = "REQUEST: " ) 31 | #elseif( $messageClass == "newpatchset" ) 32 | #set( $subject_prefix = "PATCHSET: " ) 33 | #elseif( $messageClass == "abandon" ) 34 | #set( $subject_prefix = "ABANDONED: " ) 35 | #elseif( $messageClass == "restore" ) 36 | #set( $subject_prefix = "RESTORED: " ) 37 | #elseif( $messageClass == "revert" ) 38 | #set( $subject_prefix = "REVERTED: " ) 39 | #elseif( $messageClass == "merge-failed" ) 40 | #set( $subject_prefix = "MERGE FAILED: " ) 41 | #else 42 | #set( $subject_prefix = "unknown: " ) 43 | #end 44 | $subject_prefix - $projectName.replaceAll('/.*/', '...')[$branch.shortName]: #elipses(60, $change.subject) 45 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/Comment.vm.example: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2010 The Android Open Source Project 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | ## 15 | ## 16 | ## Template Type: 17 | ## ------------- 18 | ## This is a velocity mail template, see: http://velocity.apache.org and the 19 | ## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates. 20 | ## 21 | ## Template File Names and extensions: 22 | ## ---------------------------------- 23 | ## Gerrit will use templates ending in ".vm" but will ignore templates ending 24 | ## in ".vm.example". If a .vm template does not exist, the default internal 25 | ## gerrit template which is the same as the .vm.example will be used. If you 26 | ## want to override the default template, copy the .vm.example file to a .vm 27 | ## file and edit it appropriately. 28 | ## 29 | ## This Template: 30 | ## -------------- 31 | ## The Comment.vm template will determine the contents of the email related to 32 | ## a user submitting comments on changes. It is a ChangeEmail: see 33 | ## ChangeSubject.vm, ChangeFooter.vm and CommentFooter.vm. 34 | ## 35 | #if ($email.coverLetter || $email.hasInlineComments()) 36 | $fromName has posted comments on this change. 37 | 38 | Change subject: $change.subject 39 | ...................................................................... 40 | 41 | 42 | #if ($email.coverLetter) 43 | $email.coverLetter 44 | 45 | #end 46 | ## 47 | ## It is possible to increase the span of the quoted lines by using the line 48 | ## count parameter when calling $email.getInlineComments as a function. 49 | ## 50 | ## Example: #if($email.hasInlineComments())$email.getInlineComments(5)#end 51 | ## 52 | #if($email.hasInlineComments())$email.inlineComments#end 53 | #end 54 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/CommentFooter.vm.example: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2012 The Android Open Source Project 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | ## 15 | ## 16 | ## Template Type: 17 | ## ------------- 18 | ## This is a velocity mail template, see: http://velocity.apache.org and the 19 | ## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates. 20 | ## 21 | ## Template File Names and extensions: 22 | ## ---------------------------------- 23 | ## Gerrit will use templates ending in ".vm" but will ignore templates ending 24 | ## in ".vm.example". If a .vm template does not exist, the default internal 25 | ## gerrit template which is the same as the .vm.example will be used. If you 26 | ## want to override the default template, copy the .vm.example file to a .vm 27 | ## file and edit it appropriately. 28 | ## 29 | ## This Template: 30 | ## -------------- 31 | ## The CommentFooter.vm template will determine the contents of the footer 32 | ## text that will be appended to emails related to a user submitting comments 33 | ## on changes. 34 | ## 35 | ## See ChangeSubject.vm and ChangeFooter.vm. 36 | #if($email.hasInlineComments()) 37 | Gerrit-HasComments: Yes 38 | #else 39 | Gerrit-HasComments: No 40 | #end 41 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/CommitMessageEdited.vm.example: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2012 The Android Open Source Project 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | ## 15 | ## 16 | ## Template Type: 17 | ## ------------- 18 | ## This is a velocity mail template, see: http://velocity.apache.org and the 19 | ## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates. 20 | ## 21 | ## Template File Names and extensions: 22 | ## ---------------------------------- 23 | ## Gerrit will use templates ending in ".vm" but will ignore templates ending 24 | ## in ".vm.example". If a .vm template does not exist, the default internal 25 | ## gerrit template which is the same as the .vm.example will be used. If you 26 | ## want to override the default template, copy the .vm.example file to a .vm 27 | ## file and edit it appropriately. 28 | ## 29 | ## This Template: 30 | ## -------------- 31 | ## The CommitMessageUpdated.vm template will determine the contents of the email 32 | ## related to a user editing the commit message for a change through the Gerrit UI. 33 | ## It is a ChangeEmail: see ChangeSubject.vm and ChangeFooter.vm. 34 | ## 35 | #if($email.reviewerNames) 36 | Hello $email.joinStrings($email.reviewerNames, ', '), 37 | 38 | I'd like you to reexamine a change.#if($email.changeUrl) Please visit 39 | 40 | $email.changeUrl 41 | 42 | to look at the new patch set with edited commit message (#$patchSet.patchSetId). 43 | #end 44 | #else 45 | $fromName has created a new patch set by editing the commit message in Gerrit (#$patchSet.patchSetId). 46 | #end 47 | 48 | Change subject: $change.subject 49 | ...................................................................... 50 | 51 | $email.changeDetail 52 | #if($email.sshHost) 53 | git pull ssh://$email.sshHost/$projectName $patchSet.refName 54 | #end 55 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/Footer.vm.example: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2013 The Android Open Source Project 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | ## 15 | ## 16 | ## Template Type: 17 | ## ------------- 18 | ## This is a velocity mail template, see: http://velocity.apache.org and the 19 | ## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates. 20 | ## 21 | ## Template File Names and extensions: 22 | ## ---------------------------------- 23 | ## Gerrit will use templates ending in ".vm" but will ignore templates ending 24 | ## in ".vm.example". If a .vm template does not exist, the default internal 25 | ## gerrit template which is the same as the .vm.example will be used. If you 26 | ## want to override the default template, copy the .vm.example file to a .vm 27 | ## file and edit it appropriately. 28 | ## 29 | ## This Template: 30 | ## -------------- 31 | ## The Footer.vm template will determine the contents of the footer text 32 | ## appended to the end of all outgoing emails after the ChangeFooter and 33 | ## CommentFooter. 34 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/MergeFail.vm.example: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2010 The Android Open Source Project 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | ## 15 | ## 16 | ## Template Type: 17 | ## ------------- 18 | ## This is a velocity mail template, see: http://velocity.apache.org and the 19 | ## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates. 20 | ## 21 | ## Template File Names and extensions: 22 | ## ---------------------------------- 23 | ## Gerrit will use templates ending in ".vm" but will ignore templates ending 24 | ## in ".vm.example". If a .vm template does not exist, the default internal 25 | ## gerrit template which is the same as the .vm.example will be used. If you 26 | ## want to override the default template, copy the .vm.example file to a .vm 27 | ## file and edit it appropriately. 28 | ## 29 | ## This Template: 30 | ## -------------- 31 | ## The MergeFail.vm template will determine the contents of the email related 32 | ## to a failure upon attempting to merge a change to the head. It is a 33 | ## ChangeEmail: see ChangeSubject.vm and ChangeFooter.vm. 34 | ## 35 | $fromName has submitted this change and it FAILED to merge. 36 | 37 | Change subject: $change.subject 38 | ...................................................................... 39 | 40 | 41 | #if ($email.coverLetter) 42 | $email.coverLetter 43 | 44 | #end 45 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/Merged.vm.example: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2010 The Android Open Source Project 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | ## 15 | ## 16 | ## Template Type: 17 | ## ------------- 18 | ## This is a velocity mail template, see: http://velocity.apache.org and the 19 | ## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates. 20 | ## 21 | ## Template File Names and extensions: 22 | ## ---------------------------------- 23 | ## Gerrit will use templates ending in ".vm" but will ignore templates ending 24 | ## in ".vm.example". If a .vm template does not exist, the default internal 25 | ## gerrit template which is the same as the .vm.example will be used. If you 26 | ## want to override the default template, copy the .vm.example file to a .vm 27 | ## file and edit it appropriately. 28 | ## 29 | ## This Template: 30 | ## -------------- 31 | ## The Merged.vm template will determine the contents of the email related to 32 | ## a change successfully merged to the head. It is a ChangeEmail: see 33 | ## ChangeSubject.vm and ChangeFooter.vm. 34 | ## 35 | $fromName has submitted this change and it was merged. 36 | 37 | Change subject: $change.subject 38 | ...................................................................... 39 | 40 | 41 | $email.changeDetail$email.approvals 42 | 43 | #if($email.includeDiff) 44 | $email.UnifiedDiff 45 | #end 46 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/NewChange.vm.example: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2010 The Android Open Source Project 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | ## 15 | ## 16 | ## Template Type: 17 | ## ------------- 18 | ## This is a velocity mail template, see: http://velocity.apache.org and the 19 | ## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates. 20 | ## 21 | ## Template File Names and extensions: 22 | ## ---------------------------------- 23 | ## Gerrit will use templates ending in ".vm" but will ignore templates ending 24 | ## in ".vm.example". If a .vm template does not exist, the default internal 25 | ## gerrit template which is the same as the .vm.example will be used. If you 26 | ## want to override the default template, copy the .vm.example file to a .vm 27 | ## file and edit it appropriately. 28 | ## 29 | ## This Template: 30 | ## -------------- 31 | ## The NewChange.vm template will determine the contents of the email related 32 | ## to a user submitting a new change for review. It is a ChangeEmail: see 33 | ## ChangeSubject.vm and ChangeFooter.vm. 34 | ## 35 | #if($email.reviewerNames) 36 | Hello $email.joinStrings($email.reviewerNames, ', '), 37 | 38 | I'd like you to do a code review.#if($email.changeUrl) Please visit 39 | 40 | $email.changeUrl 41 | 42 | to review the following change. 43 | #end 44 | #else 45 | $fromName has uploaded a new change for review. 46 | #if($email.changeUrl) 47 | 48 | $email.changeUrl 49 | #end 50 | #end 51 | 52 | Change subject: $change.subject 53 | ...................................................................... 54 | 55 | $email.changeDetail 56 | #if($email.sshHost) 57 | git pull ssh://$email.sshHost/$projectName $patchSet.refName 58 | #end 59 | #if($email.includeDiff) 60 | 61 | $email.UnifiedDiff 62 | #end -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/RebasedPatchSet.vm.example: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2012 The Android Open Source Project 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | ## 15 | ## 16 | ## Template Type: 17 | ## ------------- 18 | ## This is a velocity mail template, see: http://velocity.apache.org and the 19 | ## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates. 20 | ## 21 | ## Template File Names and extensions: 22 | ## ---------------------------------- 23 | ## Gerrit will use templates ending in ".vm" but will ignore templates ending 24 | ## in ".vm.example". If a .vm template does not exist, the default internal 25 | ## gerrit template which is the same as the .vm.example will be used. If you 26 | ## want to override the default template, copy the .vm.example file to a .vm 27 | ## file and edit it appropriately. 28 | ## 29 | ## This Template: 30 | ## -------------- 31 | ## The RebasedPatchSet.vm template will determine the contents of the email 32 | ## related to a user rebasing a patchset for a change through the Gerrit UI. 33 | ## It is a ChangeEmail: see ChangeSubject.vm and ChangeFooter.vm. 34 | ## 35 | #if($email.reviewerNames) 36 | Hello $email.joinStrings($email.reviewerNames, ', '), 37 | 38 | I'd like you to reexamine a rebased change.#if($email.changeUrl) Please visit 39 | 40 | $email.changeUrl 41 | 42 | to look at the new rebased patch set (#$patchSet.patchSetId). 43 | #end 44 | #else 45 | $fromName has created a new patch set by issuing a rebase in Gerrit (#$patchSet.patchSetId). 46 | #end 47 | 48 | Change subject: $change.subject 49 | ...................................................................... 50 | 51 | $email.changeDetail 52 | #if($email.sshHost) 53 | git pull ssh://$email.sshHost/$projectName $patchSet.refName 54 | #end 55 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/RegisterNewEmail.vm.example: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2010 The Android Open Source Project 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | ## 15 | ## 16 | ## Template Type: 17 | ## ------------- 18 | ## This is a velocity mail template, see: http://velocity.apache.org and the 19 | ## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates. 20 | ## 21 | ## Template File Names and extensions: 22 | ## ---------------------------------- 23 | ## Gerrit will use templates ending in ".vm" but will ignore templates ending 24 | ## in ".vm.example". If a .vm template does not exist, the default internal 25 | ## gerrit template which is the same as the .vm.example will be used. If you 26 | ## want to override the default template, copy the .vm.example file to a .vm 27 | ## file and edit it appropriately. 28 | ## 29 | ## This Template: 30 | ## -------------- 31 | ## The RegisterNewEmail.vm template will determine the contents of the email 32 | ## related to registering new email accounts. 33 | ## 34 | Welcome to Gerrit Code Review at ${email.gerritHost}. 35 | 36 | To add a verified email address to your user account, please 37 | click on the following link#if($email.userNameEmail) while signed in as $email.userNameEmail#end: 38 | 39 | $email.gerritUrl#/VE/$email.emailRegistrationToken 40 | 41 | If you have received this mail in error, you do not need to take any 42 | action to cancel the account. The address will not be activated, and 43 | you will not receive any further emails. 44 | 45 | If clicking the link above does not work, copy and paste the URL in a 46 | new browser window instead. 47 | 48 | This is a send-only email address. Replies to this message will not 49 | be read or answered. 50 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/ReplacePatchSet.vm.example: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2010 The Android Open Source Project 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | ## 15 | ## 16 | ## Template Type: 17 | ## ------------- 18 | ## This is a velocity mail template, see: http://velocity.apache.org and the 19 | ## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates. 20 | ## 21 | ## Template File Names and extensions: 22 | ## ---------------------------------- 23 | ## Gerrit will use templates ending in ".vm" but will ignore templates ending 24 | ## in ".vm.example". If a .vm template does not exist, the default internal 25 | ## gerrit template which is the same as the .vm.example will be used. If you 26 | ## want to override the default template, copy the .vm.example file to a .vm 27 | ## file and edit it appropriately. 28 | ## 29 | ## This Template: 30 | ## -------------- 31 | ## The ReplacePatchSet.vm template will determine the contents of the email 32 | ## related to a user submitting a new patchset for a change. It is a 33 | ## ChangeEmail: see ChangeSubject.vm and ChangeFooter.vm. 34 | ## 35 | #if($email.reviewerNames) 36 | Hello $email.joinStrings($email.reviewerNames, ', '), 37 | 38 | I'd like you to reexamine a change.#if($email.changeUrl) Please visit 39 | 40 | $email.changeUrl 41 | 42 | to look at the new patch set (#$patchSet.patchSetId). 43 | #end 44 | #else 45 | $fromName has uploaded a new patch set (#$patchSet.patchSetId). 46 | #end 47 | 48 | Change subject: $change.subject 49 | ...................................................................... 50 | 51 | $email.changeDetail 52 | #if($email.sshHost) 53 | git pull ssh://$email.sshHost/$projectName $patchSet.refName 54 | #end 55 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/Restored.vm.example: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2011 The Android Open Source Project 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | ## 15 | ## 16 | ## Template Type: 17 | ## ------------- 18 | ## This is a velocity mail template, see: http://velocity.apache.org and the 19 | ## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates. 20 | ## 21 | ## Template File Names and extensions: 22 | ## ---------------------------------- 23 | ## Gerrit will use templates ending in ".vm" but will ignore templates ending 24 | ## in ".vm.example". If a .vm template does not exist, the default internal 25 | ## gerrit template which is the same as the .vm.example will be used. If you 26 | ## want to override the default template, copy the .vm.example file to a .vm 27 | ## file and edit it appropriately. 28 | ## 29 | ## This Template: 30 | ## -------------- 31 | ## The Restored.vm template will determine the contents of the email related 32 | ## to a change being restored. It is a ChangeEmail: see ChangeSubject.vm and 33 | ## ChangeFooter.vm. 34 | ## 35 | $fromName has restored this change. 36 | 37 | Change subject: $change.subject 38 | ...................................................................... 39 | 40 | 41 | #if ($coverLetter) 42 | $coverLetter 43 | 44 | #end 45 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/Reverted.vm.example: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2010 The Android Open Source Project 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## http://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | ## 15 | ## 16 | ## Template Type: 17 | ## ------------- 18 | ## This is a velocity mail template, see: http://velocity.apache.org and the 19 | ## gerrit-docs:config-mail.txt for more info on modifying gerrit mail templates. 20 | ## 21 | ## Template File Names and extensions: 22 | ## ---------------------------------- 23 | ## Gerrit will use templates ending in ".vm" but will ignore templates ending 24 | ## in ".vm.example". If a .vm template does not exist, the default internal 25 | ## gerrit template which is the same as the .vm.example will be used. If you 26 | ## want to override the default template, copy the .vm.example file to a .vm 27 | ## file and edit it appropriately. 28 | ## 29 | ## This Template: 30 | ## -------------- 31 | ## The Reverted.vm template will determine the contents of the email related 32 | ## to a change being reverted. It is a ChangeEmail: see ChangeSubject.vm and 33 | ## ChangeFooter.vm. 34 | ## 35 | $fromName has reverted this change. 36 | 37 | Change subject: $change.subject 38 | ...................................................................... 39 | 40 | 41 | #if ($coverLetter) 42 | $coverLetter 43 | 44 | #end 45 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/mail/junk.txt: -------------------------------------------------------------------------------- 1 | COMMENT: $messageClass == "comment" 2 | MERGED: $messageClass == "merged" 3 | REQUEST: $messageClass == "newchange" 4 | PATCHSET: $messageClass == "newpatchset" 5 | ABANDONED: $messageClass == "abandon" 6 | RESTORED: $messageClass == "restore" 7 | REVERTED: $messageClass == "revert" 8 | MERGE FAILED: $messageClass == "merge-failed" 9 | 10 | 11 | Abandoned 12 | ChangeFooter 13 | ChangeSubject 14 | Comment 15 | MergeFail 16 | Merged 17 | NewChange 18 | RegisterNewEmail 19 | ReplacePatchSet 20 | -------------------------------------------------------------------------------- /gerrit/review_site/etc/replication.config: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/couchbase/build/0961883a4a6afcc1fb82e9e876af454f43944298/gerrit/review_site/etc/replication.config -------------------------------------------------------------------------------- /gerrit/review_site/plugins/same-changeid.js: -------------------------------------------------------------------------------- 1 | Gerrit.install(function(self) { 2 | function createItem(change) { 3 | var html = '
  • Change {changeNumber}{info}
  • '; 4 | var data = { 5 | url: Gerrit.url('/' + change._number), 6 | changeNumber: change._number, 7 | info: ' (' + change.project + ', ' + change.status + ')' 8 | }; 9 | return Gerrit.html(html, data); 10 | } 11 | 12 | function renderItems(items) { 13 | var container = document.getElementById('change_plugins'); 14 | var p = Gerrit.html( 15 | '

    Other commits with same Change-Id:

    ', 16 | {style: Gerrit.css('margin-bottom: 0;')}); 17 | var list = Gerrit.html( 18 | '
      ', 19 | {style: Gerrit.css('margin-top: 0;')}); 20 | for (var i in items) { 21 | list.appendChild(items[i]); 22 | } 23 | container.appendChild(p); 24 | container.appendChild(list); 25 | } 26 | 27 | self.on('showchange', function(currentChange, revisionInfo) { 28 | var changeId = currentChange.change_id; 29 | Gerrit.get('/changes/?q=' + changeId, function(resp) { 30 | // Only render it if there is more than one one project 31 | // has the same Change-Id 32 | if (resp.length > 1) { 33 | var items = []; 34 | for (var i = 0; i < resp.length; i++) { 35 | if (currentChange.id !== resp[i].id) { 36 | items.push(createItem(resp[i])); 37 | } 38 | } 39 | renderItems(items); 40 | } 41 | }); 42 | }); 43 | }); 44 | -------------------------------------------------------------------------------- /license/README: -------------------------------------------------------------------------------- 1 | DEPRECATED - This license dir is no longer in use. Please refer to 2 | https://github.com/couchbase/product-texts/mobile instead 3 | 4 | To prevent confusion for our open-source community, move the license 5 | files out of the source repositories. 6 | 7 | -------------------------------------------------------------------------------- /qualys/file_delete_scan.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | API 4 | API 5 | FINISHED 6 | 2018-07-22T00:00:00Z 7 | 2017-01-20T00:00:00Z 8 | 9 | 10 | -------------------------------------------------------------------------------- /scripts/docs/client/build-java-docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CWD=`pwd` 4 | TARGET_BASE=couchbase-java-client 5 | TARGET_DIR=$CWD/docs 6 | BUILD_DIR=$CWD/$TARGET_BASE 7 | 8 | cd $BUILD_DIR 9 | git fetch --tags 10 | 11 | for tag in `git tag -l`; do 12 | cd $BUILD_DIR 13 | echo "Building from tag $tag" 14 | # Clean the build directory 15 | ant clean >>/dev/null 2>&1 16 | git checkout $tag >>/dev/null 2>&1 17 | 18 | # Build the documentation 19 | ant docs >>/dev/null 2>&1 20 | 21 | TARGET_TAG=$TARGET_BASE-$tag 22 | 23 | # Clean the previously built files 24 | rm -rf $TARGET_DIR/$TARGET_TAG 25 | rm -f $TARGET_DIR/$TARGET_TAG.zip 26 | 27 | # Only build and copy if the docs build was successful 28 | 29 | if [ -d 'build/docs' ] 30 | then 31 | mkdir -p $TARGET_DIR/$TARGET_TAG 32 | cp -r build/docs/* $TARGET_DIR/$TARGET_TAG/ 33 | 34 | cd $TARGET_DIR 35 | zip -r $TARGET_DIR/$TARGET_TAG.zip ./$TARGET_TAG >>/dev/null 2>&1 36 | 37 | fi 38 | done 39 | -------------------------------------------------------------------------------- /scripts/docs/client/build-java-unified-docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CWD=`pwd` 4 | TARGET_BASE=couchbase-java-client 5 | TARGET_DIR=$CWD/docs 6 | BUILD_DIR=$CWD/$TARGET_BASE 7 | 8 | cd $BUILD_DIR 9 | git fetch --tags 10 | 11 | for tag in `git tag -l`; do 12 | cd $BUILD_DIR 13 | echo "Building from tag $tag" 14 | # Clean the build directory 15 | ant clean >>/dev/null 2>&1 16 | git checkout $tag >>/dev/null 2>&1 17 | 18 | # Build the documentation 19 | 20 | ant docs 21 | 22 | if [ -d 'build/docs' ] 23 | then 24 | 25 | # Work out the spymemcached version 26 | echo "Currently in $BUILD_DIR" 27 | 28 | SPYVER=`ls build/ivy/lib/couchbase-client/common/spymemcached-[0-9]*.jar|sed -e "s/.*spymemcached-//"|sed -e "s/\.jar$//"` 29 | 30 | echo "Spy version $SPYVER" 31 | 32 | # Clean the previously built files 33 | TARGET_TAG=$TARGET_BASE-$tag 34 | 35 | rm -rf $TARGET_DIR/$TARGET_TAG 36 | rm -f $TARGET_DIR/$TARGET_TAG.zip 37 | 38 | cd $CWD/spymemcached 39 | git checkout $SPYVER 40 | ant clean 41 | ant docs 42 | 43 | cd $CWD 44 | 45 | rm build-classpath.tmp 46 | find couchbase-java-client/build "*.jar" >>build-classpath.tmp 47 | find spymemcached/build "*.jar" >>build-classpath.tmp 48 | 49 | CLASSPATH=`cat build-classpath.tmp|tr "\n" ":"` 50 | 51 | echo CLASSPATH is $CLASSPATH 52 | 53 | javadoc -d $TARGET_DIR/$TARGET_TAG -author -version -use -windowtitle "couchbase-client $tag API" -doctitle "couchbase-client $tag API" -bottom "Copyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc." -classpath $CLASSPATH `find couchbase-java-client/src/main/java/com/couchbase/client -name "*.java"` `find spymemcached/src/main/java/net/spy/memcached -name "*.java"` 54 | 55 | cd $TARGET_DIR 56 | zip -r $TARGET_DIR/$TARGET_TAG.zip ./$TARGET_TAG >>/dev/null 2>&1 57 | fi 58 | 59 | done 60 | -------------------------------------------------------------------------------- /scripts/docs/client/build-ruby-docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CWD=`pwd` 4 | TARGET_BASE=couchbase-ruby-client 5 | TARGET_DIR=$CWD/docs 6 | BUILD_DIR=$CWD/$TARGET_BASE 7 | 8 | cd $BUILD_DIR 9 | git fetch --tags 10 | 11 | for file in `git tag -l`; do 12 | cd $BUILD_DIR 13 | echo "Building from tag $file" 14 | # Clean the build directory 15 | ant clean >>/dev/null 2>&1 16 | git checkout $file >>/dev/null 2>&1 17 | 18 | # Build the documentation 19 | ant docs >>/dev/null 2>&1 20 | BASE_VER=$(git describe) 21 | yard doc -o $TARGET_DIR/$TARGET_BASE-$BASE_VER 22 | 23 | cd $TARGET_DIR 24 | zip -r $TARGET_DIR/$TARGET_BASE-$BASE_VER.zip ./$TARGET_BASE-$BASE_VER >>/dev/null 2>&1 25 | 26 | done 27 | -------------------------------------------------------------------------------- /scripts/docs/client/build-sdk-docs-page.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | use IO::File; 6 | use Data::Dumper; 7 | 8 | my $srcfiles = { 9 | 'spymemcached' => 'Spymemcached', 10 | 'couchbase-java-client' => 'Couchbase Java Client', 11 | 'couchbase-ruby-client' => 'Couchbase Ruby Client', 12 | }; 13 | 14 | my ($infile, $outfile, $dirsrc) = @ARGV; 15 | 16 | my $targets = {}; 17 | 18 | foreach my $file (glob("$dirsrc/*")) 19 | { 20 | next if ($file =~ m/.html$/); 21 | my $type = 'file'; 22 | my $origfile = $file; 23 | if (-d $file) 24 | { 25 | $type = 'dir'; 26 | } 27 | 28 | $file =~ s{^$dirsrc/}{}; 29 | my $fileident = undef; 30 | my $version = undef; 31 | 32 | for my $filebase (keys %{$srcfiles}) 33 | { 34 | $version = $file; 35 | 36 | $version =~ s/\.(zip|tar.gz|tgz)$//g; 37 | if ($version =~ m/^$filebase/) 38 | { 39 | $fileident = $filebase; 40 | } 41 | } 42 | 43 | $version =~ s/^$fileident-//; 44 | $version =~ s/^v//; 45 | 46 | if (defined($fileident)) 47 | { 48 | $targets->{$fileident}->{$version}->{$type} = $file; 49 | } 50 | else 51 | { 52 | print STDERR "Unknown product in $origfile\n"; 53 | } 54 | } 55 | 56 | #print STDERR Dumper($targets),"\n"; 57 | 58 | my @fmttext; 59 | 60 | foreach my $ident (sort {$srcfiles->{$a} cmp $srcfiles->{$b}} keys %{$srcfiles}) 61 | { 62 | push(@fmttext,"

      $srcfiles->{$ident}

      "); 63 | push(@fmttext,""); 64 | 65 | foreach my $version (sort keys %{$targets->{$ident}}) 66 | { 67 | push(@fmttext,"', 76 | ); 77 | } 78 | push(@fmttext,'
      VersionDownload
      ", 68 | (exists($targets->{$ident}->{$version}->{dir}) ? 69 | sprintf('',$targets->{$ident}->{$version}->{dir}) : ''), 70 | sprintf('%s v%s',$srcfiles->{$ident},$version), 71 | (exists($targets->{$ident}->{$version}->{dir}) ? '' : ''), 72 | '', 73 | (exists($targets->{$ident}->{$version}->{file}) ? 74 | sprintf('Download',$targets->{$ident}->{$version}->{file}) : ''), 75 | '
      '); 79 | } 80 | 81 | my $srcfile = IO::File->new($infile); 82 | binmode($srcfile,':utf8'); 83 | my $inplacefile = join('',<$srcfile>); 84 | $srcfile->close(); 85 | 86 | my $repltext = join('',@fmttext); 87 | 88 | $inplacefile =~ s//$repltext/msg; 89 | 90 | my $targetfile = IO::File->new($outfile, 'w'); 91 | binmode($targetfile,':utf8'); 92 | print $targetfile $inplacefile; 93 | $targetfile->close(); 94 | -------------------------------------------------------------------------------- /scripts/docs/client/build-spy-docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CWD=`pwd` 4 | TARGET_BASE=spymemcached 5 | TARGET_DIR=$CWD/docs 6 | BUILD_DIR=$CWD/$TARGET_BASE 7 | 8 | cd $BUILD_DIR 9 | git fetch --tags 10 | 11 | for tag in `git tag -l`; do 12 | cd $BUILD_DIR 13 | echo "Building from tag $tag" 14 | # Clean the build directory 15 | ant clean >>/dev/null 2>&1 16 | git checkout $tag >>/dev/null 2>&1 17 | 18 | # Build the documentation 19 | ant docs >>/dev/null 2>&1 20 | 21 | TARGET_TAG=$TARGET_BASE-$tag 22 | 23 | # Clean the previously built files 24 | rm -rf $TARGET_DIR/$TARGET_TAG 25 | rm -f $TARGET_DIR/$TARGET_TAG.zip 26 | 27 | # Only build and copy if the docs build was successful 28 | 29 | if [ -d 'build/docs' ] 30 | then 31 | mkdir -p $TARGET_DIR/$TARGET_TAG 32 | cp -r build/docs/* $TARGET_DIR/$TARGET_TAG/ 33 | 34 | cd $TARGET_DIR 35 | zip -r $TARGET_DIR/$TARGET_TAG.zip ./$TARGET_TAG >>/dev/null 2>&1 36 | 37 | fi 38 | done 39 | -------------------------------------------------------------------------------- /scripts/docs/client/build-unified-java.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | GITHUB=git://10.1.1.210 5 | 6 | for PROJ in couchbase-java-client couchbase-ruby-client spymemcached 7 | do 8 | PROJ_DIR=./${PROJ} 9 | if [[ -d ${PROJ_DIR} ]] ; then rm -rf ${PROJ_DIR} ; mkdir ${PROJ_DIR} ; fi 10 | git clone ${GITHUB}/${PROJ}.git ${PROJ_DIR} 11 | echo --------------------------------------- 12 | done 13 | 14 | DOC_DIR=./unified-docs 15 | if [[ -d ${DOC_DIR} ]] ; then rm -rf ${DOC_DIR} ; mkdir ${DOC_DIR} ; fi 16 | 17 | ./build-java-unified-docs.sh 18 | ./build-ruby-docs.sh 19 | 20 | javadoc -d ${DOC_DIR} \ 21 | `find couchbase-java-client/src/main/java/com/couchbase/client -name "*.java"` \ 22 | `find couchbase-ruby-client/src/main/java/com/couchbase/client -name "*.java"` \ 23 | `find spymemcached/src/main/java/net/spy/memcached -name "*.java"` 24 | -------------------------------------------------------------------------------- /scripts/jenkins/build_trigger/server_buildbot_trigger.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # jenkins monitors changes in files pointed to by server manifest 4 | # and triggers buildbot repo-* job to build on all platforms 5 | 6 | CURL=/usr/bin/curl 7 | DATA_DIR=/var/lib/jenkins/data/buildbot_trigger 8 | 9 | URL_ROOT=http://builds.hq.northscale.net:8010 10 | USERNAME='username=couchbase.build' 11 | USERPASS='passwd=couchbase.build.password' 12 | 13 | BRANCH=master 14 | 15 | if [[ ${1} ]] ; then BRANCH=$1 ; shift ; fi 16 | 17 | MFST_PRE=${WORKSPACE}/manifest.${BRANCH}.prev # put here by 'Copy To Slave Plugin' 18 | MFST_NOW=${WORKSPACE}/manifest.${BRANCH}.now 19 | 20 | BUILDER=repo-couchbase-${BRANCH}-builder 21 | 22 | if [[ ! -f ${MFST_PRE} ]] 23 | then 24 | echo ......launching FIRST build ${BUILDER} 25 | echo ......${CURL} ${URL_ROOT}/builders/${BUILDER}/force?forcescheduler=all_repo_builders\&${USERNAME}\&${USERPASS} 26 | ${CURL} ${URL_ROOT}/builders/${BUILDER}/force?forcescheduler=all_repo_builders\&${USERNAME}\&${USERPASS} 27 | repo manifest -r > ${MFST_PRE} 28 | exit 0 29 | fi 30 | 31 | repo manifest -r > ${MFST_NOW} 32 | 33 | if [[ "$FORCE_BUILD" = "true" ]] 34 | then 35 | manifest_diff="just_do_it" 36 | echo "FORCING build to occur, as requested!" 37 | else 38 | manifest_diff=`diff ${MFST_NOW} ${MFST_PRE} | grep "project name" | grep -v testrunner` 39 | fi 40 | 41 | if [[ "x$manifest_diff" != "x" ]] 42 | then 43 | echo ......launching NEW build ${BUILDER} 44 | echo ......${CURL} ${URL_ROOT}/builders/${BUILDER}/force?forcescheduler=all_repo_builders\&${USERNAME}\&${USERPASS} 45 | ${CURL} ${URL_ROOT}/builders/${BUILDER}/force?forcescheduler=all_repo_builders\&${USERNAME}\&${USERPASS} 46 | repo manifest -r > ${MFST_PRE} 47 | else 48 | echo ">>> No relevant changes" 49 | fi 50 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/cbsasl/cbsasl-gerrit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run by jenkins job 'cbsasl-gerrit-master' 4 | # cbsasl-gerrit-300 5 | # cbsasl-gerrit-250 6 | # 7 | # with no paramters 8 | # 9 | # triggered on Patchset Creation of repo: cbsasl branch: master 10 | 11 | source ~jenkins/.bash_profile 12 | set -e 13 | ulimit -a 14 | 15 | echo ============================================ `date` 16 | env | grep -iv password | grep -iv passwd | sort 17 | 18 | echo ============================================ clean 19 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 20 | make clean-xfd-hard 21 | 22 | echo ============================================ update cbsasl 23 | pushd cbsasl 2>&1 > /dev/null 24 | git fetch ssh://review.couchbase.org:29418/cbsasl $GERRIT_REFSPEC && git checkout FETCH_HEAD 25 | 26 | echo ============================================ make 27 | popd 2>&1 > /dev/null 28 | make -j4 all install || (make -j1 && false) 29 | 30 | echo ============================================ make simple-test 31 | cd testrunner 32 | make simple-test 33 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 34 | 35 | echo ============================================ `date` 36 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/checkout_dependencies.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Simple script for taking the output of alldependencies.py and running it 4 | on the corresponding `fetch_project` script. 5 | 6 | It will also return the exit code of alldependencies.py which means commit 7 | validation scripts which use this will exit appropriately. 8 | """ 9 | 10 | from __future__ import print_function 11 | import os 12 | import platform 13 | import subprocess 14 | import sys 15 | 16 | if platform.system() == 'Windows': 17 | FETCH_PROJECT = 'fetch_project.bat' 18 | else: 19 | FETCH_PROJECT = 'fetch_project.sh' 20 | 21 | def main(): 22 | if len(sys.argv) != 5: 23 | print('usage: {} sha changeid project refspec\n'.format(sys.argv[0]), file=sys.stderr) 24 | 25 | script_dir = os.path.dirname(sys.argv[0]) 26 | script_dir = os.path.sep.join(script_dir.split('/')) 27 | 28 | p = subprocess.Popen( 29 | [sys.executable, os.path.join(script_dir, 'alldependencies.py')] + sys.argv[1:], 30 | stdout=subprocess.PIPE) 31 | p.wait() 32 | if p.returncode: 33 | return p.returncode 34 | 35 | for line in p.stdout: 36 | project, path, refspec = line.split(' ') 37 | path = path.replace('/', os.path.sep) 38 | print("Checking out {} in ./{} at {}".format(project, path, refspec)) 39 | sys.stdout.flush() 40 | 41 | u = subprocess.Popen( 42 | [os.path.join(script_dir, FETCH_PROJECT), project, path, refspec]) 43 | u.wait() 44 | if u.returncode: 45 | return u.returncode 46 | 47 | return p.returncode 48 | 49 | 50 | 51 | if __name__ == '__main__': 52 | sys.exit(main()) 53 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/couchbase-cli/couchbase-cli-gerrit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run by jenkins job: couchbase-cli-gerrit-master 4 | # couchbase-cli-gerrit-300 5 | # couchbase-cli-gerrit-250 6 | # 7 | # with no paramters 8 | # 9 | # triggered on Patchset Creation of repo: couchbase-cli 10 | 11 | source ~jenkins/.bash_profile 12 | set -e 13 | ulimit -a 14 | 15 | echo ============================================ `date` 16 | env | grep -iv password | grep -iv passwd | sort 17 | 18 | echo ============================================ clean 19 | sudo killall -9 beam.smp epmd memcached python 2>&1 > /dev/null || true 20 | 21 | make clean-xfd-hard 22 | 23 | pushd couchbase-cli 2>&1 > /dev/null 24 | echo ============================================ update cli 25 | git fetch ssh://review.couchbase.org:29418/couchbase-cli $GERRIT_REFSPEC && git checkout FETCH_HEAD 26 | 27 | sudo easy_install --upgrade nose 28 | nosetests -v t/pump_upr_test.py 29 | 30 | popd 2>&1 > /dev/null 31 | 32 | sudo killall -9 beam.smp epmd memcached python 2>&1 > /dev/null || true 33 | 34 | echo ============================================ `date` 35 | 36 | ## Cleanup .repo directory 37 | 38 | if [ -d ${WORKSPACE}/.repo ] 39 | then 40 | rm -rf ${WORKSPACE}/.repo 41 | fi 42 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/couchdb/couchdb-gerrit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | set -x 5 | 6 | curdir=`dirname $0` 7 | 8 | # CCACHE is good - use it if available. 9 | export PATH=/usr/lib/ccache:$PATH 10 | 11 | 12 | cat </dev/null || true 26 | make clean-xfd-hard 27 | 28 | cat </dev/null || true 18 | make clean-xfd-hard 19 | 20 | echo ============================================ update couchdbx-app 21 | cd couchdbx-app 22 | git fetch ssh://review.couchbase.org:29418/couchdbx-app $GERRIT_REFSPEC && git checkout FETCH_HEAD 23 | 24 | echo ============================================ make 25 | cd .. 26 | make -j4 all install 27 | echo ============================================ make simple-test 28 | cd testrunner 29 | make simple-test 30 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 31 | sleep 30 32 | scripts/start_cluster_and_run_tests.sh b/resources/dev-4-nodes.ini conf/py-viewmerge.conf 33 | 34 | echo ============================================ `date` 35 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/couchstore/couchstore-gerrit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run by jenkins job: couchstore-gerrit-master 4 | # couchstore-gerrit-300 5 | # couchstore-gerrit-251 6 | # 7 | # use "--legacy" parameter for couchstore-gerrit-251 8 | # 9 | # triggered on Patchset Creation of repo: couchstore 10 | 11 | source ~jenkins/.bash_profile 12 | set -e 13 | ulimit -a 14 | 15 | cat </dev/null || true 29 | make clean-xfd-hard 30 | 31 | cat <&1 > /dev/null 38 | ./build-scripts/scripts/jenkins/commit_validation/alldependencies.py $GERRIT_PATCHSET_REVISION|\ 39 | xargs -n 3 ./build-scripts/scripts/jenkins/commit_validation/fetch_project.sh 40 | 41 | popd 2>&1 > /dev/null 42 | 43 | cat <&1 > /dev/null 62 | else 63 | pushd couchstore 2>&1 > /dev/null 64 | fi 65 | 66 | make test 67 | popd 2>&1 > /dev/null 68 | 69 | cat </dev/null || true 84 | 85 | ## Cleanup .repo directory 86 | 87 | if [ -d ${WORKSPACE}/.repo ] 88 | then 89 | rm -rf ${WORKSPACE}/.repo 90 | fi 91 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/ep-engine/ep-engine-gerrit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run by jenkins job 'ep-engine-gerrit-master.sh' 4 | # 5 | # 6 | # use "--legacy" parameter for ep-engine-gerrit-251 7 | # triggered on Patchset Creation of repo: ep-engine branch: master 8 | 9 | source ~jenkins/.bash_profile 10 | set -e 11 | ulimit -a 12 | 13 | cat </dev/null || true 26 | make clean-xfd-hard 27 | 28 | cat <&1 > /dev/null 34 | git fetch ssh://review.couchbase.org:29418/ep-engine $GERRIT_REFSPEC && git checkout FETCH_HEAD 35 | popd 2>&1 > /dev/null 36 | 37 | cat </dev/null || true 63 | 64 | ## Cleanup .repo directory 65 | 66 | if [ -d ${WORKSPACE}/.repo ] 67 | then 68 | rm -rf ${WORKSPACE}/.repo 69 | fi 70 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/ep-engine/ep-simple-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run by jenkins job 'ep-simple-test-master.sh' 4 | # 5 | # with no paramters 6 | # 7 | # triggered on Patchset Creation of repo: ep-engine branch: master 8 | 9 | source ~jenkins/.bash_profile 10 | set -e 11 | ulimit -a 12 | 13 | cat </dev/null || true 26 | make clean-xfd-hard 27 | 28 | 29 | cat <&1 > /dev/null 47 | else 48 | pushd ep-engine 2>&1 > /dev/null 49 | fi 50 | 51 | make test 52 | 53 | if [ -f Makefile.am ] 54 | then 55 | make engine-tests 56 | fi 57 | 58 | popd 2>&1 > /dev/null 59 | 60 | cat <') do ( 4 | @REM call fetch_project.bat %%i %%j %%k 5 | @REM ) 6 | 7 | set PROJECT=%1 8 | set PROJECT_PATH=%2 9 | set REFSPEC=%3 10 | 11 | @IF NOT DEFINED GERRIT_HOST ( 12 | @echo "Error: Required environment variable 'GERRIT_HOST' not set." 13 | @exit /b 1 14 | ) 15 | 16 | @IF NOT DEFINED GERRIT_PORT ( 17 | @echo "Error: Required environment variable 'GERRIT_PORT' not set." 18 | @exit /b 2 19 | ) 20 | 21 | @IF NOT DEFINED GERRIT_SCHEME ( 22 | @echo "Error: Required environment variable 'GERRIT_SCHEME' not set." 23 | @exit /b 3 24 | ) 25 | 26 | @IF NOT DEFINED PROJECT ( 27 | @echo "Error: Required argument 'PROJECT' not set." 28 | @exit /b 4 29 | ) 30 | 31 | @IF NOT DEFINED PROJECT_PATH ( 32 | @echo "Error: Required argument 'PROJECT_PATH' not set." 33 | @exit /b 5 34 | ) 35 | 36 | @IF NOT DEFINED REFSPEC ( 37 | @echo "Error: Required argument 'REFSPEC' not set." 38 | @exit /b 6 39 | ) 40 | 41 | @if not exist %PROJECT_PATH% ( 42 | @echo "%PROJECT_PATH% doesn't exist, skipping..." 43 | @exit /b 0 44 | ) 45 | 46 | pushd %PROJECT_PATH% || exit /b 1 47 | git reset --hard HEAD || exit /b 1 48 | git fetch %GERRIT_SCHEME%://%GERRIT_HOST%:%GERRIT_PORT%/%PROJECT% %REFSPEC% || exit /b 1 49 | git clean -d --force -x || exit /b 1 50 | git checkout FETCH_HEAD || exit /b 1 51 | popd || exit /b 1 52 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/fetch_project.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Fetches a project by project name, path and Git ref 4 | # This script is normally used in conjunction with allcommits.py: 5 | # ./allcommits.py |xargs -n 3 ./fetchproject.sh 6 | 7 | set -x 8 | 9 | set -e 10 | 11 | PROJECT=$1 12 | PROJECT_PATH=$2 13 | REFSPEC=$3 14 | 15 | if [ -z "$GERRIT_HOST" ]; then 16 | echo "Error: Required environment variable 'GERRIT_HOST' not set." 17 | exit 1 18 | fi 19 | if [ -z "$GERRIT_PORT" ]; then 20 | echo "Error: Required environment variable 'GERRIT_PORT' not set." 21 | exit 2 22 | fi 23 | if [ -z "$GERRIT_SCHEME" ]; then 24 | echo "Error: Required environment variable 'GERRIT_SCHEME' not set." 25 | exit 3 26 | fi 27 | if [ -z "$PROJECT" ]; then 28 | echo "Error: Required argument 'PROJECT' not set." 29 | exit 4 30 | fi 31 | if [ -z "$PROJECT_PATH" ]; then 32 | echo "Error: Required argument 'PROJECT_PATH' not set." 33 | exit 5 34 | fi 35 | if [ -z "$REFSPEC" ]; then 36 | echo "Error: Required argument 'REFSPEC' not set." 37 | exit 6 38 | fi 39 | 40 | if [ ! -d "$PROJECT_PATH" ]; then 41 | echo "$PROJECT_PATH doesn't exist, skipping..." 42 | exit 0 43 | fi 44 | 45 | pushd $PROJECT_PATH > /dev/null 46 | git reset --hard HEAD 47 | git fetch $GERRIT_SCHEME://$GERRIT_HOST:$GERRIT_PORT/$PROJECT $REFSPEC 48 | git clean -d --force -x 49 | git checkout FETCH_HEAD 50 | popd > /dev/null 51 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/geocouch/geocouch-gerrit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | set -x 5 | 6 | curdir=`dirname $0` 7 | 8 | # CCACHE is good - use it if available. 9 | export PATH=/usr/lib/ccache:$PATH 10 | 11 | 12 | cat </dev/null || true 26 | make clean-xfd-hard 27 | 28 | cat </dev/null || true 20 | make clean-xfd-hard 21 | repo forall -c "git clean -xfd" 22 | 23 | echo ============================================ make 24 | make all install 25 | echo ============================================ make simple-test 26 | cd testrunner 27 | export COUCHBASE_REPL_TYPE=${1-tap} 28 | make simple-test 29 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 30 | zip cluster_run_log cluster_run.log 31 | echo ============================================ `date` 32 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/libmemcached/libmemcached-gerrit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run by jenkins job 'libmemcached-gerrit' 4 | # 5 | # 6 | # 7 | # triggered on Patchset Creation of repo: libmemcached 8 | 9 | source ~jenkins/.bash_profile 10 | set -e 11 | ulimit -a 12 | 13 | echo ============================================ `date` 14 | env | grep -iv password | grep -iv passwd | sort 15 | 16 | echo ============================================ clean 17 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 18 | make clean-xfd-hard 19 | 20 | echo ============================================ update memcached 21 | pushd memcached 2>&1 > /dev/null 22 | git fetch ssh://review.couchbase.org:29418/libmemcached $GERRIT_REFSPEC && git checkout FETCH_HEAD 23 | 24 | echo ============================================ make 25 | popd 2>&1 > /dev/null 26 | make -j4 all install 27 | echo ============================================ make simple-test 28 | cd testrunner 29 | make simple-test 30 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 31 | 32 | echo ============================================ `date` 33 | 34 | ## Cleanup .repo directory 35 | 36 | if [ -d ${WORKSPACE}/.repo ] 37 | then 38 | rm -rf ${WORKSPACE}/.repo 39 | fi 40 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/libvbucket/libvbucket-gerrit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run by jenkins job 'libvbucket-gerrit-master' 4 | # 5 | # with no paramters 6 | # 7 | # triggered on Patchset Creation of repo: libvbucket branch: master 8 | 9 | source ~jenkins/.bash_profile 10 | set -e 11 | ulimit -a 12 | 13 | echo ============================================ `date` 14 | env | grep -iv password | grep -iv passwd | sort 15 | 16 | echo ============================================ clean 17 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 18 | make clean-xfd-hard 19 | 20 | echo ============================================ update libvbucket 21 | pushd libvbucket 2>&1 > /dev/null 22 | git fetch ssh://review.couchbase.org:29418/libvbucket $GERRIT_REFSPEC && git checkout FETCH_HEAD 23 | 24 | echo ============================================ make 25 | popd 2>&1 > /dev/null 26 | make -j4 all install || (make -j1 && false) 27 | echo ============================================ make simple-test 28 | cd testrunner 29 | make simple-test 30 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 31 | 32 | echo ============================================ `date` 33 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/memcached/memcached-gerrit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run by jenkins job 'memcached-gerrit' 4 | # 5 | # 6 | # triggered on Patchset Creation of repo: memcached 7 | 8 | # How many jobs to run in parallel by default? 9 | PARALLELISM="${PARALLELISM:-8}" 10 | 11 | source ~jenkins/.bash_profile 12 | set -e 13 | 14 | # CCACHE is good - use it if available. 15 | export PATH=/usr/lib/ccache:$PATH 16 | 17 | function echo_cmd { 18 | echo \# "$@" 19 | "$@" 20 | } 21 | 22 | cat <&1 > /dev/null 47 | echo_cmd git fetch ssh://review.couchbase.org:29418/memcached $GERRIT_REFSPEC 48 | echo_cmd git checkout FETCH_HEAD 49 | popd 2>&1 > /dev/null 50 | 51 | cat <&1 > /dev/null 72 | # -j${PARALLELISM} : Run tests in parallel. 73 | # -T Test : Generate XML output file of test results. 74 | # "|| true" : Needed to ensure that xUnit scanner is run even if one or more 75 | # tests fail. 76 | echo_cmd make test ARGS="-j${PARALLELISM} --output-on-failure --no-compress-output -T Test" || true 77 | popd 2>&1 > /dev/null 78 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/moxi/moxi-gerrit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run by jenkins job 'moxi-gerrit-master' 4 | # moxi-gerrit-300 5 | # moxi-gerrit-250 6 | # 7 | # with no paramters 8 | # 9 | # triggered on Patchset Creation of repo: moxi branch: master 10 | 11 | source ~jenkins/.bash_profile 12 | set -e 13 | ulimit -a 14 | 15 | echo ============================================ `date` 16 | env | grep -iv password | grep -iv passwd | sort 17 | 18 | echo ============================================ clean 19 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 20 | make clean-xfd-hard 21 | 22 | echo ============================================ update moxi 23 | pushd moxi 2>&1 > /dev/null 24 | git fetch ssh://review.couchbase.org:29418/moxi $GERRIT_REFSPEC && git checkout FETCH_HEAD 25 | 26 | echo ============================================ make 27 | popd 2>&1 > /dev/null 28 | make -j4 all install || (make -j1 && false) 29 | 30 | echo ============================================ make simple-test 31 | cd testrunner 32 | make simple-test 33 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 34 | 35 | echo ============================================ `date` 36 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/ns_server/ns_server-gerrit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run by jenkins job 'ns_server-gerrit-master' 4 | # 5 | # with no paramters 6 | # 7 | # triggered on Patchset Creation of repo: ns_server branch: master 8 | 9 | source ~jenkins/.bash_profile 10 | set -e 11 | ulimit -a 12 | 13 | echo ============================================ `date` 14 | env | grep -iv password | grep -iv passwd | sort 15 | 16 | echo ============================================ clean and fetch 17 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 18 | make clean-xfd-hard 19 | cd ns_server 20 | git fetch ssh://review.couchbase.org:29418/ns_server $GERRIT_REFSPEC && git checkout FETCH_HEAD 21 | 22 | echo ============================================ make 23 | cd .. 24 | make -j4 all install 25 | 26 | echo ============================================ make simple 27 | cd testrunner 28 | make simple-test 29 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 30 | sleep 30 31 | scripts/start_cluster_and_run_tests.sh b/resources/dev-4-nodes.ini conf/py-viewmerge.conf 32 | 33 | echo ============================================ `date` 34 | 35 | ## Cleanup .repo directory 36 | 37 | if [ -d ${WORKSPACE}/.repo ] 38 | then 39 | rm -rf ${WORKSPACE}/.repo 40 | fi 41 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/platform/platform-gerrit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run by jenkins job 'platform-gerrit' 4 | # 5 | # 6 | # triggered on Patchset Creation of repo: platform 7 | 8 | source ~jenkins/.bash_profile 9 | set -e 10 | ulimit -a 11 | 12 | echo ============================================ `date` 13 | env | grep -iv password | grep -iv passwd | sort 14 | 15 | echo ============================================ clean 16 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 17 | make clean-xfd-hard 18 | 19 | echo ============================================ update memcached 20 | pushd platform 2>&1 > /dev/null 21 | git fetch ssh://review.couchbase.org:29418/platform $GERRIT_REFSPEC && git checkout FETCH_HEAD 22 | 23 | echo ============================================ make 24 | popd 2>&1 > /dev/null 25 | make -j4 all install 26 | 27 | pushd build/platform 2>&1 > /dev/null 28 | make test 29 | popd 2>&1 > /dev/null 30 | 31 | echo ============================================ make simple-test 32 | cd testrunner 33 | make simple-test 34 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 35 | 36 | echo ============================================ `date` 37 | 38 | ## Cleanup .repo directory 39 | 40 | if [ -d ${WORKSPACE}/.repo ] 41 | then 42 | rm -rf ${WORKSPACE}/.repo 43 | fi 44 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/portsigar/portsigar-gerrit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run by jenkins job 'portsigar-gerrit-master' 4 | # portsigar-gerrit-300 5 | # portsigar-gerrit-250 6 | # with no paramters 7 | # 8 | # triggered on Patchset Creation of repo: portsigar branch: master 9 | 10 | source ~jenkins/.bash_profile 11 | set -e 12 | ulimit -a 13 | 14 | echo ============================================ `date` 15 | env | grep -iv password | grep -iv passwd | sort 16 | 17 | echo ============================================ clean 18 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 19 | make clean-xfd-hard 20 | 21 | echo ============================================ update portsigar 22 | pushd portsigar 2>&1 > /dev/null 23 | git fetch ssh://review.couchbase.org:29418/portsigar $GERRIT_REFSPEC && git checkout FETCH_HEAD 24 | 25 | echo ============================================ make 26 | popd 2>&1 > /dev/null 27 | make -j4 all install || (make -j1 && false) 28 | echo ============================================ make simple-test 29 | cd testrunner 30 | make simple-test 31 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 32 | 33 | echo ============================================ `date` 34 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/remove_irrelevant_memcheck_results.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Given a list of Valgrind memcheck files on the command line, 4 | # delete any which were generated from programs which we consider 5 | # irrevelant to our tests. 6 | 7 | irrelevant_prefixes = ['/bin/', '/usr/bin'] 8 | 9 | import os 10 | import sys 11 | import xml.etree.ElementTree as ET 12 | 13 | for xml_file in sys.argv[1:]: 14 | tree = ET.parse(xml_file) 15 | exe_name = tree.find('args/argv/exe').text 16 | for prefix in irrelevant_prefixes: 17 | if exe_name.startswith(prefix): 18 | print '''Info: removing memcheck file {0} \ 19 | generated by {1}'''.format(xml_file, exe_name) 20 | os.remove(xml_file) 21 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/single-project-gerrit.sh: -------------------------------------------------------------------------------- 1 | single-project-gerrit -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/testrunner/testrunner-gerrit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run by jenkins job 'testrunner-gerrit-master.sh' 4 | # 5 | # with no paramters 6 | # 7 | # triggered on Patchset Creation of repo: testrunner branch: master 8 | # 9 | 10 | source ~jenkins/.bash_profile 11 | set -e 12 | ulimit -a 13 | 14 | echo ============================================ `date` 15 | env | grep -iv password | grep -iv passwd | sort 16 | 17 | echo ============================================ clean 18 | rm -rf testrunner/cluster_run.log 19 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 20 | make clean-xfd-hard 21 | repo forall -c "git clean -xfd" 22 | 23 | echo ============================================ update testrunner 24 | cd testrunner 25 | git reset --hard HEAD 26 | git fetch ssh://review.couchbase.org:29418/testrunner $GERRIT_REFSPEC && git checkout FETCH_HEAD 27 | 28 | echo ============================================ make 29 | cd .. 30 | make all install 31 | echo ============================================ make simple-test 32 | cd testrunner 33 | make simple-test 34 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 35 | zip cluster_run_log ../ns_server/cluster_run*log 36 | echo ============================================ `date` 37 | -------------------------------------------------------------------------------- /scripts/jenkins/commit_validation/tlm/tlm-gerrit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run by jenkins job 'tlm-gerrit-master' 4 | # 5 | # with no paramters 6 | # 7 | # triggered on Patchset Creation of repo: tlm branch: master 8 | 9 | source ~jenkins/.bash_profile 10 | set -e 11 | ulimit -a 12 | 13 | echo ============================================ `date` 14 | env | grep -iv password | grep -iv passwd | sort 15 | 16 | echo ============================================ clean 17 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 18 | make clean-xfd-hard 19 | 20 | echo ============================================ update tlm 21 | cd tlm 22 | git fetch ssh://review.couchbase.org:29418/tlm $GERRIT_REFSPEC && git checkout FETCH_HEAD 23 | 24 | echo ============================================ make 25 | cd .. 26 | make -j4 all install 27 | echo ============================================ make simple-test 28 | cd testrunner 29 | make simple-test 30 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 31 | sleep 30 32 | scripts/start_cluster_and_run_tests.sh b/resources/dev-4-nodes.ini conf/py-viewmerge.conf 33 | 34 | echo ============================================ `date` 35 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase-edge-server/couchbase-edge-server-linux-package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # This script is used by couchbase-edge-server-linux on Mobile Jenkins 3 | # PRODUCT, VERSION, and BLD_NUM are set by the job. 4 | 5 | # Prepare staging area for packaging 6 | if [[ -d ${PRODUCT} ]]; then 7 | rm -rf ${PRODUCT} 8 | fi 9 | cp -rp ${WORKSPACE}/edge-server/install ${PRODUCT} 10 | 11 | # Get build agent's docker id 12 | # sidecar needs to know where to mount the volume. 13 | NODE_NAME=$(uname -n) 14 | 15 | # build rpm and deb 16 | ruby package-rpm.rb couchbase-edge-server ${PRODUCT} ${VERSION}-${BLD_NUM} x86_64 17 | docker run --rm --pull=always --volumes-from ${NODE_NAME} --workdir `pwd` --user 1000:1000 \ 18 | couchbasebuild/server-deb-sidecar:latest ruby package-deb.rb ${PRODUCT} \ 19 | ${PRODUCT} ${VERSION}-${BLD_NUM} amd64 20 | 21 | # copy deb and rpm to make it easier for Jenkins to publish 22 | cp build/deb/*.deb ${WORKSPACE} 23 | cp build/rpm/${PRODUCT}_${VERSION}-${BLD_NUM}/rpmbuild/RPMS/*/*.rpm ${WORKSPACE} 24 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase-edge-server/deb_templates/README.Debian.tmpl: -------------------------------------------------------------------------------- 1 | @@PRODUCT@@ for Debian 2 | ---------------------------- 3 | 4 | @@PRODUCT@@ distribution for Debian 5 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase-edge-server/deb_templates/changelog.tmpl: -------------------------------------------------------------------------------- 1 | @@PRODUCT@@ (@@PRODUCT_VERSION@@) UNRELEASED; urgency=low 2 | 3 | * debian package for @@PRODUCT@@ @@PRODUCT_VERSION@@ 4 | 5 | -- Mon, 16 Dec 2024 13:11:25 -0700 6 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase-edge-server/deb_templates/compat.tmpl: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase-edge-server/deb_templates/control.tmpl: -------------------------------------------------------------------------------- 1 | Source: @@PRODUCT@@ 2 | Section: web 3 | Priority: extra 4 | Maintainer: Couchbase 5 | Build-Depends: debhelper (>= 10) 6 | Standards-Version: 3.8.1 7 | Homepage: http://couchbase.com 8 | 9 | Package: @@PRODUCT@@ 10 | Architecture: any 11 | Depends: zlib1g 12 | Description: @@PRODUCT@@ 13 | Replaces: any 14 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase-edge-server/deb_templates/copyright.tmpl: -------------------------------------------------------------------------------- 1 | This package was debianized by Couchbase . 2 | 3 | Upstream Author(s): 4 | 5 | Couchbase 6 | 7 | Copyright: 8 | 9 | Copyright (C) 2025 Couchbase 10 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase-edge-server/deb_templates/postinst.tmpl: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | # postinst script for @@PRODUCT@@ 4 | # 5 | # see: dh_installdeb(1) 6 | 7 | case "${1}" in 8 | configure) 9 | chown -R @@PRODUCT_BASE@@:@@PRODUCT_BASE@@ @@PREFIX@@ 10 | ;; 11 | 12 | abort-upgrade|abort-remove|abort-deconfigure) 13 | ;; 14 | 15 | *) 16 | echo "postinst called with unknown argument ${1}" >&2 17 | exit 1 18 | ;; 19 | esac 20 | 21 | # dh_installdeb will replace this with shell code automatically 22 | # generated by other debhelper scripts. 23 | 24 | #DEBHELPER# 25 | 26 | exit 0 27 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase-edge-server/deb_templates/preinst.tmpl: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # preinst script for @@PRODUCT_BASE@@ software 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | : ${COUCHBASE_USER:=@@PRODUCT_BASE@@} 7 | : ${COUCHBASE_GROUP:=@@PRODUCT_BASE@@} 8 | CB_USR=`echo $COUCHBASE_USER` 9 | CB_GRP=`echo $COUCHBASE_GROUP` 10 | 11 | case "${1}" in 12 | install|upgrade) 13 | getent group $CB_GRP >/dev/null || \ 14 | groupadd -r $CB_GRP || exit 1 15 | getent passwd $CB_USR >/dev/null || \ 16 | useradd -r -g $CB_GRP -d @@PREFIX@@ -s /usr/sbin/nologin \ 17 | -c "$CB_USR system user" $CB_USR || exit 1 18 | exit 0 19 | ;; 20 | 21 | abort-upgrade) 22 | ;; 23 | 24 | *) 25 | echo "preinst called with unknown argument ${1}" >&2 26 | exit 1 27 | ;; 28 | esac 29 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase-edge-server/deb_templates/rules.tmpl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # 5 | # This file was originally written by Joey Hess and Craig Small. 6 | # As a special exception, when this file is copied by dh-make into a 7 | # dh-make output file, you may use that output file without restriction. 8 | # This special exception was added by Craig Small in version 0.37 of dh-make. 9 | # 10 | # Modified to make a template file for a multi-binary package with separated 11 | # build-arch and build-indep targets by Bill Allombert 2001 12 | 13 | # Uncomment this to turn on verbose mode. 14 | #export DH_VERBOSE=1 15 | 16 | # This has to be exported to make some magic below work. 17 | export DH_OPTIONS 18 | configure: configure-stamp 19 | configure-stamp: 20 | dh_testdir 21 | # Add here commands to configure the package. 22 | touch configure-stamp 23 | 24 | #Architecture 25 | build: build-arch build-indep 26 | 27 | build-arch: build-arch-stamp 28 | build-arch-stamp: configure-stamp 29 | # Add here commands to compile the arch part of the package. 30 | #$(MAKE) 31 | touch $@ 32 | 33 | build-indep: build-indep-stamp 34 | build-indep-stamp: configure-stamp 35 | # Add here commands to compile the indep part of the package. 36 | touch $@ 37 | 38 | clean: 39 | dh_testdir 40 | dh_testroot 41 | rm -f build-arch-stamp build-indep-stamp configure-stamp 42 | dh_clean 43 | 44 | install: install-indep install-arch 45 | 46 | install-indep: 47 | dh_testdir 48 | dh_testroot 49 | dh_prep -i 50 | dh_installdirs -i 51 | 52 | install-arch: 53 | dh_testdir 54 | dh_testroot 55 | dh_prep 56 | dh_installdirs 57 | 58 | # Must not depend on anything. This is to be called by 59 | # binary-arch/binary-indep 60 | # in another 'make' thread. 61 | binary-common: 62 | dh_testdir 63 | dh_testroot 64 | cp -a opt $(CURDIR)/debian/@@PRODUCT@@ 65 | dh_installchangelogs 66 | dh_systemd_enable --name=@@PRODUCT@@ 67 | dh_installinit 68 | dh_installdocs 69 | dh_systemd_start 70 | dh_installman 71 | dh_link 72 | dh_strip 73 | dh_compress -Xcopyright -XLICENSE.txt -Xchangelog* -Xnotices.txt 74 | dh_fixperms 75 | dh_installdeb 76 | #dh_shlibdeps 77 | dh_gencontrol 78 | dh_md5sums 79 | dh_builddeb -- -Zgzip 80 | 81 | # Build architecture independant packages using the common target. 82 | binary-indep: build-indep install-indep 83 | #$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common 84 | $(MAKE) -f debian/rules binary-common 85 | 86 | # Build architecture dependant packages using the common target. 87 | binary-arch: build-arch install-arch 88 | #$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common 89 | $(MAKE) -f debian/rules binary-common 90 | 91 | binary: binary-arch binary-indep 92 | .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure 93 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase-edge-server/deb_templates/watch.tmpl: -------------------------------------------------------------------------------- 1 | # Example watch control file for uscan 2 | # Rename this file to "watch" and then you can run the "uscan" command 3 | # to check for upstream updates and more. 4 | # See uscan(1) for format 5 | 6 | # Compulsory line, this is a version 3 file 7 | version=3 8 | 9 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase-edge-server/package-deb.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | #### /${PKGR} ${SOURCE} ${PRODUCT} ${PRODUCT_VERSION} ${ARCH} 4 | 5 | require 'rubygems' 6 | require 'fileutils' 7 | require 'rake' 8 | 9 | PRODUCT_BASE = "couchbase" 10 | 11 | STARTDIR = Dir.getwd() 12 | 13 | SOURCE = ARGV[0] || "#{STARTDIR}/couchbase-edge-server" 14 | PRODUCT = ARGV[1] || "#{PRODUCT_BASE}-edge-server" 15 | PRODUCT_VERSION = ARGV[2] || "1.0.0-1234" 16 | ARCH = ARGV[3] || `uname -m`.chomp 17 | 18 | VERSION = PRODUCT_VERSION.split('-')[0] # e.g., 1.0.0 19 | BLDNUM = PRODUCT_VERSION.split('-')[1] # e.g., 1234 20 | PKGNAME ="#{PRODUCT}_#{VERSION}" 21 | PREFIX ="/opt/#{PRODUCT}" 22 | 23 | sh %{echo "Packaging #{PRODUCT} for #{ARCH}"} 24 | STAGE_DIR = "#{STARTDIR}/build/deb/#{PKGNAME}-#{BLDNUM}" 25 | FileUtils.rm_rf "#{STAGE_DIR}" 26 | FileUtils.mkdir_p "#{STAGE_DIR}" 27 | FileUtils.mkdir_p "#{STAGE_DIR}/debian" 28 | FileUtils.mkdir_p "#{STAGE_DIR}/opt" 29 | 30 | [["#{STARTDIR}/deb_templates", "#{STAGE_DIR}/debian"]].each do |src_dst| 31 | Dir.chdir(src_dst[0]) do 32 | Dir.glob("*.tmpl").each do |x| 33 | target = "#{src_dst[1]}/#{x.gsub('.tmpl', '')}" 34 | sh %{sed -e s,@@PRODUCT_VERSION@@,#{PRODUCT_VERSION},g #{x} | 35 | sed -e s,@@PREFIX@@,#{PREFIX},g | 36 | sed -e s,@@PRODUCT@@,#{PRODUCT},g | 37 | sed -e s,@@PRODUCT_BASE@@,#{PRODUCT_BASE},g > #{target}} 38 | sh %{chmod a+x #{target}} 39 | end 40 | end 41 | end 42 | 43 | sh %{cp -R "#{SOURCE}" "#{STAGE_DIR}/opt/"} 44 | sh %{cp -R "#{STARTDIR}/service/#{PRODUCT}.service" "#{STAGE_DIR}/debian/"} 45 | 46 | Dir.chdir STAGE_DIR do 47 | sh %{dpkg-buildpackage -b -uc} 48 | end 49 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase-edge-server/package-rpm.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | #### ./${PKGR} ${SOURCE} ${PRODUCT} ${PRODUCT_VERSION} ${ARCH} 4 | 5 | require 'rubygems' 6 | require 'fileutils' 7 | require 'rake' 8 | 9 | PRODUCT_BASE = "couchbase" 10 | START_DIR = Dir.getwd() 11 | 12 | SOURCE = ARGV[0] || "#{STARTDIR}/couchbase-edge-server" 13 | PRODUCT = ARGV[1] || "couchbase-edge-server" 14 | PRODUCT_VERSION = ARGV[2] || "1.0-1234" 15 | ARCH = ARGV[5] || `uname -m`.chomp 16 | 17 | VERSION = PRODUCT_VERSION.split('-')[0] # e.g., 1.0.0 18 | BLDNUM = PRODUCT_VERSION.split('-')[1] # e.g., 1234 19 | PKGNAME="#{PRODUCT}_#{VERSION}-#{BLDNUM}" 20 | PREFIX ="/opt/#{PRODUCT}" 21 | 22 | STAGE_DIR = "#{START_DIR}/build/rpm/#{PKGNAME}" 23 | FileUtils.rm_rf "#{STAGE_DIR}/rpmbuild" 24 | FileUtils.mkdir_p "#{STAGE_DIR}/rpmbuild/SOURCES" 25 | FileUtils.mkdir_p "#{STAGE_DIR}/rpmbuild/BUILD" 26 | FileUtils.mkdir_p "#{STAGE_DIR}/rpmbuild/BUILDROOT" 27 | FileUtils.mkdir_p "#{STAGE_DIR}/rpmbuild/RPMS/#{ARCH}" 28 | 29 | 30 | [["#{START_DIR}/rpm_templates", "#{STAGE_DIR}" ]].each do |src_dst| 31 | Dir.chdir(src_dst[0]) do 32 | Dir.glob("rpm*.tmpl").each do |x| 33 | target = "#{src_dst[1]}/#{x.gsub('.tmpl', '')}" 34 | sh %{sed -e s,@@VERSION@@,#{VERSION},g #{x} | 35 | sed -e s,@@RELEASE@@,#{BLDNUM},g | 36 | sed -e s,@@PREFIX@@,#{PREFIX},g | 37 | sed -e s,@@PRODUCT@@,#{PRODUCT},g | 38 | sed -e s,@@PRODUCT_BASE@@,#{PRODUCT_BASE},g > #{target}} 39 | sh %{chmod a+x #{target}} 40 | end 41 | end 42 | end 43 | 44 | sh %{cp -R "#{START_DIR}/service/#{PRODUCT}.service" "#{STAGE_DIR}/rpmbuild/SOURCES"} 45 | Dir.chdir("#{START_DIR}") do 46 | sh %{tar --directory #{File.dirname(SOURCE)} -czf "#{STAGE_DIR}/rpmbuild/SOURCES/#{PRODUCT}_#{VERSION}.tar.gz" #{File.basename(SOURCE)}} 47 | end 48 | Dir.chdir("#{STAGE_DIR}") do 49 | sh %{rpmbuild -bb --define "_topdir #{STAGE_DIR}/rpmbuild" rpm.spec} 50 | end 51 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase-edge-server/service/couchbase-edge-server.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Couchbase Edge Server 3 | After=network.target 4 | StartLimitIntervalSec=60 5 | 6 | [Service] 7 | Type=simple 8 | User=couchbase 9 | WorkingDirectory=/opt/couchbase-edge-server/etc 10 | ExecStart=/usr/bin/bash -c 'PATH=/opt/couchbase-edge-server/bin:$PATH couchbase-edge-server config.json' 11 | Restart=on-failure 12 | # Give a reasonable amount of time before the service tries to restart 13 | RestartSec=10 14 | 15 | # log with journald 16 | StandardError=journal 17 | StandardOutput=journal 18 | 19 | [Install] 20 | WantedBy=multi-user.target 21 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase_server/download_file.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # a simple script to download a file from an URL if the file exists 3 | # as simple as it sounds, there is nothing like this on windows 4 | # command line short of installing wget for windows on the VM 5 | 6 | import sys 7 | import urllib2 8 | 9 | #if these args are not set, just let it throw error 10 | #thus automatically failing the script 11 | url=sys.argv[1] 12 | local_file=sys.argv[2] 13 | 14 | try: 15 | f = urllib2.urlopen(url) 16 | except: 17 | # if file doesn't exist it is ok 18 | sys.exit(0) 19 | 20 | with open(local_file, "wb") as exefile: 21 | exefile.write(f.read()) 22 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase_server/run-go-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir -p ~/go 4 | GOPATH=~/go go get -u github.com/jstemmer/go-junit-report 5 | export PATH=$PATH:~/go/bin 6 | 7 | export GOPATH=${WORKSPACE}/godeps:${WORKSPACE}/goproj 8 | 9 | function go_test() { 10 | dir=$1 11 | pushd $dir 12 | 13 | echo "Running Go tests in dir: $dir" 14 | echo 15 | go test ./... -v | go-junit-report > gotest-report.xml 16 | 17 | popd 18 | } 19 | 20 | #go_test godeps/src/github.com/blevesearch/bleve 21 | go_test godeps/src/github.com/blevesearch/go-porterstemmer 22 | go_test godeps/src/github.com/blevesearch/segment 23 | go_test godeps/src/github.com/couchbase/blance 24 | go_test goproj/src/github.com/couchbase/cbgt 25 | #go_test goproj/src/github.com/couchbase/query/test/filestore # godeps/src/github.com/andelf/go-curl/callback.go:6:10: fatal error: curl/curl.h: No such file or directory 26 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase_server/server-simple-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | # This job assumes that it is run in the same Workspace as a successful 4 | # Sherlock build. 5 | # 6 | # Required job parameters (expected to be in environment): 7 | # 8 | # WORKSPACE - from Jenkins 9 | # PLATFORM - from upstream job (to name archived logs) 10 | 11 | if [ "${EDITION}" = "community" ] 12 | then 13 | echo Skipping simple-test for community build 14 | exit 0 15 | fi 16 | 17 | echo 18 | echo =============== Run simple-test 19 | echo 20 | cd ${WORKSPACE}/testrunner 21 | export COUCHBASE_REPL_TYPE=upr 22 | failed=0 23 | make simple-test || failed=1 24 | sudo killall -9 beam.smp epmd memcached python >/dev/null || true 25 | if [ $failed = 1 ] 26 | then 27 | echo Tests failed - aborting run 28 | exit 3 29 | fi 30 | zip cluster_run_log_${PLATFORM} cluster_run.log 31 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase_server/sherlock-poller.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Launched by "repo-sherlock" to see if a new build needs to be triggered. 3 | # 4 | # Expects "PRODUCT_BRANCH" to be specified in the environment. 5 | 6 | # Clean previous artifacts. 7 | rm -f current.xml trigger.properties 8 | 9 | # Check out the build-team-manifests project to compare with the previous build. 10 | git config --global user.name "Couchbase Build Team" 11 | git config --global user.email "build-team@couchbase.com" 12 | git config --global color.ui false 13 | if [ ! -d build-team-manifests ] 14 | then 15 | git clone ssh://git@github.com/couchbase/build-team-manifests 16 | else 17 | (cd build-team-manifests; git pull) 18 | fi 19 | (cd build-team-manifests; git checkout ${PRODUCT_BRANCH}) 20 | 21 | # Write out the current build manifest. 22 | repo manifest -r > current.xml 23 | 24 | # See if it is different than the tip of build-team-manifests. 25 | diffchars=`repo diffmanifests ${WORKSPACE}/current.xml ${WORKSPACE}/build-team-manifests/sherlock.xml --raw | wc -c` 26 | if [ "${diffchars}" = "0" ] 27 | then 28 | echo "No differences since last build - not triggering downstream build" 29 | else 30 | # Create trigger.properties with dummy content, to make Jenkins trigger 31 | # the downstream build 32 | echo "BUILD=yes" > trigger.properties 33 | echo "Manifest differences found - triggering downstream build!" 34 | fi 35 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase_server/sherlock-trigger.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Launched by the job "sherlock-build" to start a new build. 3 | # 4 | # Expects "PRODUCT_BRANCH" and "VERSION" to be specified in the environment, 5 | # in addition to "WORKSPACE". 6 | 7 | # Checkout out the build-team-manifests project to save the build manifest 8 | # for downstream builds. 9 | git config --global user.name "Couchbase Build Team" 10 | git config --global user.email "build-team@couchbase.com" 11 | git config --global color.ui false 12 | if [ ! -d build-team-manifests ] 13 | then 14 | git clone ssh://git@github.com/couchbase/build-team-manifests 15 | fi 16 | (cd build-team-manifests && git checkout ${PRODUCT_BRANCH} && git pull) 17 | 18 | # Save a copy of the previous build manifest before overwriting it. 19 | cp build-team-manifests/sherlock.xml .repo/manifests/last-build.xml 20 | 21 | # Write out the new build manifest. 22 | repo manifest -r > build-team-manifests/sherlock.xml 23 | 24 | # Play fun repo games to figure out the last build's build number, and add 1. 25 | repo init -m last-build.xml -g all 26 | bldnum=$(( `repo forall build -c 'echo $REPO__BLD_NUM'` + 1)) 27 | 28 | # Update and commit the new build manifest 29 | cd build-team-manifests 30 | sed -i "s/@BLD_NUM@/${bldnum}/g" sherlock.xml 31 | git add sherlock.xml 32 | msg="Sherlock '${PRODUCT_BRANCH}' build ${VERSION}-${bldnum} at "`date` 33 | git commit --allow-empty -m "$msg" 34 | git push origin HEAD:${PRODUCT_BRANCH} 35 | 36 | # Also save it with the right name for uploading to latestbuilds. 37 | rm -f ${WORKSPACE}/*.xml 38 | cp sherlock.xml ${WORKSPACE}/couchbase-server-${VERSION}-${bldnum}-manifest.xml 39 | 40 | # Save the new commit SHA and the build number for downstream jobs in 41 | # "trigger.properties". 42 | echo -n "MANIFEST_SHA=" > ${WORKSPACE}/trigger.properties 43 | git rev-parse HEAD >> ${WORKSPACE}/trigger.properties 44 | echo "BLD_NUM=${bldnum}" >> ${WORKSPACE}/trigger.properties 45 | 46 | # Update the reporef mirror for downstream jobs that can share it. 47 | mkdir -p ~/reporef 48 | cd ~/reporef 49 | if [ ! -d .repo ] 50 | then 51 | repo init -u https://github.com/couchbase/manifest -g all -m sherlock.xml --mirror 52 | fi 53 | repo sync --jobs=6 54 | -------------------------------------------------------------------------------- /scripts/jenkins/couchbase_server/watson-poller.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | # Launched by "repo-watson" to see if a new build needs to be triggered. 3 | # 4 | # Expects "PRODUCT_BRANCH" to be specified in the environment. 5 | 6 | # Clean previous artifacts. 7 | rm -f current.xml trigger.properties 8 | 9 | # Check out the build-team-manifests project to compare with the previous build. 10 | git config --global user.name "Couchbase Build Team" 11 | git config --global user.email "build-team@couchbase.com" 12 | git config --global color.ui false 13 | if [ ! -d build-team-manifests ] 14 | then 15 | git clone ssh://git@github.com/couchbase/build-team-manifests 16 | else 17 | (cd build-team-manifests; git pull) 18 | fi 19 | (cd build-team-manifests; git checkout ${PRODUCT_BRANCH}) 20 | 21 | # Write out the current build manifest. 22 | repo manifest -r > current.xml 23 | 24 | # See if it is different than the tip of build-team-manifests. 25 | diffchars=`repo diffmanifests ${WORKSPACE}/current.xml ${WORKSPACE}/build-team-manifests/watson.xml --raw | wc -c` 26 | if [ "${diffchars}" = "0" ] 27 | then 28 | echo "No differences since last build - not triggering downstream build" 29 | else 30 | # Create trigger.properties with dummy content, to make Jenkins trigger 31 | # the downstream build 32 | echo "BUILD=yes" > trigger.properties 33 | echo "Manifest differences found - triggering downstream build!" 34 | fi 35 | -------------------------------------------------------------------------------- /scripts/jenkins/groovy/custom-text.groovy: -------------------------------------------------------------------------------- 1 | GENERAL INFO 2 | 3 | BUILD ${build.result} 4 | Build URL: ${rooturl}${build.url} 5 | Project: ${project.name} 6 | Date of build: ${it.timestampString} 7 | Build duration: ${build.durationString} 8 | 9 | <% def timeout = build.getEnvironment(listener).get('TIMEOUT_VALUE').toInteger() 10 | if (build.duration > timeout) { %> 11 | *** BUILD TIMED OUT (POSSIBLY STUCK) *** 12 | Build Duration: ${build.duration} 13 | Timeout value: ${timeout} 14 | <% 15 | } 16 | %> 17 | 18 | <% def arts = build.getArtifacts() 19 | def artdir = build.getArtifactsDir() 20 | def junitResultList = it.JUnitTestResult 21 | if (junitResultList.size() > 0) { %> 22 | FAILED TESTS: 23 | <% junitResultList.eachWithIndex{ junitResult, index -> 24 | i_plus_one = index+1 25 | junitResult.getChildren().each { packageResult -> 26 | packageResult.getFailedTests().each{ failed_test -> %> 27 | ${i_plus_one}. FAILED - ${failed_test.getFullName()} 28 | Stack Trace: ${failed_test.getErrorStackTrace()} 29 | <%def tname = failed_test.getName() 30 | def log_folder = tname.substring(tname.indexOf("logs/testrunner")) 31 | def rel_log_folder = log_folder.substring(0, log_folder.indexOf(",")) 32 | for (String art: arts) { 33 | if (art.startsWith(rel_log_folder)) { %> 34 | LOG FILE: ${rooturl}${build.url}artifact/${art} 35 | <% } 36 | } 37 | } 38 | } 39 | } 40 | } %> 41 | 42 | -------------------------------------------------------------------------------- /scripts/jenkins/groovy/email_to.groovy: -------------------------------------------------------------------------------- 1 | <% 2 | def authors = "" 3 | 4 | def distro = build.environment["DISTRO"] 5 | if (distro == "centos7") { 6 | authors = "build-team@couchbase.com,eric.cooper@couchbase.com" 7 | } 8 | %> 9 | 10 | ${authors} 11 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-android/android-maven-verification.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PRODUCT=$1 4 | RELEASE_VERSION=$2 5 | PUBLISH_URL=$3 6 | 7 | mkdir -p ${WORKSPACE}/tmp 8 | pushd ${WORKSPACE}/tmp 9 | find ${WORKSPACE}/caches -type f -name "couchbase*.aar" | xargs jar xvf 10 | 11 | # Error if grep returns 0 for CE packages 12 | for i in DatabaseEndpoint.class EncryptionKey.class; do 13 | jar tvf classes.jar | grep $i 14 | if [ $? == 0 ] && [ "${PRODUCT}" == 'couchbase-lite-android' ]; then 15 | echo "Error, Encryption keys found CE package" 16 | exit 1 17 | fi 18 | done 19 | 20 | popd 21 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-android/maven-publish-verification/.gitignore: -------------------------------------------------------------------------------- 1 | *.jar 2 | !gradle/wrapper/gradle-wrapper.jar 3 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-android/maven-publish-verification/README.md: -------------------------------------------------------------------------------- 1 | # gradle-sample 2 | This is a test HelloWorld gradle project to verify gradle dependencies 3 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-android/maven-publish-verification/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | def RELEASE_VERSION = System.getenv('RELEASE_VERSION') 4 | def PUBLISH_URL = System.getenv('PUBLISH_URL') 5 | def PRODUCT = System.getenv('PRODUCT') 6 | def GROUP_ID = 'com.couchbase.lite' 7 | 8 | task wrapper(type: Wrapper) { 9 | gradleVersion = '4.8.1' // version required 10 | } 11 | 12 | repositories { 13 | maven { 14 | url PUBLISH_URL 15 | mavenCentral() 16 | } 17 | } 18 | 19 | dependencies { 20 | implementation GROUP_ID + ':' + PRODUCT + ':' + RELEASE_VERSION 21 | } 22 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-android/maven-publish-verification/src/main/java/hello/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package hello; 2 | 3 | public class HelloWorld { 4 | public static void main(String[] args) { 5 | System.out.println("Hello world!"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-android/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | releases 9 | ${publish.username} 10 | ${publish.password} 11 | 12 | 13 | ossrh 14 | ${publish.username} 15 | ${publish.password} 16 | 17 | 18 | 19 | 20 | org.sonatype.plugins 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-c/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED (VERSION 3.1) 2 | CMAKE_POLICY (VERSION 3.1) 3 | 4 | # Tell CMake to use headers / frameworks from SDK inside XCode instead of 5 | # the ones found on the system (for weak linking). Ignored on non-Apple 6 | SET(CMAKE_OSX_SYSROOT macosx) 7 | 8 | # Top-level CMakeLists for Couchbase Lite Core 9 | PROJECT (couchbase-lite-c-build) 10 | 11 | # Provide reasonable default for CMAKE_INSTALL_PREFIX 12 | IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 13 | SET(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install" CACHE STRING 14 | "The install location" FORCE) 15 | LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}") 16 | ENDIF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 17 | 18 | # Configure tlm the way it wants to be configured 19 | SET (CB_DOWNLOAD_DEPS 1) 20 | SET (CB_DOWNLOAD_DEPS_DEFAULT_MANIFEST 21 | "${PROJECT_SOURCE_DIR}/cbbuild/scripts/jenkins/lite-c/manifest.cmake") 22 | LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tlm/cmake/Modules") 23 | ADD_SUBDIRECTORY (tlm/deps) 24 | if("${EDITION}" STREQUAL "enterprise") 25 | message(STATUS "Building Enterprise Edition...") 26 | set(BUILD_ENTERPRISE ON CACHE BOOL "Set whether or not to build enterprise edition") 27 | else() 28 | message(STATUS "Building Community Edition because EDITION was set to ${EDITION}...") 29 | endif() 30 | 31 | ADD_SUBDIRECTORY (couchbase-lite-c) 32 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-c/deb_templates/README.Debian.tmpl: -------------------------------------------------------------------------------- 1 | @@PRODUCT@@ for Debian 2 | ---------------------------- 3 | 4 | @@PRODUCT@@ distribution for Debian 5 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-c/deb_templates/changelog.tmpl: -------------------------------------------------------------------------------- 1 | @@PRODUCT@@ (@@VERSION@@) UNRELEASED; urgency=low 2 | 3 | * Initial debian package for @@PRODUCT@@ @@VERSION@@ 4 | 5 | -- Tue, 30 Mar 2010 12:20:21 -0700 6 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-c/deb_templates/compat.tmpl: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-c/deb_templates/control.tmpl: -------------------------------------------------------------------------------- 1 | Source: @@PRODUCT@@ 2 | Section: web 3 | Priority: extra 4 | Maintainer: Couchbase 5 | Build-Depends: debhelper (>= 10) 6 | Standards-Version: 3.8.1 7 | Homepage: http://couchbase.com 8 | 9 | Package: @@PRODUCT@@ 10 | Architecture: any 11 | Depends: @@CUSTOM_DEPENDENCIES@@ 12 | Description: @@PRODUCT@@ 13 | Replaces: any 14 | Breaks: @@OTHER_PRODUCTS@@ 15 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-c/deb_templates/copyright.tmpl: -------------------------------------------------------------------------------- 1 | This package was debianized by Couchbase . 2 | 3 | Upstream Author(s): 4 | 5 | Couchbase 6 | 7 | Copyright: 8 | 9 | Copyright (C) 2021 Couchbase 10 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-c/deb_templates/rules.tmpl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # 5 | # This file was originally written by Joey Hess and Craig Small. 6 | # As a special exception, when this file is copied by dh-make into a 7 | # dh-make output file, you may use that output file without restriction. 8 | # This special exception was added by Craig Small in version 0.37 of dh-make. 9 | # 10 | # Modified to make a template file for a multi-binary package with separated 11 | # build-arch and build-indep targets by Bill Allombert 2001 12 | 13 | # Uncomment this to turn on verbose mode. 14 | #export DH_VERBOSE=1 15 | 16 | # This has to be exported to make some magic below work. 17 | export DH_OPTIONS 18 | configure: configure-stamp 19 | configure-stamp: 20 | dh_testdir 21 | # Add here commands to configure the package. 22 | touch configure-stamp 23 | 24 | #Architecture 25 | build: build-arch build-indep 26 | 27 | build-arch: build-arch-stamp 28 | build-arch-stamp: configure-stamp 29 | # Add here commands to compile the arch part of the package. 30 | #$(MAKE) 31 | touch $@ 32 | 33 | build-indep: build-indep-stamp 34 | build-indep-stamp: configure-stamp 35 | # Add here commands to compile the indep part of the package. 36 | touch $@ 37 | 38 | clean: 39 | dh_testdir 40 | dh_testroot 41 | rm -f build-arch-stamp build-indep-stamp configure-stamp 42 | dh_clean 43 | 44 | install: install-indep install-arch 45 | 46 | install-indep: 47 | dh_testdir 48 | dh_testroot 49 | dh_prep -i 50 | dh_installdirs -i 51 | 52 | install-arch: 53 | dh_testdir 54 | dh_testroot 55 | dh_prep 56 | dh_installdirs 57 | 58 | # Must not depend on anything. This is to be called by 59 | # binary-arch/binary-indep 60 | # in another 'make' thread. 61 | binary-common: 62 | dh_testdir 63 | dh_testroot 64 | cp -a usr $(CURDIR)/debian/@@PRODUCT@@ 65 | dh_installchangelogs 66 | dh_installinit --no-start 67 | dh_installdocs 68 | dh_installman 69 | dh_link 70 | #dh_strip 71 | dh_compress -Xcopyright -XLICENSE.txt -Xchangelog* -Xnotices.txt 72 | dh_fixperms 73 | dh_installdeb 74 | #dh_shlibdeps 75 | dh_gencontrol 76 | dh_md5sums 77 | dh_builddeb -- -Zgzip 78 | 79 | # Build architecture independant packages using the common target. 80 | binary-indep: build-indep install-indep 81 | #$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common 82 | $(MAKE) -f debian/rules binary-common 83 | 84 | # Build architecture dependant packages using the common target. 85 | binary-arch: build-arch install-arch 86 | #$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common 87 | $(MAKE) -f debian/rules binary-common 88 | 89 | binary: binary-arch binary-indep 90 | .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure 91 | 92 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-c/deb_templates/watch.tmpl: -------------------------------------------------------------------------------- 1 | # Example watch control file for uscan 2 | # Rename this file to "watch" and then you can run the "uscan" command 3 | # to check for upstream updates and more. 4 | # See uscan(1) for format 5 | 6 | # Compulsory line, this is a version 3 file 7 | version=3 8 | 9 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-c/manifest.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Keep the list sorted alphabetically, and the platforms alphabetically. 3 | # The syntax is: 4 | # 5 | # DECLARE_DEP (name VERSION version-revision PLATFORMS platform1 platform2) 6 | # 7 | DECLARE_DEP (icu4c VERSION 54.1-cb10 PLATFORMS centos7) 8 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED (VERSION 3.19) 2 | CMAKE_POLICY (VERSION 3.19) 3 | 4 | # Tell CMake to use headers / frameworks from SDK inside XCode instead of 5 | # the ones found on the system (for weak linking). Ignored on non-Apple 6 | SET(CMAKE_OSX_SYSROOT macosx) 7 | 8 | # Top-level CMakeLists for Couchbase Lite Core 9 | PROJECT (couchbase-lite-core-build) 10 | 11 | # Provide reasonable default for CMAKE_INSTALL_PREFIX 12 | IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 13 | SET(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install" CACHE STRING 14 | "The install location" FORCE) 15 | LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}") 16 | ENDIF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 17 | 18 | # Configure tlm the way it wants to be configured 19 | SET (CB_DOWNLOAD_DEPS 1) 20 | SET (CB_DOWNLOAD_DEPS_DEFAULT_MANIFEST 21 | "${PROJECT_SOURCE_DIR}/cbbuild/scripts/jenkins/lite-core/manifest.cmake") 22 | LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/tlm/cmake/Modules") 23 | ADD_SUBDIRECTORY (tlm/deps) 24 | if("${EDITION}" STREQUAL "enterprise") 25 | message(STATUS "Building Enterprise Edition...") 26 | set(BUILD_ENTERPRISE ON CACHE BOOL "Set whether or not to build enterprise edition") 27 | else() 28 | message(STATUS "Building Community Edition because EDITION was set to ${EDITION}...") 29 | endif() 30 | 31 | ADD_SUBDIRECTORY (couchbase-lite-core) 32 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-core/manifest.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Keep the list sorted alphabetically, and the platforms alphabetically. 3 | # The syntax is: 4 | # 5 | # DECLARE_DEP (name VERSION version-revision PLATFORMS platform1 platform2) 6 | # 7 | DECLARE_DEP (icu4c VERSION 54.1-cb10 PLATFORMS centos7) 8 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-ios/carthage-publish.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | ''' Script to update Carthage JSON provisioning file for each CBL iOS release 3 | ''' 4 | 5 | import argparse 6 | import json 7 | import sys 8 | from collections import OrderedDict 9 | 10 | 11 | def parse_json_file(file): 12 | ''' 13 | Parse content of input JSON file, return data dictionary 14 | ''' 15 | try: 16 | with open(file) as content: 17 | try: 18 | data = json.load(content, object_pairs_hook=OrderedDict) 19 | except json.JSONDecodeError: 20 | print("Invalid JSON content!") 21 | sys.exit(1) 22 | except IOError: 23 | print("Could not open file: {}".format(file)) 24 | sys.exit(1) 25 | return data 26 | 27 | 28 | def update_json_file(args): 29 | ''' 30 | Update Carthage JSON file with CBL iOS release version on S3 31 | ''' 32 | CBL_IOS_S3_URL = 'https://packages.couchbase.com/releases/couchbase-lite-ios' 33 | CARTHAGE_PKG_NAME = 'couchbase-lite-carthage-{}-{}.zip'.format(args.edition, args.version) 34 | 35 | data_dict = parse_json_file(args.file) 36 | data_dict[args.version] = '{}/{}/{}'.format(CBL_IOS_S3_URL, args.version, CARTHAGE_PKG_NAME) 37 | 38 | try: 39 | with open(args.file, mode='w') as f: 40 | try: 41 | f.write(json.dumps(data_dict, indent=4)) 42 | except json.JSONDecodeError: 43 | print("Invalid JSON output!") 44 | sys.exit(1) 45 | except IOError: 46 | print("Cannot write to file: {}").format(args.file) 47 | sys.exit(1) 48 | 49 | 50 | def parse_args(): 51 | parser = argparse.ArgumentParser(description="Publish Carthage Provision File on S3\n\n") 52 | parser.add_argument('--version', '-v', help='Carthage Version', 53 | required=True) 54 | parser.add_argument('--file', '-f', help='JSON file', required=True) 55 | parser.add_argument('--edition', '-e', help='Carthage Package Edition', 56 | required=True) 57 | return parser.parse_args() 58 | 59 | 60 | def main(): 61 | args = parse_args() 62 | update_json_file(args) 63 | 64 | 65 | if __name__ == '__main__': 66 | main() 67 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-ios/update-cocoapods.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # virtualenv stuff 4 | export LC_ALL=C 5 | export LANG=en_US.UTF-8 6 | 7 | pip3 install --user --upgrade virtualenv 8 | 9 | # start virtualenv 10 | /home/couchbase/.local/bin/virtualenv COCOAPODS || exit 1 11 | source ./COCOAPODS/bin/activate || exit 1 12 | 13 | # Checkout required repo 14 | cd ${WORKSPACE} && git clone git@github.com:couchbaselabs/couchbase-lite-ios-ee.git couchbase-lite-ios-ee 15 | cd couchbase-lite-ios-ee 16 | git checkout ${BRANCH} 17 | 18 | cd ${WORKSPACE}/couchbase-lite-ios-ee/Podspecs 19 | declare -a JSON_FILES=( $(ls) ) 20 | for fl in "${JSON_FILES[@]}"; do 21 | python3 ${WORKSPACE}/build/scripts/jenkins/lite-ios/cocoapods-publish.py --version ${VERSION} --file $fl || exit 1 22 | done 23 | 24 | # deactivate virtualenv 25 | echo "Deactivating virtualenv ..." 26 | deactivate 27 | echo 28 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-java/java-maven-verification.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PRODUCT=$1 4 | RELEASE_VERSION=$2 5 | PUBLISH_URL=$3 6 | 7 | mkdir -p ${WORKSPACE}/tmp 8 | pushd ${WORKSPACE}/tmp 9 | find ${WORKSPACE}/caches -type f -name "couchbase*.aar" | xargs jar xvf 10 | 11 | # Error if grep returns 0 for CE packages 12 | for i in DatabaseEndpoint.class EncryptionKey.class; do 13 | jar tvf classes.jar | grep $i 14 | if [ $? == 0 ] && [ "${PRODUCT}" == 'couchbase-lite-android' ]; then 15 | echo "Error, Encryption keys found CE package" 16 | exit 1 17 | fi 18 | done 19 | 20 | popd 21 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-java/maven-publish-verification/.gitignore: -------------------------------------------------------------------------------- 1 | *.jar 2 | !gradle/wrapper/gradle-wrapper.jar 3 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-java/maven-publish-verification/README.md: -------------------------------------------------------------------------------- 1 | # gradle-sample 2 | This is a test HelloWorld gradle project to verify gradle dependencies 3 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-java/maven-publish-verification/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | def RELEASE_VERSION = System.getenv('RELEASE_VERSION') 4 | def PUBLISH_URL = System.getenv('PUBLISH_URL') 5 | def PRODUCT = System.getenv('PRODUCT') 6 | def GROUP_ID = 'com.couchbase.lite' 7 | 8 | task wrapper(type: Wrapper) { 9 | gradleVersion = '4.8.1' // version required 10 | } 11 | 12 | repositories { 13 | maven { 14 | url PUBLISH_URL 15 | mavenCentral() 16 | } 17 | } 18 | 19 | dependencies { 20 | implementation GROUP_ID + ':' + PRODUCT + ':' + RELEASE_VERSION 21 | } 22 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-java/maven-publish-verification/src/main/java/hello/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package hello; 2 | 3 | public class HelloWorld { 4 | public static void main(String[] args) { 5 | System.out.println("Hello world!"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /scripts/jenkins/lite-java/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | releases 9 | ${publish.username} 10 | ${publish.password} 11 | 12 | 13 | ossrh 14 | ${publish.username} 15 | ${publish.password} 16 | 17 | 18 | 19 | 20 | org.sonatype.plugins 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /scripts/jenkins/mobile/ami/README-ENDUSER.md: -------------------------------------------------------------------------------- 1 | 2 | Running the Couchbase Mobile AMI 3 | 4 | ## Overview 5 | 6 | The Couchbase Mobile AMI has the following components included: 7 | 8 | * Couchbase Server (single-node) 9 | * Sync Gateway 10 | 11 | ## Quickstart 12 | 13 | * Choose AMI with the appropriate region 14 | * Click the "Launch with EC2 console" button 15 | * Configure Instance Details / Advanced Details 16 | * Paste the [user-data.sh](https://raw.githubusercontent.com/couchbase/build/master/scripts/jenkins/mobile/ami/user-data.sh) script contents into the text area in Advanced Details 17 | * If you want to run a custom Sync Gateway configuration, you should customize the variables in the Customization section of the user-data.sh script you just pasted. You can set the Sync Gateway config to any public URL and will need to update the Couchbase Server bucket name to match what's in your config. 18 | * Edit your Security Group to expose port 4984 to Anywhere 19 | 20 | ## Verify 21 | 22 | * Find the Public DNS entry of the instance you just launched 23 | * Open `http://:4984` in your web browser 24 | * You should get a 200 OK response with JSON content that has the Sync Gateway version 25 | 26 | ## Explore Couchbase Server 27 | 28 | * In the AWS console, find the instance-id of the running instance (eg, i-56b1accd) 29 | * Edit the Security Group for the running instance to enable access to port `8091` 30 | * Open `http://:8091` in your web browser 31 | * Login with **Administrator**/**[ec2 instance-id]** 32 | 33 | ## Explore Sync Gateway 34 | 35 | * See the [Sync Gateway REST API docs](http://developer.couchbase.com/documentation/mobile/1.2/develop/references/sync-gateway/index.html) for more information on using Sync Gateway 36 | * Install a [Sample App](http://developer.couchbase.com/documentation/mobile/current/develop/samples/samples/index.html) and set it up to Sync it's data with Sync Gateway 37 | -------------------------------------------------------------------------------- /scripts/jenkins/mobile/ami/README.md: -------------------------------------------------------------------------------- 1 | 2 | This has moved to [sync-gateway-ami](https://github.com/couchbase/sync-gateway-ami) 3 | 4 | Anything remaining here is for Sync Gateway 1.3 compatibility, and should removed once the AMI's for Sync Gateway 1.4 have been released. 5 | 6 | 7 | -------------------------------------------------------------------------------- /scripts/jenkins/mobile/prepare_release_ios.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run from manual jobs: prepare_release_ios_master 4 | # prepare_release_ios_100 5 | # 6 | # to download an iOS ZIP file and upload it with a new number. 7 | # 8 | # called with paramters: 9 | # 10 | # BLD_NUM number of ZIP file to download (0.0.0-1234) 11 | # REL_NUM number/name to release as (0.0.0, 0.0.0-beta) 12 | # EDITION 'community' or 'enterprise' 13 | # 14 | source ~/.bash_profile 15 | set -e 16 | 17 | PUT_CMD="s3cmd put -P" 18 | GET_CMD="s3cmd get" 19 | 20 | function usage 21 | { 22 | echo -e "\nuse: ${0} bld_to_release release_number edition\n\n" 23 | } 24 | 25 | if [[ ! ${1} ]] ; then usage ; exit 99 ; fi 26 | BLD_NUM=${1} 27 | vrs_rex='^([0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}(\.[0-9]{1,})?)' 28 | if [[ ${BLD_NUM} =~ $vrs_rex ]] 29 | then 30 | VERSION=${BASH_REMATCH[1]} 31 | else 32 | echo "illegal value for BLD_NUM: "'>>'${BLD_NUM}'<<' 33 | exit 88 34 | fi 35 | 36 | if [[ ! ${2} ]] ; then usage ; exit 88 ; fi 37 | REL_NUM=${2} 38 | 39 | PKG_SRC=s3://packages.couchbase.com/builds/mobile/ios/${VERSION}/${BLD_NUM} 40 | PKG_DEST=s3://packages.couchbase.com/builds/mobile/ios/${VERSION}/${REL_NUM} 41 | 42 | 43 | if [[ ! ${3} ]] ; then usage ; exit 77 ; fi 44 | EDITION=${3} 45 | 46 | IOS_ZIP_SRC=couchbase-lite-ios-${EDITION}_${BLD_NUM}.zip 47 | IOS_ZIP_DST=couchbase-lite-ios-${EDITION}_${REL_NUM}.zip 48 | 49 | DOC_ZIP_SRC=couchbase-lite-ios-${EDITION}_${BLD_NUM}_Documentation.zip 50 | DOC_ZIP_DST=couchbase-lite-ios-${EDITION}_${REL_NUM}_Documentation.zip 51 | 52 | 53 | ############################################################################## S T A R T 54 | echo ============================================ `date` 55 | env | grep -iv password | grep -iv passwd | sort 56 | 57 | echo ============================================ download ${PKG_SRC}/${IOS_ZIP_SRC} 58 | ${GET_CMD} ${PKG_SRC}/${IOS_ZIP_SRC} 59 | mv ${IOS_ZIP_SRC} ${IOS_ZIP_DST} 60 | echo ============================================ uploading ${PKG_DEST}/${IOS_ZIP_DST} 61 | ${PUT_CMD} ${IOS_ZIP_DST} ${PKG_DEST}/${IOS_ZIP_DST} 62 | 63 | echo ============================================ download ${PKG_SRC}/${DOC_ZIP_SRC} 64 | ${GET_CMD} ${PKG_SRC}/${DOC_ZIP_SRC} 65 | mv ${DOC_ZIP_SRC} ${DOC_ZIP_DST} 66 | echo ============================================ uploading ${PKG_DEST}/${DOC_ZIP_DST} 67 | ${PUT_CMD} ${DOC_ZIP_DST} ${PKG_DEST}/${DOC_ZIP_DST} 68 | 69 | echo ============================================ `date` 70 | -------------------------------------------------------------------------------- /scripts/jenkins/mobile/prepare_release_sgw.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run from manual jobs: prepare_release_sgw_master 4 | # prepare_release_sgw_100 5 | # 6 | # to download an Sync Gateway ZIP file and upload it with a new number. 7 | # 8 | # called with paramters: 9 | # 10 | # BLD_NUM number of ZIP file to download (0.0.0-1234) 11 | # REL_NUM number/name to release as (0.0.0, 0.0.0-beta) 12 | # EDITION 'community' or 'enterprise' 13 | # 14 | source ~/.bash_profile 15 | set -e 16 | 17 | PUT_CMD="s3cmd put -P" 18 | GET_CMD="s3cmd get" 19 | 20 | function usage 21 | { 22 | echo -e "\nuse: ${0} branch bld_to_release release_number edition\n\n" 23 | } 24 | 25 | if [[ ! ${1} ]] ; then usage ; exit 99 ; fi 26 | BLD_NUM=${1} 27 | vrs_rex='^([0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}(\.[0-9]{1,})?)' 28 | if [[ ${BLD_NUM} =~ $vrs_rex ]] 29 | then 30 | VERSION=${BASH_REMATCH[1]} 31 | else 32 | echo "illegal value for BLD_NUM: "'>>'${BLD_NUM}'<<' 33 | exit 88 34 | fi 35 | 36 | if [[ ! ${2} ]] ; then usage ; exit 88 ; fi 37 | REL_NUM=${2} 38 | 39 | PKG_SRC=s3://packages.couchbase.com/builds/mobile/sync_gateway/${VERSION}/${BLD_NUM} 40 | PKG_DEST=s3://packages.couchbase.com/builds/mobile/sync_gateway/${VERSION}/${REL_NUM} 41 | 42 | if [[ ! ${3} ]] ; then usage ; exit 77 ; fi 43 | EDITION=${3} 44 | 45 | SGW_SRC_LIST=" \ 46 | couchbase-sync-gateway-${EDITION}_${BLD_NUM}_x86.rpm \ 47 | couchbase-sync-gateway-${EDITION}_${BLD_NUM}_x86_64.rpm \ 48 | couchbase-sync-gateway-${EDITION}_${BLD_NUM}_x86.deb \ 49 | couchbase-sync-gateway-${EDITION}_${BLD_NUM}_x86_64.deb \ 50 | couchbase-sync-gateway-${EDITION}_${BLD_NUM}_x86_64.tar.gz \ 51 | couchbase-sync-gateway-${EDITION}_${BLD_NUM}_x86.exe \ 52 | couchbase-sync-gateway-${EDITION}_${BLD_NUM}_x86_64.exe \ 53 | " 54 | 55 | 56 | ############################################################################## S T A R T 57 | echo ============================================ `date` 58 | env | grep -iv password | grep -iv passwd | sort 59 | 60 | for PKG in ${SGW_SRC_LIST} 61 | do 62 | NEW_PKG=`echo ${PKG} | sed "s/${BLD_NUM}/${REL_NUM}/"` 63 | echo ============================================ download ${PKG_SRC}/${PKG} 64 | ${GET_CMD} ${PKG_SRC}/${PKG} 65 | mv ${PKG} ${NEW_PKG} 66 | echo ============================================== upload ${PKG_DEST}/${NEW_PKG} 67 | ${PUT_CMD} ${NEW_PKG} ${PKG_DEST}/${NEW_PKG} 68 | echo 69 | done 70 | 71 | echo ============================================ `date` 72 | -------------------------------------------------------------------------------- /scripts/jenkins/mobile/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: / 3 | -------------------------------------------------------------------------------- /scripts/jenkins/mobile/zip_jars/settings.xml: -------------------------------------------------------------------------------- 1 | 5 | 8 | m2 9 | 10 | 11 | 12 | couchbase.public.repo 13 | ${env.MAVEN_UPLOAD_USERNAME} 14 | ${env.MAVEN_UPLOAD_PASSWORD} 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /scripts/jenkins/mobile/zip_jars/zip_jars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | THIS_DIR=`dirname $0` 4 | 5 | if [[ ! $1 ]] ; then echo "usage: $0 build_number (e.g. 0.0.0-1234) edition(community|enterprise) [ log_file ]" ; exit 99 ; fi 6 | if [[ ! $2 ]] ; then echo "usage: $0 build_number (e.g. 0.0.0-1234) edition(community|enterprise) [ log_file ]" ; exit 99 ; fi 7 | 8 | 9 | LOG='2>&1 | egrep -v '\'\('[0-9]+/[0-9]+K ?'\)\''+' 10 | 11 | if [[ $3 ]] ; then LOG=${LOG}' >> '${3} ; fi 12 | 13 | 14 | REVISION=$1 15 | EDITION=$2 16 | 17 | if [ -z ${EDITION} ] 18 | then 19 | echo "PLEASE SET MAVEN_UPLOAD_PASSWORD TO UPLOAD ARTIFACTS!!!!!!!!!!!!" 20 | exit 1 21 | fi 22 | 23 | pushd ${THIS_DIR} 2>&1 > /dev/null 24 | 25 | # echo mvn --settings ./settings.xml --quiet -DREVISION=${REVISION} -DEDITION=${EDITION} clean prepare-package package $LOG | bash 26 | echo mvn --settings ./settings.xml --debug -DREVISION=${REVISION} -DEDITION=${EDITION} clean prepare-package package $LOG | bash 27 | 28 | popd 2>&1 > /dev/null 29 | echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ done making android_zipfile 30 | -------------------------------------------------------------------------------- /scripts/jenkins/query/go-manifest: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Tell me what versions of various things are in use. 3 | 4 | eval `go env` 5 | 6 | detect() { 7 | pkg="$1" 8 | dir="$2" 9 | 10 | cd "$dir" 11 | gitv=`git describe --always 2>/dev/null` 12 | if [ $? -eq 0 ] 13 | then 14 | echo "$pkg $gitv" 15 | else 16 | hgv=`hg identify -i` 17 | if [ $? -ne 0 ] 18 | then 19 | echo "Warning: Can't identify $pkg" 20 | else 21 | echo "$pkg $hgv" 22 | fi 23 | fi 24 | } 25 | 26 | process() { 27 | pkg="$1" 28 | dir=`go list -f {{.Dir}} "$pkg"` 29 | case "$dir" in 30 | $GOROOT*) 31 | # echo "$pkg is stdlib";; 32 | : 33 | ;; 34 | *) 35 | detect "$pkg" "$dir" 36 | esac 37 | } 38 | 39 | for pkg in `go list -f '{{ range .Deps }} {{.}} {{end}}' "$@"` 40 | do 41 | process $pkg 42 | done 43 | -------------------------------------------------------------------------------- /scripts/jenkins/query/go-set-versions: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Reset versions based on a manifest file 3 | 4 | eval `go env` 5 | 6 | setGitVer() { 7 | pkg="$1" 8 | ver="$2" 9 | 10 | echo "Setting git version of $pkg to $ver" 11 | git reset --hard "$ver" 12 | } 13 | 14 | setHgVer() { 15 | pkg="$1" 16 | ver="$2" 17 | 18 | echo "Setting hg version of $pkg to $ver" 19 | hg checkout -C -r "$ver" 20 | } 21 | 22 | setVer() { 23 | pkg="$1" 24 | ver="$2" 25 | 26 | cd "$GOPATH/src/$pkg" || exit 1 27 | gitv=`git describe --always 2>/dev/null` 28 | 29 | if [ $? -eq 0 ] 30 | then 31 | if [ "$gitv" != "$ver" ] 32 | then 33 | setGitVer "$pkg" "$ver" 34 | fi 35 | else 36 | hgv=`hg identify -i` 37 | if [ $? -ne 0 ] 38 | then 39 | echo "Warning: Can't identify $pkg" 40 | else 41 | if [ "$hgv" != "$ver" ] 42 | then 43 | setHgVer "$pkg" "$ver" 44 | fi 45 | fi 46 | fi 47 | } 48 | 49 | cat $1 | while read pkg ver 50 | do 51 | setVer "$pkg" "$ver" 52 | done 53 | -------------------------------------------------------------------------------- /scripts/jenkins/release/auto-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | usage(){ 4 | echo "Usage:" 5 | echo "./auto_release {VERSION}. {VERSION} is something like 2.0.2" 6 | echo "By default the script will handle packages for all names, platform and package types" 7 | echo "If you want to specify platform, name or types, usage is:" 8 | echo "NAME={NAME} PLATFORM={PLATFORM} TYPE={TYPE} ./auto_release {VERSION}" 9 | } 10 | 11 | if [ $# -eq 0 ]; then 12 | echo "Build number is not provided" 13 | exit 14 | fi 15 | 16 | if [ $1 = "--help" ] || [ $1 = "-h" ]; then 17 | usage 18 | exit 19 | fi 20 | 21 | if [ -z "$TYPE" ]; then 22 | echo "Stage packages for all types" 23 | types=("rpm" "deb" "setup.exe" "zip") 24 | else 25 | echo "Stage packages for $TYPE" 26 | types=$TYPE 27 | fi 28 | 29 | if [ -z "$PLATFORM" ]; then 30 | echo "Stage packages for both 32 and 64 bits" 31 | platforms=(32 64) 32 | else 33 | echo "Stage packages for $PLATFORM" 34 | platforms=$PLATFORM 35 | fi 36 | 37 | if [ -z "$NAME" ]; then 38 | echo "Stage packages for both enterprise and community editions" 39 | names=("enterprise" "community") 40 | else 41 | echo "Stage packages for $NAME" 42 | names=$NAME 43 | fi 44 | 45 | for package_type in ${types[@]}; do 46 | for platform in ${platforms[@]}; do 47 | for name in ${names[@]}; do 48 | if [ $platform -eq 32 ] && [ $package_type == "zip" ]; then 49 | echo "MAC package doesn't support 32 bit platform" 50 | else 51 | if [ $platform -eq 32 ]; then 52 | staging="couchbase-server-${name}_x86_${1}.${package_type}.staging" 53 | else 54 | staging="couchbase-server-${name}_x86_${platform}_${1}.${package_type}.staging" 55 | fi 56 | 57 | echo "Remove staging file for $staging and ready for release" 58 | s3cmd del "s3://packages.couchbase.com/releases/${1}/${staging}" 59 | if [ $name == "community" ]; 60 | then 61 | base_name=couchbase-server_src-${1}.tar.gz 62 | s3cmd del "s3://packages.couchbase.com/releases/${1}/${base_name}.staging" 63 | fi 64 | fi 65 | done 66 | done 67 | done 68 | -------------------------------------------------------------------------------- /scripts/jenkins/reports/changelog-report-current-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # run by jenkins job 'changelog-report-current-build' 4 | # 5 | # with paramters: 6 | # 7 | # BUILDER -- e.g. ubuntu-1204-x86-master-builder 8 | # 9 | # BRANCH -- 10 | # 11 | # CURRENT_BLD -- 12 | # 13 | set -e 14 | env | grep -v password | grep -v passwd | sort 15 | echo ========================================= 16 | echo ____________starting___`date` 17 | 18 | REPORT_DIR=${WORKSPACE}/${BUILDER} 19 | if [[ ! -d ${REPORT_DIR} ]] ; then mkdir ${REPORT_DIR} ; sudo chmod g+w ${REPORT_DIR} ; fi 20 | 21 | PROPFILE=${REPORT_DIR}/last_good.properties 22 | echo see ${PROPFILE} 23 | 24 | ${WORKSPACE}/build/scripts/cgi/get_latest_good_build.pl -b ${BUILDER} -r ${BRANCH} > ${PROPFILE} 25 | sudo chmod 666 ${PROPFILE} 26 | ls -l ${PROPFILE} 27 | cat ${PROPFILE} 28 | echo ========================================= 29 | 30 | export FIRST_BLD=`grep BUILD_NUMBER ${PROPFILE} | awk -F- '{print $2}'` 31 | 32 | export LAST_BLD=${REPORT_DIR}/current.xml 33 | 34 | if [[ ! -f ${LAST_BLD} ]] 35 | then 36 | echo "" 37 | echo "ERROR: Failed to locate current manifest:" 38 | echo "" 39 | echo " ${LAST_BLD}" 40 | echo "" 41 | echo "Verify that buildbot uploaded this file." 42 | echo "" 43 | exit 99 44 | fi 45 | 46 | echo "----------------- showing changes from ${FIRST_BLD} to ${LAST_BLD}" 47 | 48 | DO_SENDIT=0 49 | PFORM_ARG="" 50 | PFORM_REX='([a-z]*-[a-z0-9]*)-[a-z0-9]*-builder' 51 | PFORM_REX='(centos-6-x64)-[a-z0-9]*-builder' 52 | 53 | if [[ ${BUILDER} =~ ${PFORM_REX} ]] 54 | then 55 | PLATFORM=${BASH_REMATCH[1]} 56 | PFORM_ARG="-P ${PLATFORM}" 57 | echo "----------------- builder ${BUILDER} is on platform ${PFORM_ARG} -----------------" 58 | DO_SENDIT=1 59 | fi 60 | 61 | BLDNUM_ARG="" 62 | if [[ ${CURRENT_BLD} ]] ; then BLDNUM_ARG="-b ${CURRENT_BLD}" ; fi 63 | 64 | ${WORKSPACE}/build/scripts/jenkins/reports/changelog-report.sh -d ${REPORT_DIR} -e ${DO_SENDIT} ${BLDNUM_ARG} ${PFORM_ARG} 65 | 66 | -------------------------------------------------------------------------------- /scripts/jenkins/reports/check-30x-branches.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | git config --global user.name "Couchbase Build Team" 4 | git config --global user.email "build-team@couchbase.com" 5 | git config --global color.ui false 6 | 7 | # Sync the primary repo 8 | if [ ! -d repo ] 9 | then 10 | mkdir repo 11 | fi 12 | cd repo 13 | # Conveniently this does NOT delete the .repo directory itself 14 | rm -rf * .repo/manifest* 15 | repo init -u https://github.com/couchbase/manifest -g all -m rel-3.0.x.xml 16 | repo sync --jobs=6 17 | 18 | repo manifest -r > rel30x.xml 19 | 20 | repo init -u https://github.com/ceejatec/manifest -g all -m real-3.0.x.xml 21 | repo sync --jobs=6 22 | 23 | repo manifest -r > real30x.xml 24 | 25 | repo diffmanifests `pwd`/rel30x.xml `pwd`/real30x.xml > diff-report.txt 26 | 27 | size=`wc -c < diff-report.txt` 28 | if [ "0" != "$size" ] 29 | then 30 | echo "There are 3.0.x changes to investigate" 31 | exit 2 32 | fi 33 | 34 | -------------------------------------------------------------------------------- /scripts/jenkins/reports/gerrit-commit-check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # Grab details about changes from database 4 | # QQQ Should remove this id_Ceej stuff somehow... 5 | ssh -p 29418 -i id_Ceej Ceej@review.couchbase.org gerrit gsql --format pretty -c \""select c.change_id, p.revision, c.dest_project_name, c.dest_branch_name, a.full_name from changes c, patch_sets p, accounts a where c.last_updated_on > '2014-04-01' and c.status='M' and c.change_id=p.change_id and p.patch_set_id=c.current_patch_set_id and c.owner_account_id=a.account_id"\" | tail -n +3 | sed -e 's/ *| */|/g' | sed -e 's/^ *//' > output.txt 6 | 7 | echo '

      Merges newly missing today:

      ' > new_missing_merges.html 8 | touch known_problems.txt 9 | failed=0 10 | 11 | # Make output directory if necesssary 12 | if [ ! -e repos ] 13 | then 14 | mkdir repos 15 | cd repos 16 | else 17 | 18 | # Update any repos that have been previously downloaded 19 | cd repos 20 | for repo in * 21 | do 22 | ( 23 | echo "Updating local $repo repo..." 24 | cd $repo 25 | git fetch 26 | git reset --hard origin/master 27 | ) 28 | done 29 | fi 30 | 31 | # Read lines of changes 32 | while IFS='|' read -a vals 33 | do 34 | if [ ! -z "${vals[1]}" ] 35 | then 36 | change=${vals[0]} 37 | sha=${vals[1]} 38 | project=${vals[2]} 39 | branch=${vals[3]} 40 | owner=${vals[4]} 41 | 42 | echo "Checking change $change in project $project ..." 43 | 44 | # Clone or update Gerrit repo for project 45 | if [ ! -e "$project" ] 46 | then 47 | git clone ssh://review.couchbase.org:29418/$project 48 | fi 49 | 50 | # See if commit's SHA1 is in log 51 | problem=0 52 | git --git-dir="$project/.git" log -1 $sha > /dev/null || problem=1 53 | if [ $problem != 0 ] 54 | then 55 | # See if we already know about this problem 56 | echo Potential problem with $sha... 57 | known=0 58 | grep -q "$change" ../known_problems.txt || known=1 59 | if [ $known != 0 ] 60 | then 61 | echo "$owner: change $change -- $project is missing $sha !
      " | tee --append ../missing_merges.html | tee --append ../new_missing_merges.html 62 | echo "$change" >> ../known_problems.txt 63 | failed=1 64 | fi 65 | fi 66 | 67 | fi 68 | done < ../output.txt 69 | 70 | exit $failed 71 | -------------------------------------------------------------------------------- /scripts/jenkins/sdk/build_java_sdk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CORE_SHA=$1 4 | CLIENT_SHA=$2 5 | 6 | git clone https://github.com/couchbase/couchbase-jvm-core.git 7 | if [ -n "${CORE_SHA}" ] 8 | then 9 | pushd ${WORKSPACE}/couchbase-jvm-core && git checkout ${CORE_SHA} && popd 10 | fi 11 | 12 | git clone https://github.com/couchbase/couchbase-java-client.git 13 | if [ -n "${CLIENT_SHA}" ] 14 | then 15 | pushd ${WORKSPACE}/couchbase-java-client && git checkout ${CLIENT_SHA} && popd 16 | fi 17 | 18 | cd ${WORKSPACE}/couchbase-jvm-core 19 | mvn clean install -DskipTests=true 20 | 21 | cd ${WORKSPACE}/couchbase-java-client 22 | mvn clean install -DskipTests=true 23 | -------------------------------------------------------------------------------- /scripts/jenkins/sdk/launch_instances.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import sys 3 | import socket 4 | import time 5 | import datetime 6 | import boto3 7 | import botocore 8 | from optparse import OptionParser 9 | 10 | job = 'net-sdk' 11 | if len(sys.argv) > 1: 12 | job = sys.argv[1] 13 | 14 | num_instances = 4 15 | if len(sys.argv) > 2: 16 | num_instances = int(sys.argv[2]) 17 | 18 | if job == 'net-sdk': 19 | ami_id = 'ami-9e06d0fe' 20 | sg_id = ['sg-8cd93bf5'] 21 | inst_type = 'c4.xlarge' 22 | elif job == 'php-sdk': 23 | ami_id = 'ami-b580c6a2' 24 | sg_id = ['sg-db3367a1'] 25 | inst_type = 'c4.2xlarge' 26 | 27 | 28 | boto_ec2_obj = boto3.resource('ec2') 29 | instances = boto_ec2_obj.create_instances( 30 | ImageId = ami_id, 31 | MinCount = num_instances, 32 | MaxCount = num_instances, 33 | SecurityGroupIds = sg_id, 34 | InstanceType = inst_type) 35 | 36 | for inst in instances: 37 | inst.wait_until_running() 38 | inst.reload() 39 | 40 | time.sleep(180) 41 | 42 | pub_dns = [] 43 | pub_ips = [] 44 | priv_ips = [] 45 | iids = [] 46 | for inst in instances: 47 | inst.reload() 48 | iids.append(inst.instance_id) 49 | pub_ips.append(inst.public_ip_address) 50 | pub_dns.append(inst.public_dns_name) 51 | priv_ips.append(inst.private_ip_address) 52 | boto_ec2_obj.create_tags(Resources=[inst.instance_id], Tags=[{'Key': 'use', 'Value': job}]) 53 | 54 | with open('ec2.ips', 'w') as F: 55 | print >>F, 'PUB_DNS=' + ' '.join(pub_dns) 56 | print >>F, 'NODE_IPS=' + ' '.join(pub_ips) 57 | print >>F, 'PRIV_IPS=' + ' '.join(priv_ips) 58 | print >>F, 'CLUSTER_INST_IDS=' + ' '.join(iids) 59 | print >>F, 'SERVER_PUB_IP0=' + pub_ips[0] 60 | print >>F, 'SERVER_PRIV_IP0=' + priv_ips[0] 61 | -------------------------------------------------------------------------------- /scripts/jenkins/sdk/nunit3-xunit.xslt: -------------------------------------------------------------------------------- 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 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /scripts/jenkins/sdk/php_unit_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -xe 2 | 3 | CB_DSN=${CB_DSN:-127.0.0.1} 4 | CB_BUCKET=${CB_BUCKET:-default} 5 | CB_ADMIN_USER=${CB_ADMIN_USER:-Administrator} 6 | CB_ADMIN_PASSWORD=${CB_ADMIN_PASSWORD:-password} 7 | CB_USER=${CB_USER:-default} 8 | CB_PASSWORD=${CB_PASSWORD} 9 | 10 | export CB_DSN CB_BUCKET CB_ADMIN_USER CB_ADMIN_PASSWORD CB_USER CB_PASSWORD 11 | 12 | # phpunit needs 5.6 always 13 | PHP_DIR="${BBSDK}/php-files/build/${phpver}-${phpts}-${arch}" 14 | 15 | LCB_PATH="${BBSDK}/lcb-files/dist/${LCBVER}-${arch}/lib" 16 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LCB_PATH 17 | 18 | rm -rf core* 19 | # allow to generate coredumps 20 | ulimit -c unlimited 21 | # display coredump pattern 22 | /sbin/sysctl kernel.core_pattern || /usr/sbin/sysctl kernel.core_pattern || sysctl kernel.core_pattern || true 23 | 24 | # Test 25 | PHP_CMD="${PHP_DIR}/bin/php -d extension=phar.so -d extension=igbinary.so -d extension=$(pwd)/modules/couchbase.so -d couchbase.log_level=TRACE" 26 | ${PHP_CMD} -m 27 | ${PHP_CMD} ${PHP_DIR}/phpunit.phar --verbose tests/ || \ 28 | if [ -x /usr/bin/gdb ]; then 29 | shopt -s nullglob 30 | for c in core* /tmp/core* /var/crash/*; do 31 | ls -l $c 32 | file $c 33 | gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" ${PHP_DIR}/bin/php $c 34 | done 35 | exit 1 36 | fi 37 | -------------------------------------------------------------------------------- /scripts/jenkins/sdk/setup_cluster.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -xe 2 | 3 | which_rel=$1 4 | NODE_IP=${CPDSN:-127.0.0.1} 5 | CB_USER=${CPUSER:-Administrator} 6 | CB_PASS=${CPPASS:-password} 7 | NODE_USER=root 8 | NODE_PASS=couchbase 9 | 10 | # which_rel evaluation -- not fail-proof, but will start with this 11 | if [ "x$which_rel" = "x" ]; then 12 | which_rel=dev 13 | fi 14 | 15 | if [ "x$which_rel" = "dev" ]; then 16 | # get latest dev version and install 17 | latest_dev=$(curl http://server.jenkins.couchbase.com/view/build-sanity/job/build-sanity-watson/lastSuccessfulBuild/artifact/run_details | grep LAST_SUCCESSFUL | awk -F= '{print $2}') 18 | which_rel="4.5.0-${latest_dev}" 19 | fi 20 | 21 | cur_install=$(curl --connect-timeout 10 --silent -X GET http://${NODE_IP}:8091/pools/default | sed 's|.*,"version":"\([0-9]\.[0-9]\.[0-9]-[0-9]*\)-.*|\1|g') 22 | if [ "${cur_install}" = "${which_rel}" ]; then 23 | echo "${which_rel} already installed on ${NODE_IP}" 24 | exit 0 25 | fi 26 | 27 | pushd ${WORKSPACE}/testrunner 28 | 29 | echo " 30 | [global] 31 | username:${NODE_USER} 32 | password:${NODE_PASS} 33 | 34 | [membase] 35 | rest_username:${CB_USER} 36 | rest_password:${CB_PASS} 37 | 38 | [_1] 39 | ip:${NODE_IP} 40 | port:8091 41 | n1ql_port:8093 42 | index_port:9102 43 | services:kv,index,n1ql 44 | 45 | [servers] 46 | 1:_1 47 | " > node_conf.ini 48 | 49 | install_params="version=${which_rel},product=cb,vbuckets=64${INSTALL_PARAMS}" 50 | if [ "x$BIN_URL" != "x" ]; then 51 | install_params="${install_params},url=${BIN_URL}" 52 | fi 53 | python scripts/install.py -i node_conf.ini -p ${install_params} 54 | popd 55 | 56 | curl -i -u ${CB_USER}:${CB_PASS} -X POST http://${NODE_IP}:8091/settings/indexes -d 'storageMode=memory_optimized' 57 | 58 | # create default bucket 59 | curl -X POST -u ${CB_USER}:${CB_PASS} \ 60 | -d name=default -d ramQuotaMB=1024 -d authType=none \ 61 | -d proxyPort=11216 \ 62 | http://${NODE_IP}:8091/pools/default/buckets 63 | -------------------------------------------------------------------------------- /scripts/jenkins/sdk/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | function valid_ip() 3 | { 4 | local ip=$1 5 | local stat=1 6 | 7 | if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then 8 | OIFS=$IFS 9 | IFS='.' 10 | ip=($ip) 11 | IFS=$OIFS 12 | [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \ 13 | && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]] 14 | stat=$? 15 | fi 16 | return $stat 17 | } 18 | 19 | host_ip=$1 20 | slave_name=${2:-winsdk-aws-01} 21 | if ! valid_ip $host_ip; then 22 | echo "$host_ip is not a valid ip address" 23 | exit 1 24 | fi 25 | 26 | rm -f sconfig.xml 27 | curl --netrc-file ~/.ssh/sdkbuilds.netrc -X GET http://sdkbuilds.sc.couchbase.com/computer/${slave_name}/config.xml -o sconfig.xml 28 | sed -e "s|\(.*\).*\(.*\)|\1$host_ip\2|g" sconfig.xml > sconfig.xml.new 29 | mv sconfig.xml.new sconfig.xml 30 | curl --netrc-file ~/.ssh/sdkbuilds.netrc -X POST http://sdkbuilds.sc.couchbase.com/computer/${slave_name}/config.xml --data-binary "@sconfig.xml" 31 | sleep 2 32 | curl --netrc-file ~/.ssh/sdkbuilds.netrc -X POST http://sdkbuilds.sc.couchbase.com/computer/${slave_name}/launchSlaveAgent 33 | -------------------------------------------------------------------------------- /scripts/jenkins/sonar/couchbase-lite-android.json: -------------------------------------------------------------------------------- 1 | { 2 | "sonar": { 3 | "sonar.exclusions": "**/vendor/**" 4 | }, 5 | "ignored_repositories": ["couchbase-lite-core-EE", "couchbase-lite-core", "couchbase-lite-core.wiki", "fleece", "jsonsl", "sqlite3 - unicodesn"] 6 | } 7 | -------------------------------------------------------------------------------- /scripts/jenkins/sonar/couchbase-lite-core.json: -------------------------------------------------------------------------------- 1 | { 2 | "sonar": { 3 | "sonar.exclusions": "**/vendor/**" 4 | }, 5 | "ignored_repositories": ["tlm"] 6 | } 7 | -------------------------------------------------------------------------------- /scripts/jenkins/sonar/couchbase-lite-ios.json: -------------------------------------------------------------------------------- 1 | { 2 | "sonar": { 3 | "sonar.exclusions": "**/vendor/**" 4 | }, 5 | "ignored_repositories": ["couchbase-lite-core-EE", "couchbase-lite-core", "couchbase-lite-core.wiki", "fleece", "jsonsl", "sqlite3 - unicodesn"] 6 | } 7 | -------------------------------------------------------------------------------- /scripts/jenkins/sonar/couchbase-lite-java.json: -------------------------------------------------------------------------------- 1 | { 2 | "sonar": { 3 | "sonar.exclusions": "**/vendor/**" 4 | }, 5 | "ignored_repositories": ["couchbase-lite-core-EE", "couchbase-lite-core", "couchbase-lite-core.wiki", "fleece", "jsonsl", "sqlite3 - unicodesn"] 6 | } 7 | -------------------------------------------------------------------------------- /scripts/jenkins/sonar/couchbase-lite-net.json: -------------------------------------------------------------------------------- 1 | { 2 | "sonar": { 3 | "sonar.exclusions": "**/vendor/**" 4 | }, 5 | "ignored_repositories": ["couchbase-lite-core-EE", "couchbase-lite-core", "couchbase-lite-core.wiki", "fleece", "jsonsl", "sqlite3 - unicodesn"] 6 | } 7 | -------------------------------------------------------------------------------- /scripts/jenkins/sonar/couchbase-sdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "sonar": { 3 | "sonar.exclusions": "**/vendor/**" 4 | }, 5 | "additional_repositories": { 6 | "couchbase-java-client": "https://github.com/couchbase/couchbase-java-client.git", 7 | "couchbase-jvm-clients": "https://github.com/couchbase/couchbase-jvm-clients.git", 8 | "couchbase-net-client": "https://github.com/couchbase/couchbase-net-client.git", 9 | "couchbase-python-client": "https://github.com/couchbase/couchbase-python-client.git", 10 | "couchnode": "https://github.com/couchbase/couchnode.git", 11 | "gocb": "https://github.com/couchbase/gocb.git", 12 | "libcouchbase": "https://github.com/couchbase/libcouchbase.git", 13 | "php-couchbase": "https://github.com/couchbase/php-couchbase.git" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /scripts/jenkins/sonar/couchbase-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "sonar": { 3 | "sonar.exclusions" : "**/vendor/**" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /scripts/jenkins/sonar/sync_gateway.json: -------------------------------------------------------------------------------- 1 | { 2 | "sonar": { 3 | "sonar.exclusions" : "**/vendor/**" 4 | }, 5 | "ignored_repositories": ["retriever", "go-couchbase", "gocb", "gocbcore", "jsonx", "gocbconnstr", "gomemcached", "clog", "goutils", "cbgt", "cbauth", "blance", "ns_server"] 6 | } 7 | -------------------------------------------------------------------------------- /scripts/release/create_tarball.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | RELEASE=$1 4 | 5 | mkdir /tmp/couchbase-server_$RELEASE 6 | cd /tmp/couchbase-server_$RELEASE 7 | repo init -u http://github.com/couchbase/manifest -m released/$RELEASE.xml --reference=/home/ceej/co/reporef 8 | repo sync --jobs=6 9 | rm -rf .repo **/.git gperftools icu4c otp pysqlite python-snappy snappy v8 10 | cd .. 11 | tar cvzf couchbase-server_$RELEASE-src.tgz couchbase-server_$RELEASE 12 | -------------------------------------------------------------------------------- /scripts/release/purge_jenkins_results.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function usage 4 | { 5 | echo "" 6 | echo "use: $0 job-name from-bld to-bld username api-token" 7 | echo "" 8 | echo " will purge build results of job-name" 9 | echo " builds from-bld to to-bld, inclusive" 10 | echo "" 11 | echo "To get your api-token log into jenkins and look at your settings." 12 | echo "You will see a string like: 34f1e3c181b49c483b2de6f2224cec21" 13 | echo "" 14 | exit 0 15 | } 16 | 17 | TRUE=0 18 | FALSE=1 19 | INT_REX='^[0-9]+$' 20 | 21 | BASE_URL=http://qa.hq.northscale.net 22 | 23 | function isInt 24 | { 25 | value=$1 26 | 27 | if [[ $value =~ $INT_REX ]] 28 | then 29 | RANGE=${BASH_REMATCH[1]} 30 | echo $TRUE 31 | else 32 | echo $FALSE 33 | fi 34 | } 35 | 36 | 37 | if [[ ! $5 ]] ; then usage ; fi 38 | 39 | JOB_NAME=$1 40 | FRST_BLD=$2 41 | LAST_BLD=$3 42 | 43 | USERNAME=$4 44 | APITOKEN=$5 45 | 46 | if [[ `isInt ${FRST_BLD}` != $TRUE ]] ; then echo "Not an integer: ${FRST_BLD}" ; usage ; fi 47 | if [[ `isInt ${LAST_BLD}` != $TRUE ]] ; then echo "Not an integer: ${LAST_BLD}" ; usage ; fi 48 | 49 | if [[ ${LAST_BLD} -lt ${FRST_BLD} ]] 50 | then 51 | echo swapping.... 52 | SWAP_TMP=${LAST_BLD} 53 | LAST_BLD=${FRST_BLD} 54 | FRST_BLD=${SWAP_TMP} 55 | fi 56 | 57 | for (( BLD=${FRST_BLD} ; ${BLD} < ${LAST_BLD} ; BLD++ )) 58 | do 59 | echo "delete build ${BLD} of ${JOB_NAME}" 60 | 61 | curl --data "" --user ${USERNAME}:${APITOKEN} ${BASE_URL}/job/${JOB_NAME}/${BLD}/doDelete 62 | STATUS=$? 63 | if [[ ${STATUS} -gt 0 ]] ; then echo "FAILED: ${STATUS}" ; break ; fi 64 | done 65 | 66 | -------------------------------------------------------------------------------- /scripts/release/upload_4x.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # Expects to be run from the latestbuilds directory. 4 | 5 | RELEASE=4.0.0 6 | CODENAME=sherlock 7 | MP=rc0 8 | BUILD=4047 9 | STAGING= 10 | COMMUNITY=private 11 | PLATFORMS="centos6 centos7 debian7 macos oel6 suse11 ubuntu12.04 ubuntu14.04 windows" 12 | 13 | ######################################## 14 | # Don't modify anything below this line 15 | ######################################## 16 | 17 | 18 | # Compute target filename component 19 | if [ -z "$MP" ] 20 | then 21 | RELEASE_DIRNAME=$RELEASE 22 | FILENAME_VER=$RELEASE 23 | else 24 | RELEASE_DIRNAME=$RELEASE-$MP 25 | FILENAME_VER=$RELEASE-$MP 26 | fi 27 | 28 | # Compute destination directories 29 | ROOT=s3://packages.couchbase.com/releases/$RELEASE_DIRNAME 30 | RELEASE_DIR=/home/buildbot/releases/$RELEASE_DIRNAME 31 | # Create destination directory, including "hidden" ce subdir 32 | mkdir -p $RELEASE_DIR/ce 33 | 34 | upload() 35 | { 36 | build=${1/.\//} 37 | target=${build/$RELEASE-$BUILD/$FILENAME_VER} 38 | md5file=$RELEASE_DIR/$target.md5 39 | 40 | echo :::::::::::::::::::::::::::::::::::::: 41 | 42 | if [ ! -e $md5file -o $build -nt $md5file ] 43 | then 44 | echo Creating fresh md5sum file for $build... 45 | md5sum $build | cut -c1-32 > /tmp/md5-$$.md5 46 | mv /tmp/md5-$$.md5 $md5file 47 | fi 48 | 49 | if [[ "$COMMUNITY" = "private" && "$target" =~ "community" ]] 50 | then 51 | echo Uploading $build PRIVATELY... 52 | perm_arg= 53 | ce_dir=ce/ 54 | else 55 | echo Uploading $build... 56 | perm_arg=-P 57 | ce_dir= 58 | fi 59 | s3cmd sync $perm_arg $build $ROOT/$target$STAGING 60 | s3cmd sync $perm_arg $md5file $ROOT/$target.md5$STAGING 61 | 62 | echo Copying $build to releases... 63 | rsync -a $build $RELEASE_DIR/$ce_dir$target 64 | } 65 | 66 | OPWD=`pwd` 67 | finish() { 68 | cd $OPWD 69 | exit 70 | } 71 | trap finish EXIT 72 | 73 | cd couchbase-server/$CODENAME/$BUILD 74 | upload couchbase-server-$RELEASE-$BUILD-manifest.xml 75 | 76 | for edition in enterprise community 77 | do 78 | for platform in $PLATFORMS 79 | do 80 | for file in `find . -maxdepth 1 -name couchbase-server-${edition}\*${platform}\*` 81 | do 82 | upload $file 83 | done 84 | done 85 | done 86 | -------------------------------------------------------------------------------- /scripts/setup/go/hello.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | fmt.Printf("hello, world\n") 7 | } 8 | 9 | -------------------------------------------------------------------------------- /scripts/setup/go/setup_cross_compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pushd ${GOROOT}/src 2>&1 > /dev/null 4 | echo ......... now in ${GOROOT}/src 5 | 6 | echo -------- step 1 7 | ./make.bash 8 | 9 | echo -------- step 2 10 | for arch in 8 6 11 | do 12 | for cmd in a c g l 13 | do 14 | go tool dist install -v cmd/$arch$cmd 15 | done 16 | done 17 | 18 | echo -------- step 3 19 | export CGO_ENABLED=0 20 | 21 | echo ..............windows........amd64 22 | CGO_ENABLED=0 GOOS=windows GOARCH=amd64 ./make.bash --no-clean 23 | CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go tool dist install -v pkg/runtime 24 | CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go install -v -a std 25 | 26 | echo ..............windows........386 27 | CGO_ENABLED=0 GOOS=windows GOARCH=386 ./make.bash --no-clean 28 | CGO_ENABLED=0 GOOS=windows GOARCH=386 go tool dist install -v pkg/runtime 29 | CGO_ENABLED=0 GOOS=windows GOARCH=386 go install -v -a std 30 | 31 | echo -------- step 4 32 | export CGO_ENABLED=0 33 | 34 | echo ..............linux.............ARM 35 | CGO_ENABLED=0 GOOS=linux GOARCH=arm ./make.bash --no-clean 36 | CGO_ENABLED=0 GOOS=linux GOARCH=arm go tool dist install -v pkg/runtime 37 | CGO_ENABLED=0 GOOS=linux GOARCH=arm go install -v -a std 38 | 39 | echo -------- step 5 40 | export CGO_ENABLED=0 41 | 42 | echo ..............linux.............386 43 | CGO_ENABLED=0 GOOS=linux GOARCH=386 ./make.bash --no-clean 44 | CGO_ENABLED=0 GOOS=linux GOARCH=386 go tool dist install -v pkg/runtime 45 | CGO_ENABLED=0 GOOS=linux GOARCH=386 go install -v -a std 46 | 47 | echo ..............linux.............ARM5 48 | CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 ./make.bash --no-clean 49 | CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go tool dist install -v pkg/runtime 50 | CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go install -v -a std 51 | 52 | echo ..............freebsd...........amd64 53 | CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 ./make.bash --no-clean 54 | CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go tool dist install -v pkg/runtime 55 | CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go install -v -a std 56 | 57 | echo -------- step 6 58 | export CGO_ENABLED=0 59 | echo ..............darwin............amd64 60 | CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 ./make.bash --no-clean 61 | CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go tool dist install -v pkg/runtime 62 | CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go install -v -a std 63 | 64 | echo ......... now back 65 | popd 2>&1 > /dev/null 66 | 67 | -------------------------------------------------------------------------------- /scripts/setup/go/test.h: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | go run hello.go 4 | -------------------------------------------------------------------------------- /tools/iOS/bin/JavaScriptCore.framework/Headers/JSStringRefCF.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006, 2007 Apple Computer, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef JSStringRefCF_h 27 | #define JSStringRefCF_h 28 | 29 | #include "JSBase.h" 30 | #include 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* CFString convenience methods */ 37 | 38 | /*! 39 | @function 40 | @abstract Creates a JavaScript string from a CFString. 41 | @discussion This function is optimized to take advantage of cases when 42 | CFStringGetCharactersPtr returns a valid pointer. 43 | @param string The CFString to copy into the new JSString. 44 | @result A JSString containing string. Ownership follows the Create Rule. 45 | */ 46 | JS_EXPORT JSStringRef JSStringCreateWithCFString(CFStringRef string); 47 | /*! 48 | @function 49 | @abstract Creates a CFString from a JavaScript string. 50 | @param alloc The alloc parameter to pass to CFStringCreate. 51 | @param string The JSString to copy into the new CFString. 52 | @result A CFString containing string. Ownership follows the Create Rule. 53 | */ 54 | JS_EXPORT CFStringRef JSStringCopyCFString(CFAllocatorRef alloc, JSStringRef string); 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* JSStringRefCF_h */ 61 | -------------------------------------------------------------------------------- /tools/iOS/bin/JavaScriptCore.framework/Headers/JavaScript.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 Apple Inc. All rights reserved. 3 | * Copyright (C) 2008 Alp Toker 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 15 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 18 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 21 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 22 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef JavaScript_h 28 | #define JavaScript_h 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #endif /* JavaScript_h */ 37 | -------------------------------------------------------------------------------- /tools/iOS/bin/JavaScriptCore.framework/Headers/JavaScriptCore.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef JavaScriptCore_h 27 | #define JavaScriptCore_h 28 | 29 | #include 30 | #include 31 | 32 | #endif /* JavaScriptCore_h */ 33 | -------------------------------------------------------------------------------- /tools/iOS/bin/JavaScriptCore.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/couchbase/build/0961883a4a6afcc1fb82e9e876af454f43944298/tools/iOS/bin/JavaScriptCore.framework/Info.plist -------------------------------------------------------------------------------- /tools/iOS/bin/JavaScriptCore.framework/JavaScriptCore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/couchbase/build/0961883a4a6afcc1fb82e9e876af454f43944298/tools/iOS/bin/JavaScriptCore.framework/JavaScriptCore -------------------------------------------------------------------------------- /tools/iOS/bin/README: -------------------------------------------------------------------------------- 1 | 2 | From a dropbox URL that was mentioned in the error message when built without: 3 | 4 | https://dl.dropboxusercontent.com/u/14074521/JavaScriptCore.framework.zip 5 | 6 | These files are identical to the framework installed on the build node under: 7 | 8 | /Users/couchbase/buildbox/couchbase-lite-ios/vendor 9 | 10 | on the build node macsvr-108-01 ( 10.6.0.131 ). 11 | 12 | -------------------------------------------------------------------------------- /winbins/gcc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/couchbase/build/0961883a4a6afcc1fb82e9e876af454f43944298/winbins/gcc.exe --------------------------------------------------------------------------------