mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 00:08:25 +00:00
Various docker ci fixes
This commit is contained in:
1 parent
2cebadf010
commit
f6361ee3bd
19 files changed
+100
-53
No files matched your search
+13
-14
@@ -196,6 +196,9 @@ variables:
|
||||
ENABLE_COVERAGE:
|
||||
value: "true"
|
||||
description: "If set to false then tests will not generate coverage or testing reports used by gitlab to show nicer MRs."
|
||||
ENABLE_RELEASES:
|
||||
value: "false"
|
||||
description: "If true then on master and develop release images will be pushed automatically"
|
||||
# An image repo which is used for storing and passing images between ci pipeline jobs
|
||||
# and also speeding up ci builds by caching from the latest ci image when building.
|
||||
CI_IMAGE_REPO: $CI_REGISTRY_IMAGE/ci
|
||||
@@ -243,10 +246,6 @@ variables:
|
||||
HEROKU_DOCKERFILE_PATH: $CI_PROJECT_DIR/heroku.Dockerfile
|
||||
# The image path for the helper CI util image that will be built and pushed to.
|
||||
CI_UTIL_IMAGE: $CI_IMAGE_REPO/ci_util_image:latest
|
||||
RELEASE_REGISTRY: registry.hub.docker.com
|
||||
# An image repo where dev and normal images will be released to for public usage after
|
||||
# they have been successfully built and tested.
|
||||
RELEASE_IMAGE_REPO: baserow
|
||||
|
||||
# ==================================== CI UTIL ====================================
|
||||
|
||||
@@ -528,8 +527,8 @@ build-all-in-one-image:
|
||||
- job: build-final-backend-image
|
||||
only:
|
||||
variables:
|
||||
- $TRIGGER_FULL_IMAGE_REBUILD != "no"
|
||||
- $CI_COMMIT_BRANCH == $MASTER_BRANCH_NAME
|
||||
- $CI_COMMIT_BRANCH == $DEVELOP_BRANCH_NAME
|
||||
variables:
|
||||
IMAGE_NAME: $ALLINONE_IMAGE_NAME
|
||||
DOCKERFILE_PATH: $ALLINONE_DOCKERFILE_PATH
|
||||
@@ -545,8 +544,8 @@ build-cloudron-image:
|
||||
- job: build-all-in-one-image
|
||||
only:
|
||||
variables:
|
||||
- $TRIGGER_FULL_IMAGE_REBUILD != "no"
|
||||
- $CI_COMMIT_BRANCH == $MASTER_BRANCH_NAME
|
||||
- $CI_COMMIT_BRANCH == $DEVELOP_BRANCH_NAME
|
||||
variables:
|
||||
IMAGE_NAME: $CLOUDRON_IMAGE_NAME
|
||||
DOCKERFILE_PATH: $CLOUDRON_DOCKERFILE_PATH
|
||||
@@ -564,8 +563,8 @@ build-heroku-image:
|
||||
- job: build-all-in-one-image
|
||||
only:
|
||||
variables:
|
||||
- $TRIGGER_FULL_IMAGE_REBUILD != "no"
|
||||
- $CI_COMMIT_BRANCH == $MASTER_BRANCH_NAME
|
||||
- $CI_COMMIT_BRANCH == $DEVELOP_BRANCH_NAME
|
||||
variables:
|
||||
IMAGE_NAME: $HEROKU_IMAGE_NAME
|
||||
DOCKERFILE_PATH: $HEROKU_DOCKERFILE_PATH
|
||||
@@ -600,11 +599,11 @@ trigger-saas-build:
|
||||
allow_failure: true
|
||||
trigger:
|
||||
project: bramw/baserow-saas
|
||||
branch: develop
|
||||
branch: $CI_COMMIT_BRANCH
|
||||
|
||||
# ================================== PUSHING BACKEND ==================================
|
||||
|
||||
# Push baserow/backend:develop_latest
|
||||
# Push baserow/backend:develop-latest
|
||||
publish-backend-develop-latest-image:
|
||||
extends: .publish-baserow-image
|
||||
only:
|
||||
@@ -651,7 +650,7 @@ publish-backend-latest-release-image:
|
||||
|
||||
# ================================ PUSHING WEB-FRONTEND ===============================
|
||||
|
||||
# Push baserow/web-frontend:develop_latest
|
||||
# Push baserow/web-frontend:develop-latest
|
||||
publish-webfrontend-develop-latest-image:
|
||||
extends: .publish-baserow-image
|
||||
only:
|
||||
@@ -699,12 +698,12 @@ publish-webfrontend-latest-release-image:
|
||||
|
||||
# ================================ PUSHING ALL-IN-ONE ===============================
|
||||
|
||||
# Push baserow/baserow:develop_latest
|
||||
# Push baserow/baserow:develop-latest
|
||||
publish-allinone-develop-latest-image:
|
||||
extends: .publish-baserow-image
|
||||
only:
|
||||
variables:
|
||||
- $CI_COMMIT_BRANCH == $DEVELOP_BRANCH_NAME && $TRIGGER_FULL_IMAGE_REBUILD != "no"
|
||||
- $CI_COMMIT_BRANCH == $DEVELOP_BRANCH_NAME
|
||||
dependencies: []
|
||||
variables:
|
||||
SKIP_IF_NOT_LATEST_COMMIT_ON_BRANCH: $DEVELOP_BRANCH_NAME
|
||||
@@ -745,12 +744,12 @@ publish-allinone-latest-release-image:
|
||||
TARGET_REGISTRY_PASSWORD: $RELEASE_REGISTRY_PASSWORD
|
||||
TARGET_REGISTRY_USER: $RELEASE_REGISTRY_USER
|
||||
|
||||
# Push baserow/cloudron:develop_latest
|
||||
# Push baserow/cloudron:develop-latest
|
||||
publish-cloudron-develop-latest-image:
|
||||
extends: .publish-baserow-image
|
||||
only:
|
||||
variables:
|
||||
- $CI_COMMIT_BRANCH == $DEVELOP_BRANCH_NAME && $TRIGGER_FULL_IMAGE_REBUILD != "no"
|
||||
- $CI_COMMIT_BRANCH == $DEVELOP_BRANCH_NAME
|
||||
dependencies: []
|
||||
variables:
|
||||
SKIP_IF_NOT_LATEST_COMMIT_ON_BRANCH: $DEVELOP_BRANCH_NAME
|
||||
|
||||
@@ -396,6 +396,8 @@
|
||||
except:
|
||||
refs:
|
||||
- pipelines
|
||||
variables:
|
||||
- $ENABLE_RELEASES != "true"
|
||||
variables:
|
||||
DOCKER_HOST: tcp://docker:2376
|
||||
DOCKER_TLS_CERTDIR: "/certs"
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ ENV PYTHONPATH $PYTHONPATH:/baserow/backend/src:/baserow/premium/backend/src
|
||||
RUN dos2unix /baserow/backend/docker/docker-entrypoint.sh && \
|
||||
chmod a+x /baserow/backend/docker/docker-entrypoint.sh
|
||||
|
||||
HEALTHCHECK CMD ["/usr/bin/tini", "--", "/bin/bash", "/baserow/backend/docker/docker-entrypoint.sh", "backend-healthcheck"]
|
||||
HEALTHCHECK CMD ["/bin/bash", "/baserow/backend/docker/docker-entrypoint.sh", "backend-healthcheck"]
|
||||
ENTRYPOINT ["/usr/bin/tini", "--", "/bin/bash", "/baserow/backend/docker/docker-entrypoint.sh"]
|
||||
|
||||
FROM core as dev
|
||||
|
||||
@@ -216,7 +216,14 @@ case "$1" in
|
||||
;;
|
||||
backend-healthcheck)
|
||||
echo "Running backend healthcheck..."
|
||||
curl --silent --output /dev/null --write-out "%{http_code}" "http://localhost:$BASEROW_BACKEND_PORT/_health/"
|
||||
curlf() {
|
||||
HTTP_CODE=$(curl --silent -o /dev/null --write-out "%{http_code}" --max-time 10 "$@")
|
||||
if [[ ${HTTP_CODE} -lt 200 || ${HTTP_CODE} -gt 299 ]] ; then
|
||||
return 22
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
curlf "http://localhost:$BASEROW_BACKEND_PORT/_health/"
|
||||
;;
|
||||
bash)
|
||||
exec /bin/bash -c "${@:2}"
|
||||
@@ -334,7 +341,7 @@ case "$1" in
|
||||
wait_for_postgres
|
||||
;;
|
||||
*)
|
||||
echo "${@:2}"
|
||||
echo "Command given was $*"
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
|
||||
@@ -83,9 +83,12 @@ RUN apt-get update && \
|
||||
sed -i '/^logfile/d' /etc/redis/redis.conf && \
|
||||
chown redis:redis /etc/redis/redis.conf
|
||||
|
||||
# In slim docker images, mime.types is removed and we need it for mimetypes guessing
|
||||
COPY --chown=$UID:$GID ./backend/docker/mime.types /etc/
|
||||
|
||||
COPY --chown=$UID:$GID Caddyfile /baserow/caddy/Caddyfile
|
||||
|
||||
HEALTHCHECK CMD ["/usr/bin/tini", "--", "/bin/bash", "/baserow/backend/docker/docker-entrypoint.sh", "backend-healthcheck"]
|
||||
HEALTHCHECK CMD ["/bin/bash", "/baserow/backend/docker/docker-entrypoint.sh", "backend-healthcheck"]
|
||||
|
||||
# ========================
|
||||
# = BASEROW
|
||||
|
||||
@@ -28,8 +28,11 @@ docker run -v baserow_data:/baserow/data -p 80:80 -p 443:443 baserow/baserow:1.8
|
||||
|
||||
## Supported tags and Dockerfile Links
|
||||
|
||||
* [`1.8.3`](https://gitlab.com/bramw/baserow/-/blob/1.8.3/deploy/all-in-one/Dockerfile)
|
||||
* [`develop_latest`](https://gitlab.com/bramw/baserow/-/blob/develop/deploy/all-in-one/Dockerfile)
|
||||
* [`X.Y.Z`](https://gitlab.com/bramw/baserow/-/blob/master/deploy/all-in-one/Dockerfile)
|
||||
Tagged by Baserow version.
|
||||
* [`latest`](https://gitlab.com/bramw/baserow/-/blob/master/deploy/all-in-one/Dockerfile)
|
||||
* [`develop-latest`](https://gitlab.com/bramw/baserow/-/blob/develop/deploy/all-in-one/Dockerfile)
|
||||
This is a bleeding edge image from our development branch, use at your own risk.
|
||||
|
||||
## Quick Start
|
||||
|
||||
|
||||
@@ -305,14 +305,14 @@ case "$1" in
|
||||
startup_echo "docker exec -it baserow cat $DATA_DIR/.pgpass"
|
||||
exec /baserow/supervisor/start.sh "${@:2}"
|
||||
;;
|
||||
backend)
|
||||
backend-cmd)
|
||||
docker_safe_run /baserow/backend/docker/docker-entrypoint.sh "${@:2}"
|
||||
;;
|
||||
web-frontend)
|
||||
web-frontend-cmd)
|
||||
docker_safe_run /baserow/web-frontend/docker/docker-entrypoint.sh "${@:2}"
|
||||
;;
|
||||
*)
|
||||
echo "${@:2}"
|
||||
echo "Command given was $*"
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
|
||||
@@ -7,12 +7,14 @@ set -Eeo pipefail
|
||||
cat << EOF
|
||||
=========================================================================================
|
||||
|
||||
██████╗ █████╗ ███████╗███████╗██████╗ ██████╗ ██╗ ██╗ ██╗ █████╗ ██████╗
|
||||
██╔══██╗██╔══██╗██╔════╝██╔════╝██╔══██╗██╔═══██╗██║ ██║ ███║ ██╔══██╗ ╚════██╗
|
||||
██████╔╝███████║███████╗█████╗ ██████╔╝██║ ██║██║ █╗ ██║ ╚██║ ╚█████╔╝ █████╔╝
|
||||
██╔══██╗██╔══██║╚════██║██╔══╝ ██╔══██╗██║ ██║██║███╗██║ ██║ ██╔══██╗ ██╔═══╝
|
||||
██████╔╝██║ ██║███████║███████╗██║ ██║╚██████╔╝╚███╔███╔╝ ██║██╗╚█████╔╝██╗███████╗
|
||||
╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══╝╚══╝ ╚═╝╚═╝ ╚════╝ ╚═╝╚══════╝
|
||||
██████╗ █████╗ ███████╗███████╗██████╗ ██████╗ ██╗ ██╗
|
||||
██╔══██╗██╔══██╗██╔════╝██╔════╝██╔══██╗██╔═══██╗██║ ██║
|
||||
██████╔╝███████║███████╗█████╗ ██████╔╝██║ ██║██║ █╗ ██║
|
||||
██╔══██╗██╔══██║╚════██║██╔══╝ ██╔══██╗██║ ██║██║███╗██║
|
||||
██████╔╝██║ ██║███████║███████╗██║ ██║╚██████╔╝╚███╔███╔╝
|
||||
╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══╝╚══╝
|
||||
|
||||
Version 1.8.3
|
||||
|
||||
=========================================================================================
|
||||
EOF
|
||||
|
||||
@@ -28,5 +28,8 @@ guide for more details.
|
||||
|
||||
## Supported tags and Dockerfile Links
|
||||
|
||||
* [`1.8.3`](https://gitlab.com/bramw/baserow/-/blob/1.8.3/deploy/cloudron/Dockerfile)
|
||||
* [`develop_latest`](https://gitlab.com/bramw/baserow/-/blob/1.8.3/deploy/cloudron/Dockerfile)
|
||||
* [`X.Y.Z`](https://gitlab.com/bramw/baserow/-/blob/master/deploy/cloudron/Dockerfile)
|
||||
Tagged by Baserow version.
|
||||
* [`latest`](https://gitlab.com/bramw/baserow/-/blob/master/deploy/cloudron/Dockerfile)
|
||||
* [`develop-latest`](https://gitlab.com/bramw/baserow/-/blob/1.8.3/deploy/cloudron/Dockerfile)
|
||||
This is a bleeding edge image from our development branch, use at your own risk.
|
||||
+12
-12
@@ -4,31 +4,31 @@ In order to test your changes, you need to have the Heroku command line installe
|
||||
your local machine. Next, you can use the Heroku command line to create an app,
|
||||
manually install the `addons` and `labs` listed in the app.json file at the root of
|
||||
this repo. In the example below we assume you are at the root of the Baserow repo and
|
||||
we are going install a heroku app named `baserow-test-app-nigel`, this can of course be named
|
||||
we are going install a heroku app named `baserow-test-app`, this can of course be named
|
||||
differently.
|
||||
|
||||
```
|
||||
$ heroku apps:create baserow-test-app-nigel
|
||||
$ heroku stack:set -a baserow-test-app-nigel container
|
||||
$ heroku apps:create baserow-test-app
|
||||
$ heroku stack:set -a baserow-test-app container
|
||||
|
||||
# We need to add all the addons listed in the app.json file.
|
||||
$ heroku addons:create -a baserow-test-app-nigel heroku-postgresql:hobby-dev
|
||||
$ heroku addons:create -a baserow-test-app-nigel heroku-redis:hobby-dev
|
||||
$ heroku addons:create -a baserow-test-app-nigel mailgun:starter
|
||||
$ heroku addons:create -a baserow-test-app heroku-postgresql:hobby-dev
|
||||
$ heroku addons:create -a baserow-test-app heroku-redis:hobby-dev
|
||||
$ heroku addons:create -a baserow-test-app mailgun:starter
|
||||
|
||||
# We need to add all the labs listed in the app.json file.
|
||||
$ heroku labs:enable -a baserow-test-app-nigel runtime-dyno-metadata
|
||||
$ heroku labs:enable -a baserow-test-app runtime-dyno-metadata
|
||||
|
||||
# Finally we need to set all the environment variables listed in the app.json file.
|
||||
$ heroku config:set -a baserow-test-app-nigel SECRET_KEY=REPLACE_WITH_SECRET_VALUE
|
||||
$ heroku config:set -a baserow-test-app-nigel BASEROW_PUBLIC_URL=https://baserow-test-app-nigel.herokuapp.com
|
||||
$ heroku config:set -a baserow-test-app-nigel BASEROW_AMOUNT_OF_WORKERS=1
|
||||
$ heroku config:set -a baserow-test-app SECRET_KEY=REPLACE_WITH_SECRET_VALUE
|
||||
$ heroku config:set -a baserow-test-app BASEROW_PUBLIC_URL=
|
||||
$ heroku config:set -a baserow-test-app BASEROW_AMOUNT_OF_WORKERS=1
|
||||
```
|
||||
|
||||
Now that we have replicated the setup of the app.json, we can deploy the application
|
||||
by pushing to the heroku remote repository.
|
||||
|
||||
```
|
||||
$ git remote add heroku https://git.heroku.com/baserow-test-app-nigel.git
|
||||
$ git push heroku 758-all-in-one-docker:master
|
||||
$ git remote add heroku https://git.heroku.com/baserow-test-app.git
|
||||
$ git push heroku YOUR_CURRENT_BRANCH:master
|
||||
```
|
||||
@@ -9,7 +9,8 @@ export DJANGO_SETTINGS_MODULE='baserow.config.settings.heroku'
|
||||
export BASEROW_RUN_MINIMAL=yes
|
||||
export DISABLE_EMBEDDED_PSQL=yes
|
||||
export DISABLE_EMBEDDED_REDIS=yes
|
||||
export SYNC_TEMPLATES_ON_STARTUP="${SYNC_TEMPLATES_ON_STARTUP:-no}"
|
||||
export SYNC_TEMPLATES_ON_STARTUP="${SYNC_TEMPLATES_ON_STARTUP:-false}"
|
||||
export MIGRATE_ON_STARTUP="${MIGRATE_ON_STARTUP:-false}"
|
||||
# Heroku does not support mounting volumes!
|
||||
export DISABLE_VOLUME_CHECK=yes
|
||||
|
||||
|
||||
@@ -29,5 +29,8 @@ guide for more details.
|
||||
|
||||
## Supported tags and Dockerfile Links
|
||||
|
||||
* [`1.8.3`](https://gitlab.com/bramw/baserow/-/blob/1.8.3/backend/Dockerfile)
|
||||
* [`develop_latest`](https://gitlab.com/bramw/baserow/-/blob/develop/backend/Dockerfile)
|
||||
* [`X.Y.Z`](https://gitlab.com/bramw/baserow/-/blob/master/deploy/web-frontend/Dockerfile)
|
||||
Tagged by Baserow version.
|
||||
* [`latest`](https://gitlab.com/bramw/baserow/-/blob/master/backend/Dockerfile)
|
||||
* [`develop-latest`](https://gitlab.com/bramw/baserow/-/blob/develop/backend/Dockerfile)
|
||||
This is a bleeding edge image from our development branch, use at your own risk.
|
||||
@@ -30,5 +30,8 @@ guide for more details.
|
||||
|
||||
## Supported tags and Dockerfile Links
|
||||
|
||||
* [`1.8.3`](https://gitlab.com/bramw/baserow/-/blob/1.8.3/web-frontend/Dockerfile)
|
||||
* [`develop_latest`](https://gitlab.com/bramw/baserow/-/blob/develop/web-frontend/Dockerfile)
|
||||
* [`X.Y.Z`](https://gitlab.com/bramw/baserow/-/blob/master/deploy/web-frontend/Dockerfile)
|
||||
Tagged by Baserow version.
|
||||
* [`latest`](https://gitlab.com/bramw/baserow/-/blob/master/web-frontend/Dockerfile)
|
||||
* [`develop-latest`](https://gitlab.com/bramw/baserow/-/blob/develop/web-frontend/Dockerfile)
|
||||
This is a bleeding edge image from our development branch, use at your own risk.
|
||||
@@ -238,6 +238,7 @@ case "${1:-noneleft}" in
|
||||
shift
|
||||
;;
|
||||
help)
|
||||
echo "Command given was $*"
|
||||
show_help
|
||||
exit 0
|
||||
;;
|
||||
|
||||
@@ -21,6 +21,21 @@ and follow the steps on heroku.com to proceed. After the installation, you can r
|
||||
Baserow on the URL provided by Heroku. Everything installed via the template runs on
|
||||
the free plan of Heroku by default.
|
||||
|
||||
## Built-in Baserow templates disabled by default
|
||||
|
||||
By default, we are using the `heroku-postgresql:hobby-dev` addon because that supports
|
||||
10k rows for free. The Baserow templates require more than 10k rows, so we do not
|
||||
load them by default. If you upgrade your heroku database to support more data and
|
||||
want to load the templates run the following:
|
||||
|
||||
1. Login to Heroku and open your Baserow app
|
||||
2. Click "More" in the top right
|
||||
3. Click "Run Console"
|
||||
4. Enter and run the following command `./baserow.sh backend-cmd manage sync_templates`
|
||||
|
||||
Every time you upgrade your Heroku Baserow app you will need to repeat the steps
|
||||
above the get the latest Baserow templates.
|
||||
|
||||
## Could not connect to the API server error
|
||||
|
||||
If you are getting a "Could not connect to the API server." error when logging in or
|
||||
|
||||
+2
-1
@@ -13,4 +13,5 @@ RUN mkdir -p "$DATA_DIR" && \
|
||||
|
||||
COPY deploy/heroku/heroku_env.sh /baserow/supervisor/env/heroku_env.sh
|
||||
|
||||
CMD ["start"]
|
||||
ENTRYPOINT []
|
||||
CMD []
|
||||
+6
-2
@@ -1,5 +1,9 @@
|
||||
build:
|
||||
docker:
|
||||
web: heroku.Dockerfile
|
||||
config:
|
||||
FROM_IMAGE: registry.gitlab.com/bramw/baserow/testing/baserow:develop-latest
|
||||
release:
|
||||
image: web
|
||||
command:
|
||||
- ./baserow.sh backend-cmd manage migrate
|
||||
run:
|
||||
web: ./baserow.sh start
|
||||
@@ -46,7 +46,7 @@ RUN dos2unix /baserow/web-frontend/docker/docker-entrypoint.sh && \
|
||||
# tini installed above protects us from zombie processes and ensures the default signal
|
||||
# handlers work, see https://github.com/krallin/tini.
|
||||
ENTRYPOINT ["/usr/bin/tini", "--", "/bin/bash", "/baserow/web-frontend/docker/docker-entrypoint.sh"]
|
||||
HEALTHCHECK CMD ["/usr/bin/tini", "--", "curl", "-f", "http://localhost:3000/_health/"]
|
||||
HEALTHCHECK CMD ["curl", "-f", "http://localhost:3000/_health/"]
|
||||
|
||||
FROM base as dev
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ case "$1" in
|
||||
exec /bin/bash -c "${@:2}"
|
||||
;;
|
||||
*)
|
||||
echo "${@:2}"
|
||||
echo "Command given was $*"
|
||||
show_help
|
||||
exit 1
|
||||
;;
|
||||
|
||||
Reference in new issue
Block a user