mirror of https://github.com/Budibase/budibase.git
18 changed files with 52 additions and 315 deletions
@ -1,47 +0,0 @@ |
|||
name: Budibase Release Staging (Pro) |
|||
|
|||
# Temporary pipeline - eventualy this will be merged with the regular one |
|||
|
|||
on: |
|||
push: |
|||
branches: |
|||
- pro-develop |
|||
paths: |
|||
- ".aws/**" |
|||
- ".github/**" |
|||
- "charts/**" |
|||
- "packages/**" |
|||
- "scripts/**" |
|||
- "package.json" |
|||
- "yarn.lock" |
|||
- "package.json" |
|||
- "yarn.lock" |
|||
|
|||
env: |
|||
POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }} |
|||
INTERCOM_TOKEN: ${{ secrets.INTERCOM_TOKEN }} |
|||
POSTHOG_URL: ${{ secrets.POSTHOG_URL }} |
|||
|
|||
jobs: |
|||
release: |
|||
runs-on: ubuntu-latest |
|||
|
|||
steps: |
|||
- uses: actions/checkout@v2 |
|||
- uses: actions/setup-node@v1 |
|||
with: |
|||
node-version: 14.x |
|||
- run: yarn |
|||
- run: yarn bootstrap |
|||
- run: yarn lint |
|||
- run: yarn build |
|||
- run: yarn test |
|||
|
|||
- name: Build/release Docker images (Pro) |
|||
run: | |
|||
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD |
|||
yarn build:docker:develop:pro |
|||
yarn release:docker:pro develop |
|||
env: |
|||
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} |
|||
DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }} |
|||
@ -1,41 +0,0 @@ |
|||
name: Budibase Release Selfhost (Pro) |
|||
|
|||
# Temporary pipeline - eventualy this will be merged with the regular one |
|||
|
|||
on: |
|||
workflow_dispatch: |
|||
|
|||
jobs: |
|||
release: |
|||
runs-on: ubuntu-latest |
|||
|
|||
steps: |
|||
- uses: actions/checkout@v2 |
|||
with: |
|||
node-version: 14.x |
|||
fetch_depth: 0 |
|||
|
|||
- name: Tag and release Docker images (Pro) (Self Host) |
|||
run: | |
|||
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD |
|||
|
|||
# Get latest release version |
|||
release_version=$(cat lerna.json | jq -r '.version') |
|||
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV |
|||
release_tag=v$release_version |
|||
|
|||
# Pull apps and worker images |
|||
docker pull budibase/apps-pro:$release_tag |
|||
docker pull budibase/worker-pro:$release_tag |
|||
|
|||
# Tag apps and worker images |
|||
docker tag budibase/apps-pro:$release_tag budibase/apps-pro:$SELFHOST_TAG |
|||
docker tag budibase/worker-pro:$release_tag budibase/worker-pro:$SELFHOST_TAG |
|||
|
|||
# Push images |
|||
docker push budibase/apps-pro:$SELFHOST_TAG |
|||
docker push budibase/worker-pro:$SELFHOST_TAG |
|||
env: |
|||
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} |
|||
DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }} |
|||
SELFHOST_TAG: latest |
|||
@ -1,53 +0,0 @@ |
|||
name: Budibase Release (Pro) |
|||
|
|||
# Temporary pipeline - eventualy this will be merged with the regular one |
|||
|
|||
on: |
|||
push: |
|||
branches: |
|||
- pro-master |
|||
paths: |
|||
- ".aws/**" |
|||
- ".github/**" |
|||
- "charts/**" |
|||
- "packages/**" |
|||
- "scripts/**" |
|||
- "package.json" |
|||
- "yarn.lock" |
|||
- "package.json" |
|||
- "yarn.lock" |
|||
|
|||
env: |
|||
POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }} |
|||
INTERCOM_TOKEN: ${{ secrets.INTERCOM_TOKEN }} |
|||
POSTHOG_URL: ${{ secrets.POSTHOG_URL }} |
|||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} |
|||
|
|||
jobs: |
|||
release: |
|||
runs-on: ubuntu-latest |
|||
|
|||
steps: |
|||
- uses: actions/checkout@v2 |
|||
- uses: actions/setup-node@v1 |
|||
with: |
|||
node-version: 14.x |
|||
- run: yarn |
|||
- run: yarn bootstrap |
|||
- run: yarn lint |
|||
- run: yarn build |
|||
- run: yarn test |
|||
|
|||
- name: "Get Previous tag" |
|||
id: previoustag |
|||
uses: "WyriHaximus/github-action-get-previous-tag@v1" |
|||
|
|||
- name: Build/release Docker images |
|||
run: | |
|||
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD |
|||
yarn build:docker:pro |
|||
yarn release:docker:pro ${BUDIBASE_RELEASE_VERSION} |
|||
env: |
|||
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} |
|||
DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }} |
|||
BUDIBASE_RELEASE_VERSION: ${{ steps.previoustag.outputs.tag }} |
|||
@ -1,16 +0,0 @@ |
|||
#!/bin/bash |
|||
|
|||
tag=$1 |
|||
|
|||
if [[ ! "$tag" ]]; then |
|||
echo "No tag present. You must pass a tag to this script" |
|||
exit 1 |
|||
fi |
|||
|
|||
echo "Tagging images with tag: $tag" |
|||
|
|||
docker tag app-service-pro budibase/apps-pro:$tag |
|||
docker tag worker-service-pro budibase/worker-pro:$tag |
|||
|
|||
docker push --all-tags budibase/apps-pro |
|||
docker push --all-tags budibase/worker-pro |
|||
@ -1,52 +0,0 @@ |
|||
const fetch = require('node-fetch') |
|||
const fs = require('fs') |
|||
const util = require('util') |
|||
const streamPipeline = util.promisify(require('stream').pipeline) |
|||
|
|||
async function download (url, opts, path) { |
|||
const response = await fetch(url, opts) |
|||
if (!response.ok) throw new Error(`unexpected response ${response.statusText}`) |
|||
await streamPipeline(response.body, fs.createWriteStream(path)) |
|||
} |
|||
|
|||
const install = async () => { |
|||
// get github token
|
|||
const token = process.env.GITHUB_TOKEN |
|||
if (!token) { |
|||
throw new Error("Missing token") |
|||
} |
|||
|
|||
// get version from package.json
|
|||
let packageJson = JSON.parse(fs.readFileSync('package.json')) |
|||
let version = packageJson.dependencies['@budibase/pro'] |
|||
if (version.startsWith('^')) { |
|||
version = version.substring(1) |
|||
} |
|||
const ghVersion = `v${version}` |
|||
|
|||
// get the package url
|
|||
// TODO: Add semver support
|
|||
// TODO: Potentially can use yarn to download directly from github if pro becomes a non monorepo
|
|||
const resp = await fetch(`https://api.github.com/repos/budibase/budibase-pro/releases`, { |
|||
headers: { |
|||
Authorization: `token ${token}`, |
|||
Accept: "application/vnd.github.v3.raw" |
|||
} |
|||
}) |
|||
|
|||
if (!resp.ok) { |
|||
throw new Error("Failed to get release info. Aborting") |
|||
} |
|||
const releases = await resp.json() |
|||
const release = releases.filter(r => r.name === ghVersion)[0] |
|||
const url = release.assets.filter(a => a.name === "pro.zip")[0].url |
|||
|
|||
console.log("Downloading pro package") |
|||
// download the package
|
|||
await download(url, { headers: { Authorization: `token ${token}`, Accept: 'application/octet-stream' }}, './pro.zip') |
|||
} |
|||
|
|||
install().catch(e => { |
|||
console.error(e) |
|||
process.exit(1) |
|||
}) |
|||
@ -1,8 +0,0 @@ |
|||
#!/bin/bash |
|||
|
|||
if [[ ! -z "${PRO}" ]]; then |
|||
echo "Installing pro package" |
|||
rm -rf node_modules/@budibase/pro |
|||
unzip pro.zip -d node_modules/@budibase |
|||
rm pro.zip |
|||
fi |
|||
File diff suppressed because one or more lines are too long
@ -0,0 +1,12 @@ |
|||
import * as pro from "@budibase/pro" |
|||
import { poc, License } from "@budibase/pro" |
|||
|
|||
export const run = () => { |
|||
if (process.env.PRO) { |
|||
const license: License = { id: "123" } |
|||
console.log(license) |
|||
console.log(poc) |
|||
console.log(pro) |
|||
console.log("PRO") |
|||
} |
|||
} |
|||
Loading…
Reference in new issue