mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-11-09 23:00:56 +00:00
317 lines
13 KiB
YAML
317 lines
13 KiB
YAML
sudo: required
|
|
|
|
dist: bionic
|
|
|
|
language: python
|
|
|
|
python:
|
|
- '3.6'
|
|
|
|
services:
|
|
- docker
|
|
|
|
before_install:
|
|
# Install latest docker (https://www.docker.com/blog/multi-arch-build-what-about-travis)
|
|
- sudo rm -rf /var/lib/apt/lists/*
|
|
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
|
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge"
|
|
- sudo apt-get update
|
|
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
|
|
- mkdir -vp ~/.docker/cli-plugins/
|
|
- curl --silent -L "https://github.com/docker/buildx/releases/download/v0.5.1/buildx-v0.5.1.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
|
|
- chmod a+x ~/.docker/cli-plugins/docker-buildx
|
|
- docker buildx create --use
|
|
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
|
- docker buildx inspect --bootstrap
|
|
|
|
- if [[ "$BUILD" != "development" ]]; then
|
|
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin;
|
|
sudo apt-get update && sudo apt-get -y install git;
|
|
fi
|
|
- if [[ $BUILD == "development" ]];then
|
|
sudo apt-get update && sudo apt-get -y install curl;
|
|
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose;
|
|
sudo chmod +x /usr/local/bin/docker-compose;
|
|
fi
|
|
|
|
after_success:
|
|
- docker --version
|
|
|
|
jobs:
|
|
include:
|
|
- stage: "Build Frappe bench development environment (latest)"
|
|
if: branch = develop AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/bench:latest
|
|
-f build/bench/Dockerfile .
|
|
- stage: "Frappe Worker (edge)"
|
|
if: branch = develop AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-worker:edge
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-worker:develop
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-worker:latest
|
|
-f build/frappe-worker/Dockerfile .
|
|
- stage: "Frappe Nginx (edge)"
|
|
if: branch = develop AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-nginx:edge
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-nginx:develop
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-nginx:latest
|
|
-f build/frappe-nginx/Dockerfile .
|
|
- stage: "Frappe SocketIO (edge)"
|
|
if: branch = develop AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-socketio:edge
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-socketio:develop
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-socketio:latest
|
|
-f build/frappe-socketio/Dockerfile .
|
|
- stage: "ERPNext Worker (edge)"
|
|
if: branch = develop AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg DOCKER_REGISTRY_PREFIX:=frappe=${DOCKER_REGISTRY_PREFIX:=frappe}
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-worker:edge
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-worker:develop
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-worker:latest
|
|
-f build/erpnext-worker/Dockerfile .
|
|
- stage: "ERPNext Nginx (edge)"
|
|
if: branch = develop AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg DOCKER_REGISTRY_PREFIX:=frappe=${DOCKER_REGISTRY_PREFIX:=frappe}
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-nginx:edge
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-nginx:develop
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-nginx:latest
|
|
-f build/erpnext-nginx/Dockerfile .
|
|
- stage: "Frappe Worker (v13-beta)"
|
|
if: branch = master AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg GIT_BRANCH=version-13-beta
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-worker:v13
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-worker:${VERSION}
|
|
-f build/frappe-worker/Dockerfile .
|
|
- stage: "Frappe Nginx (v13-beta)"
|
|
if: branch = master AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--no-cache
|
|
--build-arg GIT_BRANCH=version-13-beta
|
|
--platform linux/amd64,linux/arm64
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-nginx:v13
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-nginx:${VERSION}
|
|
-f build/frappe-nginx/Dockerfile .
|
|
- stage: "Frappe SocketIO (v13-beta)"
|
|
if: branch = master AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg GIT_BRANCH=version-13-beta
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-socketio:v13
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-socketio:${VERSION}
|
|
-f build/frappe-socketio/Dockerfile .
|
|
- stage: "ERPNext Worker (v13-beta)"
|
|
if: branch = master AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg GIT_BRANCH=version-13-beta
|
|
--build-arg DOCKER_REGISTRY_PREFIX:=frappe=${DOCKER_REGISTRY_PREFIX:=frappe}
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-worker:v13
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-worker:${VERSION}
|
|
-f build/erpnext-worker/Dockerfile .
|
|
- stage: "ERPNext Nginx (v13-beta)"
|
|
if: branch = master AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg GIT_BRANCH=version-13-beta
|
|
--build-arg DOCKER_REGISTRY_PREFIX:=frappe=${DOCKER_REGISTRY_PREFIX:=frappe}
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-nginx:v13
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-nginx:${VERSION}
|
|
-f build/erpnext-nginx/Dockerfile .
|
|
- stage: "Frappe Worker (v12)"
|
|
if: branch = master AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg GIT_BRANCH=version-12
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-worker:v12
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-worker:${VERSION}
|
|
-f build/frappe-worker/Dockerfile .
|
|
- stage: "Frappe Nginx (v12)"
|
|
if: branch = master AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--no-cache
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg GIT_BRANCH=version-12
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-nginx:v12
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-nginx:${VERSION}
|
|
-f build/frappe-nginx/Dockerfile .
|
|
- stage: "Frappe SocketIO (v12)"
|
|
if: branch = master AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg GIT_BRANCH=version-12
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-socketio:v12
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-socketio:${VERSION}
|
|
-f build/frappe-socketio/Dockerfile .
|
|
- stage: "ERPNext Worker (v12)"
|
|
if: branch = master AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg GIT_BRANCH=version-12
|
|
--build-arg DOCKER_REGISTRY_PREFIX:=frappe=${DOCKER_REGISTRY_PREFIX:=frappe}
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-worker:v12
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-worker:${VERSION}
|
|
-f build/erpnext-worker/Dockerfile .
|
|
- stage: "ERPNext Nginx (v12)"
|
|
if: branch = master AND type != pull_request
|
|
script:
|
|
- docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg GIT_BRANCH=version-12
|
|
--build-arg DOCKER_REGISTRY_PREFIX:=frappe=${DOCKER_REGISTRY_PREFIX:=frappe}
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-nginx:v12
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-nginx:${VERSION}
|
|
-f build/erpnext-nginx/Dockerfile .
|
|
- stage: "Frappe Worker (v11)"
|
|
if: branch = master AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg GIT_BRANCH=version-11
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-worker:v11
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-worker:${VERSION}
|
|
-f build/frappe-worker/Dockerfile .
|
|
- stage: "Frappe Nginx (v11)"
|
|
if: branch = master AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--no-cache
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg GIT_BRANCH=version-11
|
|
--build-arg NODE_IMAGE_TAG=10-buster-slim
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-nginx:v11
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-nginx:${VERSION}
|
|
-f build/frappe-nginx/Dockerfile .
|
|
- stage: "Frappe SocketIO (v11)"
|
|
if: branch = master AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg GIT_BRANCH=version-11
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-socketio:v11
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/frappe-socketio:${VERSION}
|
|
-f build/frappe-socketio/Dockerfile .
|
|
- stage: "ERPNext Worker (v11)"
|
|
if: branch = master AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg GIT_BRANCH=version-11
|
|
--build-arg DOCKER_REGISTRY_PREFIX:=frappe=${DOCKER_REGISTRY_PREFIX:=frappe}
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-worker:v11
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-worker:${VERSION}
|
|
-f build/erpnext-worker/Dockerfile .
|
|
- stage: "ERPNext Nginx (v11)"
|
|
if: branch = master AND type != pull_request
|
|
script:
|
|
- >
|
|
docker buildx build
|
|
--platform linux/amd64,linux/arm64
|
|
--build-arg GIT_BRANCH=version-11
|
|
--build-arg NODE_IMAGE_TAG=10-buster-slim
|
|
--build-arg DOCKER_REGISTRY_PREFIX:=frappe=${DOCKER_REGISTRY_PREFIX:=frappe}
|
|
--push
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-nginx:v11
|
|
-t ${DOCKER_REGISTRY_PREFIX:=frappe}/erpnext-nginx:${VERSION}
|
|
-f build/erpnext-nginx/Dockerfile .
|
|
- stage: "Build and test edge images"
|
|
if: type = pull_request
|
|
before_install:
|
|
- sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
|
- sudo chmod +x /usr/local/bin/docker-compose
|
|
- sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
|
|
- sudo apt-get update && sudo apt-get -y install w3m
|
|
script:
|
|
- docker build -t frappe/frappe-socketio:edge -f build/frappe-socketio/Dockerfile .
|
|
- docker build -t frappe/frappe-worker:develop -f build/frappe-worker/Dockerfile .
|
|
- docker build -t frappe/erpnext-worker:edge -f build/erpnext-worker/Dockerfile .
|
|
- docker build -t frappe/frappe-nginx:develop -f build/frappe-nginx/Dockerfile .
|
|
- docker build -t frappe/erpnext-nginx:edge -f build/erpnext-nginx/Dockerfile .
|
|
- ./tests/docker-test.sh
|
|
- stage: "Pull and test edge images"
|
|
if: branch = develop AND type != pull_request
|
|
before_install:
|
|
- sudo apt-get update && sudo apt-get -y install docker-compose w3m
|
|
script:
|
|
- ./tests/docker-test.sh
|
|
- stage: "Helm Chart Release"
|
|
if: branch = master AND type != pull_request
|
|
env:
|
|
- GIT_SSH_COMMAND="ssh -i ${TRAVIS_BUILD_DIR}/deploy_key"
|
|
before_install:
|
|
- openssl aes-256-cbc -K $encrypted_189e52c2c347_key -iv $encrypted_189e52c2c347_iv -in deploy_key.enc -out deploy_key -d;
|
|
chmod 400 deploy_key;
|
|
- ssh-keyscan github.com >> $HOME/.ssh/known_hosts 2>/dev/null;
|
|
install:
|
|
- pip install --upgrade pip
|
|
script:
|
|
- git clone git@github.com:frappe/helm.git && cd helm
|
|
- pip install -r release_wizard/requirements.txt
|
|
- ./release_wizard/wizard 12 patch --remote origin --ci
|