mirror of
https://github.com/zokradonh/kopano-docker
synced 2025-07-24 18:35:27 +00:00
125 lines
4.9 KiB
YAML
125 lines
4.9 KiB
YAML
# This is a basic workflow to help you get started with Actions
|
|
|
|
name: buildndeploy
|
|
|
|
# Controls when the workflow will run
|
|
on:
|
|
# Triggers the workflow on push or pull request events but only for the master branch
|
|
push:
|
|
branches:
|
|
- pipeline
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
ADDITIONAL_KOPANO_PACKAGES:
|
|
ADDITIONAL_KOPANO_WEBAPP_PLUGINS:
|
|
KOPANO_UID: 999
|
|
KOPANO_GID: 999
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
jobs:
|
|
docker:
|
|
# The type of runner that the job will run on
|
|
runs-on: ubuntu-latest
|
|
|
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
with:
|
|
driver: docker
|
|
#- name: Install linting tools
|
|
# run: |
|
|
# .ci/setup-tools.sh
|
|
#- name: Lint
|
|
# run: |
|
|
# ./version.sh
|
|
# make lint
|
|
# tests/test.exp
|
|
# ./version.sh
|
|
# commander test tests/commander.yaml
|
|
# - name: Cache Kopano Docker layers
|
|
# uses: actions/cache@v2
|
|
# with:
|
|
# path: /tmp/.buildx-cache
|
|
# key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
# restore-keys: |
|
|
# ${{ runner.os }}-buildx-
|
|
- name: Extract Version information
|
|
id: kopano-versions
|
|
run: |
|
|
./gh_output_dockertags.sh core
|
|
./gh_output_dockertags.sh webapp
|
|
./gh_output_dockertags.sh kapps
|
|
./gh_output_dockertags.sh kdav
|
|
./gh_output_dockertags.sh meet
|
|
./gh_output_dockertags.sh zpush
|
|
- name: Prepare Kopano APT Packages Cache
|
|
id: apt-cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: /tmp/.kopano-repo-helper-cache
|
|
key: ${{ runner.os }}-kopano-${{ steps.kopano-versions.outputs.core_version }}-${{ steps.kopano-versions.outputs.webapp_version }}-${{ steps.kopano-versions.outputs.zpush_version }}-${{ steps.kopano-versions.outputs.meet_version }}-${{ steps.kopano-versions.outputs.kapps_version }}-${{ steps.kopano-versions.outputs.kdav_version }}
|
|
- name: Download Kopano APT Packages
|
|
if: steps.apt-cache.outputs.cache-hit != 'true'
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
push: false
|
|
tags: zokradonh/kopano_repo_helper
|
|
context: repo
|
|
# We need this custom cache implementation here. buildx driver `docker-container` supports all
|
|
# kinds of caching mechanisms but it is always trying to pull images from a registry during build.
|
|
# It is never loading from local `docker images` that we use for our `kopano_repo_helper`.
|
|
# Therefore, we use buildx driver `docker` which mimics plain old docker with full `docker images` support
|
|
# but it lacks a lot of caching options. Since there is no plan to build for different platforms
|
|
# we can stick with driver `docker`.
|
|
- name: Cache Kopano APT Packages
|
|
if: steps.apt-cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
mkdir -p /tmp/.kopano-repo-helper-cache/
|
|
docker save -o /tmp/.kopano-repo-helper-cache/kopano_repo_helper.tar zokradonh/kopano_repo_helper
|
|
- name: Use Kopano APT Packages from cache
|
|
if: steps.apt-cache.outputs.cache-hit == 'true'
|
|
run: docker load /tmp/.kopano-repo-helper-cache/kopano_repo_helper.tar
|
|
# - name: Prepare Docker Layer Cache # TODO cache by old registry image (with BUILDKIT_INLINE_CACHE) or `docker save`
|
|
# uses: actions/cache@v2
|
|
# with:
|
|
# path: /tmp/.layer-cache
|
|
# key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
# restore-keys: ${{ runner.os }}-buildx- # also allow old caches. Docker decides if the old cache is of any use.
|
|
- name: Build base
|
|
uses: ./.github/actions/build-component
|
|
with:
|
|
push: false
|
|
component: base
|
|
- name: Build core
|
|
uses: ./.github/actions/build-component
|
|
with:
|
|
push: false
|
|
component: core
|
|
tags: ${{ steps.kopano-versions.outputs.core_version_tags }}
|
|
- name: Build webapp
|
|
uses: ./.github/actions/build-component
|
|
with:
|
|
push: false
|
|
component: webapp
|
|
tags: ${{ steps.kopano-versions.outputs.webapp_version_tags }}
|
|
- name: Build zpush
|
|
uses: ./.github/actions/build-component
|
|
with:
|
|
push: false
|
|
component: zpush
|
|
tags: ${{ steps.kopano-versions.outputs.zpush_version_tags }}
|
|
# - name: Test
|
|
# run: |
|
|
# echo "KCCONF_SERVER_SURVEYCLIENT_INTERVAL=0" >> kopano_server.env
|
|
# echo "KOPANO_SURVEYCLIENT_ENABLED=false" >> kopano_konnect.env
|
|
# echo "KOPANO_SURVEYCLIENT_ENABLED=false" >> kopano_kwmserver.env
|
|
# make test-ci
|
|
# docker-compose down -v
|
|
# make test-startup-meet-demo
|