forked from zammad/zammad
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from zammad/develop
promote
- Loading branch information
Showing
1,297 changed files
with
87,541 additions
and
32,182 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# build zammads docker & docker-compose images | ||
|
||
set -o errexit | ||
set -o pipefail | ||
|
||
DOCKER_REGISTRY="index.docker.io" | ||
REPO_ROOT="$(git rev-parse --show-toplevel)" | ||
ZAMMAD_VERSION="$(git describe --tags | sed -e 's/-[a-z0-9]\{8,\}.*//g')" | ||
|
||
# dockerhub auth | ||
echo "${DOCKER_PASSWORD}" | docker login --username="${DOCKER_USERNAME}" --password-stdin | ||
|
||
# clone docker repo | ||
DOCKER_REPOSITORY_CLONE_URL="https://github.com/${REPO_USER}/${DOCKER_GITHUB_REPOSITORY}" | ||
echo "Cloning ${DOCKER_REPOSITORY_CLONE_URL}" | ||
git clone "${DOCKER_REPOSITORY_CLONE_URL}" | ||
|
||
# enter dockerfile dir | ||
cd "${REPO_ROOT}/${DOCKER_GITHUB_REPOSITORY}" | ||
|
||
# shellcheck disable=SC2153 | ||
for DOCKER_IMAGE in ${DOCKER_IMAGES}; do | ||
echo "Build Zammad Docker image ${DOCKER_IMAGE} with version ${ZAMMAD_VERSION} for DockerHubs ${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY} repo" | ||
|
||
if [ "${DOCKER_REPOSITORY}" == "zammad-docker-compose" ]; then | ||
docker build --pull --no-cache --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}" -t "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-latest" -t "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-${ZAMMAD_VERSION}" -f "containers/${DOCKER_IMAGE}/Dockerfile" . | ||
|
||
docker push "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}" | ||
docker push "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-latest" | ||
docker push "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-${ZAMMAD_VERSION}" | ||
else | ||
docker build --pull --no-cache --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:latest" -t "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${ZAMMAD_VERSION}" . | ||
|
||
docker push "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:latest" | ||
docker push "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${ZAMMAD_VERSION}" | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: build-docker-compose-images | ||
|
||
on: | ||
push: | ||
branches: [stable**] | ||
|
||
jobs: | ||
build-docker-compose-images: | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_GITHUB_REPOSITORY: "zammad-docker-compose" | ||
DOCKER_IMAGES: "zammad zammad-elasticsearch zammad-postgresql" | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
DOCKER_REPOSITORY: "zammad-docker-compose" | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
steps: | ||
- name: Extract REPO_USER from GITHUB_REPOSITORY ENV | ||
run: echo "::set-env name=REPO_USER::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}')" | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
- name: Fetch all history for all tags and branches | ||
run: git fetch --prune --unshallow | ||
- name: Build docker image | ||
run: .github/docker-image-build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: build-docker-image | ||
|
||
on: | ||
push: | ||
branches: [develop] | ||
|
||
jobs: | ||
build-docker-image: | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_GITHUB_REPOSITORY: "zammad-docker" | ||
DOCKER_IMAGES: "zammad" | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
DOCKER_REPOSITORY: "zammad" | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
steps: | ||
- name: Extract REPO_USER from GITHUB_REPOSITORY ENV | ||
run: echo "::set-env name=REPO_USER::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}')" | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
- name: Fetch all history for all tags and branches | ||
run: git fetch --prune --unshallow | ||
- name: Build docker image | ||
run: .github/docker-image-build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: ci | ||
|
||
on: | ||
pull_request | ||
|
||
jobs: | ||
lint-bash-scripts: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Lint Bash scripts | ||
uses: docker://koalaman/shellcheck-alpine:v0.7.0 | ||
with: | ||
args: .github/lint-scripts.sh | ||
|
||
ci: | ||
runs-on: ubuntu-latest | ||
needs: lint-bash-scripts | ||
services: | ||
mysql: | ||
image: mysql:5 | ||
env: | ||
MYSQL_ROOT_PASSWORD: password | ||
ports: | ||
- 13306:3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
postgres: | ||
image: postgres:11 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
ports: | ||
- 5432:5432 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
strategy: | ||
matrix: | ||
dbs: | ||
- mysql | ||
- postgresql | ||
env: | ||
RAILS_ENV: test | ||
ZAMMAD_DBS: ${{ matrix.dbs }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.6.5 | ||
- name: Increase MySQL max_allowed_packet to 1GB (workaround for unknown/missing service option) | ||
run: | | ||
sudo apt-get install -y mysql-client | ||
mysql --host 127.0.0.1 --port 13306 -uroot -ppassword -e "SET GLOBAL max_allowed_packet=1073741824;" | ||
- name: CI | ||
run: .github/ci.sh |
Oops, something went wrong.