package_rainbond

This commit is contained in:
ZhangSetSail 2022-04-21 22:42:38 +08:00
parent f38283a516
commit b606e8fe09
2 changed files with 215 additions and 1 deletions

View File

@ -0,0 +1,214 @@
name: Scheduled automatic packaging
on:
repository_dispatch:
types:
- GitHub
- GitLab
jobs:
build-ui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the Docker image
env:
BUILD_RBD_APP_UI: false
TRAVIS_PULL_REQUEST: false
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
IMAGE_NAMESPACE: ${{ secrets.IMAGE_NAMESPACE }}
VERSION: ${{ github.event.client_payload.version }}
run: |
if ${{ github.event.action }} == 'GitHub';then
git clone -b ${{ github.event.client_payload.branch }} ${{ github.event.client_payload.clone_url }}/rainbond-ui.git
else
git clone -b ${{ github.event.client_payload.branch }} ${{ github.event.client_payload.clone_url }}/rainbond-ui-cloud.git
fi
cd rainbond-ui
chmod +x ./build.sh
./build.sh
build-rainbond-allinone:
needs: build-ui
runs-on: ubuntu-18.04
steps:
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 yapf==0.26.0
- name: Pull code and Build allinone image
env:
VERSION: ${{ github.event.client_payload.version }}
TRAVIS_PULL_REQUEST: false
DOMESTIC_NAMESPACE: ${{ secrets.DOMESTIC_NAMESPACE }}
DOMESTIC_DOCKER_PASSWORD: ${{ secrets.DOMESTIC_DOCKER_PASSWORD }}
DOMESTIC_DOCKER_USERNAME: ${{ secrets.DOMESTIC_DOCKER_USERNAME }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
IMAGE_NAMESPACE: ${{ secrets.IMAGE_NAMESPACE }}
DOMESTIC_BASE_NAME: ${{ secrets.DOMESTIC_BASE_NAME }}
run: |
if ${{ github.event.action }} == 'GitHub';then
git clone -b ${{ github.event.client_payload.branch }} ${{ github.event.client_payload.clone_url }}/rainbond-console.git
else
git clone -b ${{ github.event.client_payload.branch }} ${{ github.event.client_payload.clone_url }}/rainbond-console-cloud.git
fi
cd rainbond-console
chmod +x ./release.sh
./release.sh allinone
build-rainbond-region:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Setup Go environment
uses: actions/setup-go@v2.1.3
with:
# The Go version to download (if necessary) and use. Supports semver spec and ranges.
go-version: 1.13
- name: Pull code and Build the Docker image
env:
VERSION: ${{ github.event.client_payload.version }}
DISABLE_GOPROXY: true
DOMESTIC_BASE_NAME: ${{ secrets.DOMESTIC_BASE_NAME }}
IMAGE_NAMESPACE: ${{ secrets.IMAGE_NAMESPACE }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOMESTIC_DOCKER_PASSWORD: ${{ secrets.DOMESTIC_DOCKER_PASSWORD }}
DOMESTIC_DOCKER_USERNAME: ${{ secrets.DOMESTIC_DOCKER_USERNAME }}
DOMESTIC_NAMESPACE: ${{ secrets.DOMESTIC_NAMESPACE }}
run: |
if ${{ github.event.action }} == 'GitHub';then
git clone -b ${{ github.event.client_payload.branch }} ${{ github.event.client_payload.clone_url }}/rainbond.git
else
git clone -b ${{ github.event.client_payload.branch }} ${{ github.event.client_payload.clone_url }}/rainbond.git
fi
cd rainbond
chmod +x ./release.sh
./release.sh all push
build-operator:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Go environment
uses: actions/setup-go@v2.1.3
with:
# The Go version to download (if necessary) and use. Supports semver spec and ranges.
go-version: 1.15
- name: install-golint
run: go get -u golang.org/x/lint/golint
- name: Build and push
env:
IMAGE_NAMESPACE: ${{ secrets.IMAGE_NAMESPACE }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOMESTIC_DOCKER_PASSWORD: ${{ secrets.DOMESTIC_DOCKER_PASSWORD }}
DOMESTIC_DOCKER_USERNAME: ${{ secrets.DOMESTIC_DOCKER_USERNAME }}
DOMESTIC_BASE_NAME: ${{ secrets.DOMESTIC_BASE_NAME }}
DOMESTIC_NAMESPACE: ${{ secrets.DOMESTIC_NAMESPACE }}
VERSION: ${{ github.event.client_payload.version }}
run: |
git clone -b release-2.1 ${{ github.event.client_payload.clone_url }}/rainbond-operator.git
cd rainbond-operator
chmod +x ./release.sh
./release.sh
build-offline:
needs: [build-rainbond-allinone,build-rainbond-region,build-operator]
runs-on: ubuntu-18.04
steps:
- name: Pack offline packages
env:
IMAGE_NAMESPACE: ${{ secrets.IMAGE_NAMESPACE }}
RBD_VER: ${{ github.event.client_payload.version }}
TRAVIS_PULL_REQUEST: false
DOMESTIC_NAMESPACE: ${{ secrets.DOMESTIC_NAMESPACE }}
DOMESTIC_DOCKER_PASSWORD: ${{ secrets.DOMESTIC_DOCKER_PASSWORD }}
DOMESTIC_DOCKER_USERNAME: ${{ secrets.DOMESTIC_DOCKER_USERNAME }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOMESTIC_BASE_NAME: ${{ secrets.DOMESTIC_BASE_NAME }}
run: |
wget https://rainbond-script.oss-cn-hangzhou.aliyuncs.com/enterprise_offline_package.sh
chmod +x ./enterprise_offline_package.sh
./enterprise_offline_package.sh
- name: Setup aliyun oss
uses: manyuanrong/setup-ossutil@master
with:
endpoint: oss-cn-shanghai.aliyuncs.com
access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }}
access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
- name: Push to OSS
run: ossutil cp -rf rainbond-offline-*.tgz oss://rainbond-pkg/offline/5.X/
build-dind:
needs: [build-ui,build-rainbond-region,build-operator]
runs-on: ubuntu-18.04
if: ${{ github.event.action }} == 'GitHub'
steps:
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 yapf==0.26.0
- name: Pack offline packages
env:
IMAGE_NAMESPACE: ${{ secrets.IMAGE_NAMESPACE }}
RBD_VER: ${{ github.event.client_payload.version }}
TRAVIS_PULL_REQUEST: false
DOMESTIC_NAMESPACE: ${{ secrets.DOMESTIC_NAMESPACE }}
DOMESTIC_BASE_NAME: ${{ secrets.DOMESTIC_BASE_NAME }}
run: |
git clone -b ${{ github.event.client_payload.branch }} ${{ github.event.client_payload.clone_url }}/rainbond-console.git
cd rainbond-console
chmod +x ./build_dind_package.sh
./build_dind_package.sh
- name: Setup aliyun oss
uses: manyuanrong/setup-ossutil@master
with:
endpoint: oss-cn-shanghai.aliyuncs.com
access-key-id: ${{ secrets.OSS_ACCESS_KEY_ID }}
access-key-secret: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
- name: Push to OSS
run: |
cd rainbond-console
ossutil cp -rf ./rainbond*.tar oss://rainbond-pkg/images-pkg/
- name: Pull code and Build allinone image
env:
VERSION: ${{ github.event.client_payload.version }}
TRAVIS_PULL_REQUEST: false
DOMESTIC_NAMESPACE: ${{ secrets.DOMESTIC_NAMESPACE }}
DOMESTIC_DOCKER_PASSWORD: ${{ secrets.DOMESTIC_DOCKER_PASSWORD }}
DOMESTIC_DOCKER_USERNAME: ${{ secrets.DOMESTIC_DOCKER_USERNAME }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
IMAGE_NAMESPACE: ${{ secrets.IMAGE_NAMESPACE }}
DOMESTIC_BASE_NAME: ${{ secrets.DOMESTIC_BASE_NAME }}
CLONE_URL: ${{ github.event.client_payload.clone_url }}
BRANCH: ${{ github.event.client_payload.branch }}
run: |
cd rainbond-console
chmod +x ./release.sh
./release.sh dind

View File

@ -4,7 +4,7 @@ set -o errexit
# define package name # define package name
WORK_DIR=/go/src/github.com/goodrain/rainbond WORK_DIR=/go/src/github.com/goodrain/rainbond
BASE_NAME=rainbond BASE_NAME=rainbond
IMAGE_BASE_NAME=${BUILD_IMAGE_BASE_NAME:-'rainbond'} IMAGE_BASE_NAME=${IMAGE_NAMESPACE:-'rainbond'}
DOMESTIC_NAMESPACE=${DOMESTIC_NAMESPACE:-'goodrain'} DOMESTIC_NAMESPACE=${DOMESTIC_NAMESPACE:-'goodrain'}
GOARCH=${BUILD_GOARCH:-'amd64'} GOARCH=${BUILD_GOARCH:-'amd64'}