Skip to content

Commit

Permalink
Merge pull request #3 from getredash/master
Browse files Browse the repository at this point in the history
Redash update
  • Loading branch information
sumit0k authored May 27, 2024
2 parents 6df6803 + ec051a8 commit 008e944
Show file tree
Hide file tree
Showing 374 changed files with 23,969 additions and 17,088 deletions.
4 changes: 2 additions & 2 deletions .circleci/Dockerfile.cypress → .ci/Dockerfile.cypress
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM cypress/browsers:node14.17.0-chrome91-ff89
FROM cypress/browsers:node18.12.0-chrome106-ff106

ENV APP /usr/src/app
WORKDIR $APP

COPY package.json yarn.lock .yarnrc $APP/
COPY viz-lib $APP/viz-lib
RUN npm install [email protected].10 -g && yarn --frozen-lockfile --network-concurrency 1 > /dev/null
RUN npm install [email protected].22 -g && yarn --frozen-lockfile --network-concurrency 1 > /dev/null

COPY . $APP

Expand Down
10 changes: 6 additions & 4 deletions .circleci/docker-compose.circle.yml → .ci/compose.ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2.2'
services:
redash:
build: ../
Expand All @@ -12,12 +11,15 @@ services:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis:https://redis:6379/0"
REDASH_DATABASE_URL: "postgresql:https://postgres@postgres/postgres"
POSTGRES_PASSWORD: "FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb"
REDASH_DATABASE_URL: "postgresql:https://postgres:FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb@postgres/postgres"
REDASH_COOKIE_SECRET: "2H9gNG9obnAQ9qnR9BDTQUph6CbXKCzF"
redis:
image: redis:3.0-alpine
image: redis:7-alpine
restart: unless-stopped
postgres:
image: postgres:9.5.6-alpine
image: pgautoupgrade/pgautoupgrade:latest
command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
restart: unless-stopped
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
version: "2.2"
x-redash-service: &redash-service
build:
context: ../
args:
skip_dev_deps: "true"
skip_ds_deps: "true"
install_groups: "main"
code_coverage: ${CODE_COVERAGE}
x-redash-environment: &redash-environment
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis:https://redis:6379/0"
REDASH_DATABASE_URL: "postgresql:https://postgres@postgres/postgres"
POSTGRES_PASSWORD: "FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb"
REDASH_DATABASE_URL: "postgresql:https://postgres:FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb@postgres/postgres"
REDASH_RATELIMIT_ENABLED: "false"
REDASH_ENFORCE_CSRF: "true"
REDASH_COOKIE_SECRET: "2H9gNG9obnAQ9qnR9BDTQUph6CbXKCzF"
Expand Down Expand Up @@ -44,7 +43,7 @@ services:
ipc: host
build:
context: ../
dockerfile: .circleci/Dockerfile.cypress
dockerfile: .ci/Dockerfile.cypress
depends_on:
- server
- worker
Expand All @@ -64,9 +63,11 @@ services:
CYPRESS_PROJECT_ID: ${CYPRESS_PROJECT_ID}
CYPRESS_RECORD_KEY: ${CYPRESS_RECORD_KEY}
redis:
image: redis:3.0-alpine
image: redis:7-alpine
restart: unless-stopped
postgres:
image: postgres:9.5.6-alpine
image: pgautoupgrade/pgautoupgrade:latest
command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
restart: unless-stopped
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"
39 changes: 39 additions & 0 deletions .ci/docker_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

# This script only needs to run on the main Redash repo

if [ "${GITHUB_REPOSITORY}" != "getredash/redash" ]; then
echo "Skipping image build for Docker Hub, as this isn't the main Redash repository"
exit 0
fi

if [ "${GITHUB_REF_NAME}" != "master" ] && [ "${GITHUB_REF_NAME}" != "preview-image" ]; then
echo "Skipping image build for Docker Hub, as this isn't the 'master' nor 'preview-image' branch"
exit 0
fi

if [ "x${DOCKER_USER}" = "x" ] || [ "x${DOCKER_PASS}" = "x" ]; then
echo "Skipping image build for Docker Hub, as the login details aren't available"
exit 0
fi

set -e
VERSION=$(jq -r .version package.json)
VERSION_TAG="$VERSION.b${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}"

export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1

docker login -u "${DOCKER_USER}" -p "${DOCKER_PASS}"

DOCKERHUB_REPO="redash/redash"
DOCKER_TAGS="-t redash/redash:preview -t redash/preview:${VERSION_TAG}"

# Build the docker container
docker build --build-arg install_groups="main,all_ds,dev" ${DOCKER_TAGS} .

# Push the container to the preview build locations
docker push "${DOCKERHUB_REPO}:preview"
docker push "redash/preview:${VERSION_TAG}"

echo "Built: ${VERSION_TAG}"
File renamed without changes.
6 changes: 6 additions & 0 deletions .ci/update_version
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
VERSION=$(jq -r .version package.json)
FULL_VERSION=${VERSION}+b${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}

sed -ri "s/^__version__ = '([A-Za-z0-9.-]*)'/__version__ = '${FULL_VERSION}'/" redash/__init__.py
sed -i "s/dev/${GITHUB_SHA}/" client/app/version.json
182 changes: 0 additions & 182 deletions .circleci/config.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .circleci/docker_build

This file was deleted.

6 changes: 0 additions & 6 deletions .circleci/update_version

This file was deleted.

1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
client/.tmp/
client/dist/
node_modules/
viz-lib/node_modules/
.tmp/
Expand Down
Loading

0 comments on commit 008e944

Please sign in to comment.