diff --git a/.github/workflows/ecs_deploy.yml b/.github/workflows/ecs_deploy.yml deleted file mode 100644 index 0d662c9c28..0000000000 --- a/.github/workflows/ecs_deploy.yml +++ /dev/null @@ -1,85 +0,0 @@ -# This workflow will build and push a new container image to Amazon ECR, -# and then will deploy a new task definition to Amazon ECS, when a release is created -# -# To use this workflow, you will need to complete the following set-up steps: -# -# 1. Create an ECR repository to store your images. -# For example: `aws ecr create-repository --repository-name my-ecr-repo --region us-east-2`. -# Replace the value of `ECR_REPOSITORY` in the workflow below with your repository's name. -# Replace the value of `aws-region` in the workflow below with your repository's region. -# -# 2. Create an ECS task definition, an ECS cluster, and an ECS service. -# For example, follow the Getting Started guide on the ECS console: -# https://us-east-2.console.aws.amazon.com/ecs/home?region=us-east-2#/firstRun -# Replace the values for `service` and `cluster` in the workflow below with your service and cluster names. -# -# 3. Store your ECS task definition as a JSON file in your repository. -# The format should follow the output of `aws ecs register-task-definition --generate-cli-skeleton`. -# Replace the value of `task-definition` in the workflow below with your JSON file's name. -# Replace the value of `container-name` in the workflow below with the name of the container -# in the `containerDefinitions` section of the task definition. -# -# 4. Store an IAM user access key in GitHub Actions secrets named `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`. -# See the documentation for each action used below for the recommended IAM policies for this IAM user, -# and best practices on handling the access key credentials. - -on: - push: - tags: - - 'v*' - -name: Deploy to Amazon ECS - -jobs: - deploy: - name: deploy - runs-on: ubuntu-16.04 - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: eu-west-1 - - - name: Download task definition - run: | - aws ecs describe-task-definition --task-definition ProdAppServerStackprodbudiapplbfargateserviceprodbudiappserverfargatetaskdefinition2EF7F1E7 --query taskDefinition > task-definition.json - - - name: Login to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@v1 - - - name: Build, tag, and push image to Amazon ECR - id: build-image - env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - ECR_REPOSITORY: prod-budi-app-server - IMAGE_TAG: ${{ github.sha }} - run: | - # Build a docker container and - # push it to ECR so that it can - # be deployed to ECS - cd packages/server - docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . - docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" - - name: Fill in the new image ID in the Amazon ECS task definition - id: task-def - uses: aws-actions/amazon-ecs-render-task-definition@v1 - with: - task-definition: task-definition.json - container-name: prod-budi-app-server - image: ${{ steps.build-image.outputs.image }} - - - name: Deploy Amazon ECS task definition - uses: aws-actions/amazon-ecs-deploy-task-definition@v1 - with: - task-definition: ${{ steps.task-def.outputs.task-definition }} - service: prod-budi-app-server-service - cluster: prod-budi-app-server - wait-for-service-stability: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d016c10520..588f0c54ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,6 +42,10 @@ jobs: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc yarn release + - 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 @@ -50,15 +54,18 @@ jobs: env: DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }} + BUDIBASE_RELEASE_VERSION: ${{ steps.previoustag.outputs.tag }} - - uses: azure/setup-helm@v1 - id: install + - uses: azure/setup-helm@v1 + id: install - - run: yarn release:helm + # So, we need to inject the values into this + - run: yarn release:helm - - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.1.0 - with: - charts_dir: docs - env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.1.0 + with: + charts_dir: docs + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + \ No newline at end of file diff --git a/hosting/kubernetes/budibase/Chart.yaml b/hosting/kubernetes/budibase/Chart.yaml index bcba5f5059..b82cb3bab2 100644 --- a/hosting/kubernetes/budibase/Chart.yaml +++ b/hosting/kubernetes/budibase/Chart.yaml @@ -38,3 +38,4 @@ dependencies: - name: ingress-nginx version: 3.35.0 repository: https://github.com/kubernetes/ingress-nginx + condition: services.ingress.nginx diff --git a/hosting/kubernetes/budibase/templates/alb-ingress.yaml b/hosting/kubernetes/budibase/templates/alb-ingress.yaml new file mode 100644 index 0000000000..ea3bd674d5 --- /dev/null +++ b/hosting/kubernetes/budibase/templates/alb-ingress.yaml @@ -0,0 +1,35 @@ +{{- if .Values.ingress.aws }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ingress-budibase + annotations: + kubernetes.io/ingress.class: alb + alb.ingress.kubernetes.io/scheme: internet-facing + alb.ingress.kubernetes.io/target-type: ip + {{- if .Values.ingress.certificateArn }} + alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}' + alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]' + alb.ingress.kubernetes.io/certificate-arn: {{ .Values.ingress.certificateArn }} + {{- end }} +spec: + rules: + - http: + paths: + {{- if .Values.ingress.certificateArn }} + - path: / + pathType: Prefix + backend: + service: + name: ssl-redirect + port: + name: use-annotation + {{- end }} + - path: / + pathType: Prefix + backend: + service: + name: proxy-service + port: + number: {{ .Values.services.proxy.port }} +{{- end }} \ No newline at end of file diff --git a/hosting/kubernetes/budibase/templates/app-service-deployment.yaml b/hosting/kubernetes/budibase/templates/app-service-deployment.yaml index daee03620f..b101ab7854 100644 --- a/hosting/kubernetes/budibase/templates/app-service-deployment.yaml +++ b/hosting/kubernetes/budibase/templates/app-service-deployment.yaml @@ -58,6 +58,10 @@ spec: key: jwtSecret - name: LOG_LEVEL value: {{ .Values.services.apps.logLevel | default "info" | quote }} + {{ if .Values.services.objectStore.region }} + - name: AWS_REGION + value: {{ .Values.services.objectStore.region }} + {{ end }} - name: MINIO_ACCESS_KEY valueFrom: secretKeyRef: diff --git a/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml b/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml index 1af289f4aa..703d59c075 100644 --- a/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml +++ b/hosting/kubernetes/budibase/templates/worker-service-deployment.yaml @@ -55,6 +55,10 @@ spec: secretKeyRef: name: {{ template "budibase.fullname" . }} key: jwtSecret + {{ if .Values.services.objectStore.region }} + - name: AWS_REGION + value: {{ .Values.services.objectStore.region }} + {{ end }} - name: MINIO_ACCESS_KEY valueFrom: secretKeyRef: diff --git a/hosting/kubernetes/budibase/values.yaml b/hosting/kubernetes/budibase/values.yaml index e5ce7f141f..30594f95e3 100644 --- a/hosting/kubernetes/budibase/values.yaml +++ b/hosting/kubernetes/budibase/values.yaml @@ -41,6 +41,7 @@ service: ingress: enabled: true + nginx: true certificateArn: "" className: "" annotations: @@ -135,6 +136,7 @@ services: replicaCount: 1 accessKey: "" # AWS_ACCESS_KEY if using S3 or existing minio access key secretKey: "" # AWS_SECRET_ACCESS_KEY if using S3 or existing minio secret + region: "" # AWS_REGION if using S3 or existing minio secret url: "" # only change if pointing to existing minio cluster and minio: false storage: 100Mi diff --git a/hosting/scripts/linux/release-to-docker-hub.sh b/hosting/scripts/linux/release-to-docker-hub.sh index b3c380f729..ccb5fa09a0 100755 --- a/hosting/scripts/linux/release-to-docker-hub.sh +++ b/hosting/scripts/linux/release-to-docker-hub.sh @@ -1,12 +1,23 @@ #!/bin/bash tag=$1 -tag=${tag:-latest} +production=$2 -echo "Tagging images with SHA: $GITHUB_SHA and tag: $tag" +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 budibase/apps:$tag docker tag worker-service budibase/worker:$tag -docker push budibase/apps:$tag -docker push budibase/worker:$tag +if [[ "$production" ]]; then + echo "Production Deployment. Tagging latest.." + docker tag app-service budibase/apps:latest + docker tag worker-service budibase/worker:latest +fi + +docker push --all-tags budibase/apps +docker push --all-tags budibase/worker diff --git a/lerna.json b/lerna.json index 97318cc4ea..8188c1c229 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.105-alpha.28", + "version": "0.9.105-alpha.31", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/package.json b/package.json index 43d0014e55..05c69e54dc 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "lint:fix": "yarn run lint:fix:ts && yarn run lint:fix:prettier && yarn run lint:fix:eslint", "test:e2e": "lerna run cy:test", "test:e2e:ci": "lerna run cy:ci", - "build:docker": "lerna run build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh && cd -", + "build:docker": "lerna run build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh $BUDIBASE_RELEASE_VERSION release && cd -", "build:docker:develop": "node scripts/pinVersions && lerna run build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh develop && cd -", "release:helm": "./scripts/release_helm_chart.sh", "multi:enable": "lerna run multi:enable", diff --git a/packages/auth/package.json b/packages/auth/package.json index 7164601550..ad5afd5691 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.105-alpha.28", + "version": "0.9.105-alpha.31", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index ac1f2874fa..f6275b7fe3 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.105-alpha.28", + "version": "0.9.105-alpha.31", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -65,6 +65,7 @@ "@spectrum-css/search": "^3.0.2", "@spectrum-css/sidenav": "^3.0.2", "@spectrum-css/statuslight": "^3.0.2", + "@spectrum-css/stepper": "^3.0.3", "@spectrum-css/switch": "^1.0.2", "@spectrum-css/table": "^3.0.1", "@spectrum-css/tabs": "^3.0.1", diff --git a/packages/bbui/src/Form/Core/Multiselect.svelte b/packages/bbui/src/Form/Core/Multiselect.svelte index 94d4f2b768..3eb1add267 100644 --- a/packages/bbui/src/Form/Core/Multiselect.svelte +++ b/packages/bbui/src/Form/Core/Multiselect.svelte @@ -12,6 +12,7 @@ export let getOptionValue = option => option export let readonly = false export let autocomplete = false + export let sort = false const dispatch = createEventDispatcher() $: selectedLookupMap = getSelectedLookupMap(value) @@ -83,4 +84,5 @@ {getOptionLabel} {getOptionValue} onSelectOption={toggleOption} + {sort} /> diff --git a/packages/bbui/src/Form/Core/Picker.svelte b/packages/bbui/src/Form/Core/Picker.svelte index de7bfb02b8..8acbc4e1a6 100644 --- a/packages/bbui/src/Form/Core/Picker.svelte +++ b/packages/bbui/src/Form/Core/Picker.svelte @@ -25,11 +25,12 @@ export let quiet = false export let autoWidth = false export let autocomplete = false + export let sort = false const dispatch = createEventDispatcher() let searchTerm = null - $: sortedOptions = getSortedOptions(options, getOptionLabel) + $: sortedOptions = getSortedOptions(options, getOptionLabel, sort) $: filteredOptions = getFilteredOptions( sortedOptions, searchTerm, @@ -45,10 +46,13 @@ open = true } - const getSortedOptions = (options, getLabel) => { + const getSortedOptions = (options, getLabel, sort) => { if (!options?.length || !Array.isArray(options)) { return [] } + if (!sort) { + return options + } return options.sort((a, b) => { const labelA = getLabel(a) const labelB = getLabel(b) diff --git a/packages/bbui/src/Form/Core/Select.svelte b/packages/bbui/src/Form/Core/Select.svelte index 3a2daf25cf..413b11dd34 100644 --- a/packages/bbui/src/Form/Core/Select.svelte +++ b/packages/bbui/src/Form/Core/Select.svelte @@ -15,6 +15,7 @@ export let quiet = false export let autoWidth = false export let autocomplete = false + export let sort = false const dispatch = createEventDispatcher() let open = false @@ -72,6 +73,7 @@ {getOptionIcon} {fieldIcon} {autocomplete} + {sort} isPlaceholder={value == null || value === ""} placeholderOption={placeholder} isOptionSelected={option => option === value} diff --git a/packages/bbui/src/Form/Core/Stepper.svelte b/packages/bbui/src/Form/Core/Stepper.svelte new file mode 100644 index 0000000000..895dc2d3de --- /dev/null +++ b/packages/bbui/src/Form/Core/Stepper.svelte @@ -0,0 +1,172 @@ + + +
+ {#if error} + + {/if} + +
+ +
+ + + + +
+ + diff --git a/packages/bbui/src/Form/Core/index.js b/packages/bbui/src/Form/Core/index.js index a31c5941ec..440c4a1b15 100644 --- a/packages/bbui/src/Form/Core/index.js +++ b/packages/bbui/src/Form/Core/index.js @@ -9,3 +9,4 @@ export { default as CoreSwitch } from "./Switch.svelte" export { default as CoreSearch } from "./Search.svelte" export { default as CoreDatePicker } from "./DatePicker.svelte" export { default as CoreDropzone } from "./Dropzone.svelte" +export { default as CoreStepper } from "./Stepper.svelte" diff --git a/packages/bbui/src/Form/Multiselect.svelte b/packages/bbui/src/Form/Multiselect.svelte index 1bb0039914..957dcccddf 100644 --- a/packages/bbui/src/Form/Multiselect.svelte +++ b/packages/bbui/src/Form/Multiselect.svelte @@ -13,6 +13,7 @@ export let options = [] export let getOptionLabel = option => option export let getOptionValue = option => option + export let sort = false const dispatch = createEventDispatcher() const onChange = e => { @@ -29,6 +30,7 @@ {value} {options} {placeholder} + {sort} {getOptionLabel} {getOptionValue} on:change={onChange} diff --git a/packages/bbui/src/Form/Select.svelte b/packages/bbui/src/Form/Select.svelte index eecc719a9a..b6547c0a98 100644 --- a/packages/bbui/src/Form/Select.svelte +++ b/packages/bbui/src/Form/Select.svelte @@ -16,6 +16,7 @@ export let getOptionIcon = option => option?.icon export let quiet = false export let autoWidth = false + export let sort = false const dispatch = createEventDispatcher() const onChange = e => { @@ -41,6 +42,7 @@ {options} {placeholder} {autoWidth} + {sort} {getOptionLabel} {getOptionValue} {getOptionIcon} diff --git a/packages/bbui/src/Form/Stepper.svelte b/packages/bbui/src/Form/Stepper.svelte new file mode 100644 index 0000000000..9eff2e368e --- /dev/null +++ b/packages/bbui/src/Form/Stepper.svelte @@ -0,0 +1,45 @@ + + + + + diff --git a/packages/bbui/src/Menu/Item.svelte b/packages/bbui/src/Menu/Item.svelte index b6ab8862df..a5609683a8 100644 --- a/packages/bbui/src/Menu/Item.svelte +++ b/packages/bbui/src/Menu/Item.svelte @@ -19,7 +19,7 @@