Explorar el Código

ci: get package version per profile

Zaiming (Stone) Shi hace 4 años
padre
commit
b44b090d9e

+ 1 - 1
.ci/build_packages/tests.sh

@@ -202,7 +202,7 @@ EOF
 }
 }
 
 
 relup_test(){
 relup_test(){
-    TARGET_VERSION="$("$CODE_PATH"/pkg-vsn.sh)"
+    TARGET_VERSION="$("$CODE_PATH"/pkg-vsn.sh "${EMQX_NAME}")"
     if [ -d "${RELUP_PACKAGE_PATH}" ];then
     if [ -d "${RELUP_PACKAGE_PATH}" ];then
         cd "${RELUP_PACKAGE_PATH}"
         cd "${RELUP_PACKAGE_PATH}"
 
 

+ 6 - 6
.github/workflows/build_packages.yaml

@@ -38,12 +38,12 @@ jobs:
         run: |
         run: |
           ce_vsn="$(./pkg-vsn.sh community)"
           ce_vsn="$(./pkg-vsn.sh community)"
           ee_vsn="$(./pkg-vsn.sh enterprise)"
           ee_vsn="$(./pkg-vsn.sh enterprise)"
-          ce_pre_vsn="$(echo $ce_vsn | grep -oE '^[0-9]+.[0-9]')"
-          ee_pre_vsn="$(echo $ee_vsn | grep -oE '^[0-9]+.[0-9]')"
-          ce_old_vsns="$(git tag -l "v$ce_pre_vsn.[0-9]" | xargs echo -n | sed "s/v$ce_vsn//")"
-          ee_old_vsns="$(git tag -l "e$ee_pre_vsn.[0-9]" | xargs echo -n | sed "s/v$ee_vsn//")"
-          echo "::set-output name=ce_old_vsns::$ce_old_vsns"
-          echo "::set-output name=ee_old_vsns::$ee_old_vsns"
+          ce_base_vsn_prefix="$(echo $ce_vsn | grep -oE '^[0-9]+\.[0-9]+')"
+          ee_base_vsn_prefix="$(echo $ee_vsn | grep -oE '^[0-9]+\.[0-9]+')"
+          ce_old_vsns="$(git tag -l | grep -E "v${ce_base_vsn_prefix}\.[0-9]+$" | grep -v "v${ee_vsn}" | xargs)"
+          ee_old_vsns="$(git tag -l | grep -E "e${ee_base_vsn_prefix}\.[0-9]+$" | grep -v "e${ee_vsn}" | xargs)"
+          echo "::set-output name=ce_old_vsns::${ce_old_vsns}"
+          echo "::set-output name=ee_old_vsns::${ee_old_vsns}"
       - name: get_all_deps
       - name: get_all_deps
         run: |
         run: |
           make -C source deps-all
           make -C source deps-all

+ 6 - 3
.github/workflows/run_broker_tests.yaml

@@ -27,9 +27,12 @@ jobs:
       id: build_docker
       id: build_docker
       if: endsWith(github.repository, 'emqx')
       if: endsWith(github.repository, 'emqx')
       run: |
       run: |
-        make emqx-docker
-        echo "::set-output name=version::$(./pkg-vsn.sh)"
-        docker save -o emqx.tar emqx/emqx:$(./pkg-vsn.sh)
+        ## TODO: make profile a matrix dimension
+        PROFILE='emqx'
+        make "${PROFILE}-docker"
+        VSN="$(./pkg-vsn.sh $PROFILE)"
+        echo "::set-output name=version::${VSN}"
+        docker save -o emqx.tar emqx/emqx:${VSN}
     - uses: actions/upload-artifact@v2
     - uses: actions/upload-artifact@v2
       with:
       with:
         name: emqx.tar
         name: emqx.tar

+ 1 - 1
.github/workflows/run_fvt_tests.yaml

@@ -156,7 +156,7 @@ jobs:
       run: |
       run: |
         make ${{ matrix.profile }}-docker
         make ${{ matrix.profile }}-docker
         echo "TARGET=emqx/${{ matrix.profile }}" >> $GITHUB_ENV
         echo "TARGET=emqx/${{ matrix.profile }}" >> $GITHUB_ENV
-        echo "EMQX_TAG=$(./pkg-vsn.sh)" >> $GITHUB_ENV
+        echo "EMQX_TAG=$(./pkg-vsn.sh ${{ matrix.profile }})" >> $GITHUB_ENV
     - run: minikube start
     - run: minikube start
     - name: run emqx on chart
     - name: run emqx on chart
       timeout-minutes: 5
       timeout-minutes: 5