From 12d44539325b3eb15d7710f92770694efdb10638 Mon Sep 17 00:00:00 2001 From: Nut He <18328704+hetao92@users.noreply.github.com> Date: Wed, 13 Oct 2021 11:46:40 +0800 Subject: [PATCH] mod: update workflow config --- .github/workflows/nightly.yml | 70 +++++++++++++++++++++--- .github/workflows/release.yml | 63 ++++++++++++++++++++- .github/workflows/studio-rpm-package.yml | 36 ------------ .github/workflows/studio-tar-package.yml | 38 ------------- scripts/pid.sh | 13 ----- scripts/{rpm-package.sh => rpm/pack.sh} | 0 scripts/{ => rpm}/postinst.sh | 2 +- scripts/{ => rpm}/postrm.sh | 0 scripts/{ => rpm}/preinst.sh | 0 scripts/{ => rpm}/prerm.sh | 2 +- scripts/{ => rpm}/start.sh | 0 scripts/{ => rpm}/stop.sh | 0 scripts/{rpm-upload.sh => rpm/upload.sh} | 0 scripts/{tar-package.sh => tar/pack.sh} | 0 scripts/{tar-upload.sh => tar/upload.sh} | 0 15 files changed, 123 insertions(+), 101 deletions(-) delete mode 100644 .github/workflows/studio-rpm-package.yml delete mode 100644 .github/workflows/studio-tar-package.yml delete mode 100644 scripts/pid.sh rename scripts/{rpm-package.sh => rpm/pack.sh} (100%) rename scripts/{ => rpm}/postinst.sh (86%) rename scripts/{ => rpm}/postrm.sh (100%) rename scripts/{ => rpm}/preinst.sh (100%) rename scripts/{ => rpm}/prerm.sh (82%) rename scripts/{ => rpm}/start.sh (100%) rename scripts/{ => rpm}/stop.sh (100%) rename scripts/{rpm-upload.sh => rpm/upload.sh} (100%) rename scripts/{tar-package.sh => tar/pack.sh} (100%) rename scripts/{tar-upload.sh => tar/upload.sh} (100%) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 42f0557b..fb0384c5 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -4,8 +4,8 @@ on: branches: - master jobs: - package: - name: build package + tar-package: + name: build tar package runs-on: ubuntu-latest strategy: matrix: @@ -16,16 +16,40 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: 'master' path: source/nebula-graph-studio - uses: actions/checkout@v2 with: repository: vesoft-inc/nebula-http-gateway path: source/nebula-http-gateway + ref: v2.0 + - uses: actions/setup-go@v2 + with: + go-version: '^1.13.1' + - uses: actions/setup-node@v2 + with: + node-version: '10' + - name: Package + run: bash ./source/nebula-graph-studio/scripts/tar/pack.sh + - name: Upload to OSS + run: bash ./source/nebula-graph-studio/scripts/tar/upload.sh ${{ secrets.OSS_ENDPOINT }} ${{ secrets.OSS_ID }} ${{ secrets.OSS_SECRET }} ${{ secrets.OSS_TEST_URL }} + rpm-package: + name: build rpm package + runs-on: ubuntu-latest + strategy: + matrix: + os: + - centos7 + container: + image: vesoft/nebula-dev:${{ matrix.os }} + steps: - uses: actions/checkout@v2 with: - repository: vesoft-inc/nebula-importer - path: source/nebula-importer + path: source/nebula-graph-studio + - uses: actions/checkout@v2 + with: + repository: vesoft-inc/nebula-http-gateway + path: source/nebula-http-gateway + ref: v2.0 - uses: actions/setup-go@v2 with: go-version: '^1.13.1' @@ -33,8 +57,36 @@ jobs: with: node-version: '10' - name: Package - run: bash ./source/nebula-graph-studio/scripts/rpm-package.sh ${{ secrets.GA_ID }} + run: bash ./source/nebula-graph-studio/scripts/rpm/pack.sh - name: Upload oss - run: cd ./source/nebula-graph-studio/tmp/ && ossutil64 -e ${{ secrets.OSS_ENDPOINT }} -i ${{ secrets.OSS_ID }} -k ${{ secrets.OSS_SECRET }} -f cp ./ ${{ secrets.OSS_TEST_URL }} --include "nebula-graph-studio-*.rpm*" --only-current-dir -r - - + run: bash ./source/nebula-graph-studio/scripts/rpm/upload.sh ${{ secrets.OSS_ENDPOINT }} ${{ secrets.OSS_ID }} ${{ secrets.OSS_SECRET }} ${{ secrets.OSS_TEST_URL }} + docker-image: + name: docker image build + runs-on: ubuntu-latest + steps: + - + name: Checkout Github Action + uses: actions/checkout@master + - + name: set track + run: bash ./scripts/setEventTracking.sh ${{ secrets.GA_ID }} + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Build + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: vesoft/nebula-graph-studio:nightly \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eb61db90..6431ce39 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,17 +1,74 @@ -name: Studio Image Release +name: Studio Release on: release: types: - published jobs: - release-image: + tar-package: + name: build tar package + runs-on: ubuntu-latest + strategy: + matrix: + os: + - centos7 + container: + image: vesoft/nebula-dev:${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + with: + path: source/nebula-graph-studio + - uses: actions/checkout@v2 + with: + repository: vesoft-inc/nebula-http-gateway + path: source/nebula-http-gateway + ref: v2.0 + - uses: actions/setup-go@v2 + with: + go-version: '^1.13.1' + - uses: actions/setup-node@v2 + with: + node-version: '10' + - name: Package + run: bash ./source/nebula-graph-studio/scripts/tar/pack.sh + - name: Upload to OSS + run: bash ./source/nebula-graph-studio/scripts/tar/upload.sh ${{ secrets.OSS_ENDPOINT }} ${{ secrets.OSS_ID }} ${{ secrets.OSS_SECRET }} ${{ secrets.OSS_URL }} + rpm-package: + name: build rpm package + runs-on: ubuntu-latest + strategy: + matrix: + os: + - centos7 + container: + image: vesoft/nebula-dev:${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + with: + path: source/nebula-graph-studio + - uses: actions/checkout@v2 + with: + repository: vesoft-inc/nebula-http-gateway + path: source/nebula-http-gateway + ref: v2.0 + - uses: actions/setup-go@v2 + with: + go-version: '^1.13.1' + - uses: actions/setup-node@v2 + with: + node-version: '10' + - name: Package + run: bash ./source/nebula-graph-studio/scripts/rpm/pack.sh + - name: Upload oss + run: bash ./source/nebula-graph-studio/scripts/rpm/upload.sh ${{ secrets.OSS_ENDPOINT }} ${{ secrets.OSS_ID }} ${{ secrets.OSS_SECRET }} ${{ secrets.OSS_URL }} + docker-image: + name: docker image build runs-on: ubuntu-latest steps: - name: Checkout Github Action uses: actions/checkout@master - - name: Package + name: set track run: bash ./scripts/setEventTracking.sh ${{ secrets.GA_ID }} - name: Set up QEMU diff --git a/.github/workflows/studio-rpm-package.yml b/.github/workflows/studio-rpm-package.yml deleted file mode 100644 index ae197537..00000000 --- a/.github/workflows/studio-rpm-package.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Studio RPM Package -on: - release: - types: - - published -jobs: - package: - name: build package - runs-on: ubuntu-latest - strategy: - matrix: - os: - - centos7 - container: - image: vesoft/nebula-dev:${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - with: - ref: 'master' - path: source/nebula-graph-studio - - uses: actions/checkout@v2 - with: - repository: vesoft-inc/nebula-http-gateway - path: source/nebula-http-gateway - - uses: actions/setup-go@v2 - with: - go-version: '^1.13.1' - - uses: actions/setup-node@v2 - with: - node-version: '10' - - name: Package - run: bash ./source/nebula-graph-studio/scripts/rpm-package.sh ${{ secrets.GA_ID }} - - name: Upload oss - run: bash ./source/nebula-graph-studio/scripts/rpm-upload.sh ${{ secrets.OSS_ENDPOINT }} ${{ secrets.OSS_ID }} ${{ secrets.OSS_SECRET }} ${{ secrets.OSS_URL }} - - diff --git a/.github/workflows/studio-tar-package.yml b/.github/workflows/studio-tar-package.yml deleted file mode 100644 index b21addaa..00000000 --- a/.github/workflows/studio-tar-package.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Studio Tar Package -on: - release: - types: - - published -jobs: - package: - name: build package - runs-on: ubuntu-latest - strategy: - matrix: - os: - - centos7 - container: - image: vesoft/nebula-dev:${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - with: - ref: 'master' - path: source/nebula-graph-studio - - uses: actions/checkout@v2 - with: - repository: vesoft-inc/nebula-http-gateway - path: source/nebula-http-gateway - - uses: actions/setup-go@v2 - with: - go-version: '^1.13.1' - - uses: actions/setup-node@v2 - with: - node-version: '10' - - name: ls - run: ls -a - - name: Package - run: bash ./source/nebula-graph-studio/scripts/tar-package.sh ${{ secrets.GA_ID }} - - name: Upload to OSS - run: bash ./source/nebula-graph-studio/scripts/tar-upload.sh ${{ secrets.OSS_ENDPOINT }} ${{ secrets.OSS_ID }} ${{ secrets.OSS_SECRET }} ${{ secrets.OSS_URL }} - - diff --git a/scripts/pid.sh b/scripts/pid.sh deleted file mode 100644 index f13353ed..00000000 --- a/scripts/pid.sh +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/bash -if [ $# -lt 1 ]; then - echo "Please provide a port number parameter for this script" - echo "e.g. $0 8080" - exit -fi - -hex_port=$(printf "%x" "$1") -inode=$(grep ":${hex_port^^}" /proc/net/tcp | awk '{print $10}') - -for i in $(ps axo pid); do - ls -l /proc/"$i"/fd 2>/dev/null | grep -q ":\[$inode\]" && echo "$i" -done diff --git a/scripts/rpm-package.sh b/scripts/rpm/pack.sh similarity index 100% rename from scripts/rpm-package.sh rename to scripts/rpm/pack.sh diff --git a/scripts/postinst.sh b/scripts/rpm/postinst.sh similarity index 86% rename from scripts/postinst.sh rename to scripts/rpm/postinst.sh index a1aa0242..3a71aaa2 100644 --- a/scripts/postinst.sh +++ b/scripts/rpm/postinst.sh @@ -6,4 +6,4 @@ chmod 755 ./vendors/nebula-http-gateway/nebula-httpd chmod 777 ./tmp/ tar -xzvf node_modules.tar.gz -bash ./scripts/start.sh +bash ./scripts/rpm/start.sh diff --git a/scripts/postrm.sh b/scripts/rpm/postrm.sh similarity index 100% rename from scripts/postrm.sh rename to scripts/rpm/postrm.sh diff --git a/scripts/preinst.sh b/scripts/rpm/preinst.sh similarity index 100% rename from scripts/preinst.sh rename to scripts/rpm/preinst.sh diff --git a/scripts/prerm.sh b/scripts/rpm/prerm.sh similarity index 82% rename from scripts/prerm.sh rename to scripts/rpm/prerm.sh index e79a8100..53f854b7 100644 --- a/scripts/prerm.sh +++ b/scripts/rpm/prerm.sh @@ -5,5 +5,5 @@ # kill nebula-http-gateway server set +e cd /usr/local/nebula-graph-studio/ -bash ./scripts/stop.sh +bash ./scripts/rpm/stop.sh set -e diff --git a/scripts/start.sh b/scripts/rpm/start.sh similarity index 100% rename from scripts/start.sh rename to scripts/rpm/start.sh diff --git a/scripts/stop.sh b/scripts/rpm/stop.sh similarity index 100% rename from scripts/stop.sh rename to scripts/rpm/stop.sh diff --git a/scripts/rpm-upload.sh b/scripts/rpm/upload.sh similarity index 100% rename from scripts/rpm-upload.sh rename to scripts/rpm/upload.sh diff --git a/scripts/tar-package.sh b/scripts/tar/pack.sh similarity index 100% rename from scripts/tar-package.sh rename to scripts/tar/pack.sh diff --git a/scripts/tar-upload.sh b/scripts/tar/upload.sh similarity index 100% rename from scripts/tar-upload.sh rename to scripts/tar/upload.sh