diff --git a/.github/workflows/check_on_push.yaml b/.github/workflows/check_on_push.yaml index b4dc696f..5f2e6f26 100644 --- a/.github/workflows/check_on_push.yaml +++ b/.github/workflows/check_on_push.yaml @@ -18,8 +18,15 @@ jobs: with: tarantool-version: '2.10' + - name: Setup tt + run: | + curl -L https://tarantool.io/release/2/installer.sh | bash + sudo apt-get update + sudo apt-get install -y tt + tt version + - name: Setup luacheck - run: tarantoolctl rocks install luacheck 0.25.0 + run: tt rocks install luacheck 0.25.0 - run: cmake -S . -B build diff --git a/.github/workflows/push_rockspec.yaml b/.github/workflows/push_rockspec.yaml index 668ff0ca..f859651d 100644 --- a/.github/workflows/push_rockspec.yaml +++ b/.github/workflows/push_rockspec.yaml @@ -19,11 +19,11 @@ jobs: - name: Check module version uses: tarantool/actions/check-module-version@master with: - module-name: 'crud' + module-name: ${{ env.ROCK_NAME }} push-scm-rockspec: runs-on: ubuntu-20.04 - if: github.ref == 'refs/heads/master' + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} steps: - uses: actions/checkout@master @@ -34,7 +34,7 @@ jobs: push-tagged-rockspec: runs-on: ubuntu-20.04 - if: startsWith(github.ref, 'refs/tags') + if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} needs: version-check steps: - uses: actions/checkout@master diff --git a/.github/workflows/reusable_test.yml b/.github/workflows/reusable_test.yml index 21b72f4b..6436a911 100644 --- a/.github/workflows/reusable_test.yml +++ b/.github/workflows/reusable_test.yml @@ -31,11 +31,18 @@ jobs: sudo dpkg -i tarantool_*.deb tarantool-common_*.deb tarantool-dev_*.deb tarantool --version + - name: Setup tt + run: | + curl -L https://tarantool.io/release/2/installer.sh | bash + sudo apt-get update + sudo apt-get install -y tt + tt version + - name: Install requirements run: ./deps.sh - name: Install metrics - run: tarantoolctl rocks install metrics 0.12.0 + run: tt rocks install metrics 0.12.0 # This server starts and listen on 8084 port that is used for tests - name: Stop Mono server diff --git a/.github/workflows/test_on_push.yaml b/.github/workflows/test_on_push.yaml index 2d66b699..7a4d2fc7 100644 --- a/.github/workflows/test_on_push.yaml +++ b/.github/workflows/test_on_push.yaml @@ -19,7 +19,7 @@ jobs: remove-merger: [false] include: - tarantool-version: "1.10" - metrics-version: "0.16.0" + metrics-version: "0.17.0" cartridge-version: "2.7.8" - tarantool-version: "2.7" remove-merger: true @@ -34,7 +34,7 @@ jobs: cartridge-version: "1.2.0" - tarantool-version: "2.10" coveralls: true - metrics-version: "0.16.0" + metrics-version: "0.17.0" cartridge-version: "2.7.8" fail-fast: false # Can't install older versions on 22.04, @@ -53,6 +53,13 @@ jobs: run: | sudo patch -p1 /usr/share/tarantool/luarocks/manif.lua luarocks.patch + - name: Setup tt + run: | + curl -L https://tarantool.io/release/2/installer.sh | bash + sudo apt-get update + sudo apt-get install -y tt + tt version + - name: Install requirements for community run: | tarantool --version @@ -62,7 +69,7 @@ jobs: - name: Install metrics if: matrix.metrics-version != '' - run: tarantoolctl rocks install metrics ${{ matrix.metrics-version }} + run: tt rocks install metrics ${{ matrix.metrics-version }} - name: Remove external merger if needed if: ${{ matrix.remove-merger }} @@ -101,13 +108,20 @@ jobs: with: tarantool-version: ${{ matrix.tarantool-version }} + - name: Setup tt + run: | + curl -L https://tarantool.io/release/2/installer.sh | bash + sudo apt-get update + sudo apt-get install -y tt + tt version + - name: Install requirements for community run: | tarantool --version ./deps.sh - name: Install metrics - run: tarantoolctl rocks install metrics ${{ matrix.metrics-version }} + run: tt rocks install metrics ${{ matrix.metrics-version }} # This server starts and listen on 8084 port that is used for tests - name: Stop Mono server @@ -133,6 +147,13 @@ jobs: steps: - uses: actions/checkout@master + - name: Setup tt + run: | + curl -L https://tarantool.io/release/2/installer.sh | bash + sudo apt-get update + sudo apt-get install -y tt + tt version + - name: Install requirements for enterprise run: | curl -O -L https://tarantool:${{ secrets.DOWNLOAD_TOKEN }}@download.tarantool.io/enterprise/release/linux/x86_64/${{ matrix.tarantool-version.folder }}/${{ matrix.tarantool-version.bundle }}.tar.gz @@ -145,9 +166,7 @@ jobs: - name: Install metrics if: matrix.metrics-version != '' - run: | - source tarantool-enterprise/env.sh - tarantoolctl rocks install metrics ${{ matrix.metrics-version }} + run: tt rocks install metrics ${{ matrix.metrics-version }} # This server starts and listen on 8084 port that is used for tests - name: Stop Mono server diff --git a/CMakeLists.txt b/CMakeLists.txt index 3485b788..097faff1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,6 +77,8 @@ add_custom_target(coveralls ## Install #################################################################### ############################################################################### +find_package(TTCtl) + if(NOT DEFINED TARANTOOL_INSTALL_LUADIR) set(TARANTOOL_INSTALL_LUADIR "${PROJECT_SOURCE_DIR}/.rocks/share/tarantool") endif() @@ -99,9 +101,9 @@ install( # Don't include to rockspec as some Tarantool versions (e.g. 2.2 and 2.3) # don't have symbols required by "tuple-merger" and "tuple-keydef" modules. execute_process( - COMMAND bash "-c" "tarantoolctl rocks install tuple-keydef 0.0.2" + COMMAND bash "-c" "${TTCTL} rocks install tuple-keydef 0.0.2" ) execute_process( - COMMAND bash "-c" "tarantoolctl rocks install tuple-merger 0.0.2" + COMMAND bash "-c" "${TTCTL} rocks install tuple-merger 0.0.2" ) diff --git a/README.md b/README.md index 51e65e03..2b4bdf91 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ project: ```shell $ git clone https://github.com/tarantool/crud.git $ cd crud - $ tarantoolctl rocks make + $ tt rocks make $ ./doc/playground.lua tarantool> crud.select('customers', {{'<=', 'age', 35}}, {first = 10}) tarantool> crud.select('developers', nil, {first = 6}) @@ -63,7 +63,7 @@ project: * Install crud into a current directory: ```shell - $ tarantoolctl rocks install crud + $ tt rocks install crud ``` And add the [initialization code](#API) to storage and router instance files. diff --git a/cmake/FindTTCtl.cmake b/cmake/FindTTCtl.cmake new file mode 100644 index 00000000..d162d9b9 --- /dev/null +++ b/cmake/FindTTCtl.cmake @@ -0,0 +1,11 @@ +find_program(TTCTL + NAMES tt tarantoolctl + DOC "Utility for managing Tarantool packages" +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(TTCtl + REQUIRED_VARS TTCTL +) + +mark_as_advanced(TTCTL) diff --git a/deps.sh b/deps.sh index d9f45e2b..00dc81ac 100755 --- a/deps.sh +++ b/deps.sh @@ -3,16 +3,26 @@ set -e +TTCTL="" +if command -v tt; then + TTCTL=tt +elif command -v tarantoolctl; then + TTCTL=tarantoolctl +else + printf "tt or tarantoolctl is required" 1>&2 + exit 1 +fi + # Test dependencies: -tarantoolctl rocks install luatest 0.5.7 -tarantoolctl rocks install luacheck 0.25.0 -tarantoolctl rocks install luacov 0.13.0 +"$TTCTL" rocks install luatest 0.5.7 +"$TTCTL" rocks install luacheck 0.25.0 +"$TTCTL" rocks install luacov 0.13.0 # cluacov, luacov-coveralls and dependencies -tarantoolctl rocks install https://raw.githubusercontent.com/mpeterv/cluacov/master/cluacov-scm-1.rockspec -tarantoolctl rocks install https://raw.githubusercontent.com/LuaDist/dkjson/master/dkjson-2.5-2.rockspec -tarantoolctl rocks install https://raw.githubusercontent.com/keplerproject/luafilesystem/master/luafilesystem-scm-1.rockspec -tarantoolctl rocks install https://raw.githubusercontent.com/moteus/lua-path/master/rockspecs/lua-path-scm-0.rockspec +"$TTCTL" rocks install https://raw.githubusercontent.com/mpeterv/cluacov/master/cluacov-scm-1.rockspec +"$TTCTL" rocks install https://raw.githubusercontent.com/LuaDist/dkjson/master/dkjson-2.5-2.rockspec +"$TTCTL" rocks install https://raw.githubusercontent.com/keplerproject/luafilesystem/master/luafilesystem-scm-1.rockspec +"$TTCTL" rocks install https://raw.githubusercontent.com/moteus/lua-path/master/rockspecs/lua-path-scm-0.rockspec # Most of this code is the workaround for # https://github.com/moteus/luacov-coveralls/pull/30 @@ -22,14 +32,14 @@ LUACOV_COVERALLS_ROCKSPEC_URL="https://raw.githubusercontent.com/moteus/luacov-c LUACOV_COVERALLS_ROCKSPEC_FILE="${TMPDIR}/luacov-coveralls-scm-0.rockspec" curl -fsSL "${LUACOV_COVERALLS_ROCKSPEC_URL}" > "${LUACOV_COVERALLS_ROCKSPEC_FILE}" sed -i -e 's@git://@git+https://@' "${LUACOV_COVERALLS_ROCKSPEC_FILE}" -tarantoolctl rocks install "${LUACOV_COVERALLS_ROCKSPEC_FILE}" +"$TTCTL" rocks install "${LUACOV_COVERALLS_ROCKSPEC_FILE}" rm "${LUACOV_COVERALLS_ROCKSPEC_FILE}" rmdir "${TMPDIR}" CARTRIDGE_VERSION="${CARTRIDGE_VERSION:-2.7.8}" -tarantoolctl rocks install cartridge "$CARTRIDGE_VERSION" -tarantoolctl rocks install ddl 1.6.2 -tarantoolctl rocks install migrations 0.4.2 +"$TTCTL" rocks install cartridge "$CARTRIDGE_VERSION" +"$TTCTL" rocks install ddl 1.6.2 +"$TTCTL" rocks install migrations 0.4.2 -tarantoolctl rocks make +"$TTCTL" rocks make