-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves packaging image creation into Github Actions (#745)
- Loading branch information
1 parent
9a73da7
commit b32c334
Showing
9 changed files
with
136 additions
and
85 deletions.
There are no files selected for viewing
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
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,78 @@ | ||
name: Build Package | ||
|
||
env: | ||
GH_TOKEN: "${{ secrets.GH_TOKEN }}" | ||
PACKAGING_SECRET_KEY: "${{ secrets.PACKAGING_SECRET_KEY }}" | ||
PACKAGE_ENCRYPTION_KEY: "${{ secrets.PACKAGE_ENCRYPTION_KEY }}" | ||
PACKAGING_PASSPHRASE: "${{ secrets.PACKAGING_PASSPHRASE }}" | ||
DOCKERHUB_PASSWORD: "${{ secrets.DOCKERHUB_PASSWORD }}" | ||
DOCKERHUB_USER_NAME: "${{ secrets.DOCKERHUB_USER_NAME }}" | ||
CURRENT_BRANCH: ${GITHUB_REF##*/} | ||
on: | ||
push: | ||
branches: "**" | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
check_docker_files_integrity: | ||
name: Check if docker files are compliant with templates | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Update and check dockerfiles | ||
run: | | ||
./update_dockerfiles | ||
git add --intent-to-add dockerfiles | ||
git diff --exit-code dockerfiles | ||
build_package: | ||
name: Build package | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
TARGET_PLATFORM: | ||
- centos,8 | ||
- centos,7 | ||
- debian,bullseye | ||
- debian,buster | ||
- debian,stretch | ||
- oraclelinux,8 | ||
- oraclelinux,7 | ||
- ubuntu,focal | ||
- ubuntu,bionic | ||
- ubuntu,xenial | ||
- pgxn | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install package dependencies | ||
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources | ||
|
||
- name: Install wheel for el/8 | ||
if: matrix.TARGET_PLATFORM == 'centos,8' | ||
run: python -m pip install wheel | ||
|
||
- name: Build image for the target platform | ||
run: | | ||
git checkout -- dockerfiles | ||
./update_image | ||
env: | ||
TARGET_PLATFORM: ${{ matrix.TARGET_PLATFORM }} | ||
|
||
- name: Clone tools repo for test | ||
run: git clone -b v0.8.8 --depth=1 https://github.com/citusdata/tools.git tools | ||
|
||
- name: Execute packaging tests | ||
run: | | ||
python -m pip install -r tools/packaging_automation/requirements.txt | ||
python -m pytest -q tools/packaging_automation/tests/test_citus_package.py -k 'test_build_packages' | ||
env: | ||
PACKAGING_IMAGE_PLATFORM: "${{matrix.TARGET_PLATFORM}}" | ||
|
||
- name: Push images | ||
run: ./ci/push_images |
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
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,52 @@ | ||
#!/bin/bash | ||
|
||
# This script builds a docker image that is used for packaging. | ||
# | ||
# This script requires $TARGET_PLATFORM env to contain a supported platform name. | ||
# Sample platform names 'debian,buster', 'centos,7' etc. | ||
|
||
# make bash behave | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
|
||
pgversions='10 11 12 13 14' | ||
topdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
dockerfiles_dir="${topdir}/dockerfiles" | ||
|
||
badusage=64 | ||
|
||
|
||
nprocs="${1:-1}" | ||
|
||
declare args | ||
|
||
|
||
IFS=',' read -r os release <<< "${TARGET_PLATFORM}" | ||
|
||
if [[ "${os}" = 'debian' ]] || [[ "${os}" = 'ubuntu' ]]; then | ||
tag="${os}-${release}-all" | ||
args+="build -t citus/packaging:${tag} -f ${dockerfiles_dir}/${tag}/Dockerfile .\n" | ||
elif [[ "${os}" = 'centos' ]] || [[ "${os}" = 'oraclelinux' ]]; then | ||
# redhat variants need an image for each PostgreSQL version | ||
IFS=' ' | ||
for pgversion in ${pgversions}; do | ||
if { [[ "${os}" = 'centos' ]] || [[ "${os}" = 'oraclelinux' ]]; } && \ | ||
[[ "${release}" = '6' ]] && [[ "${pgversion}" = '13' ]]; then | ||
# CentOS and OracleLinux 6 doesn't have pg13 packages yet. | ||
# So skip building docker images for them. | ||
continue | ||
fi | ||
pgshort=${pgversion//./} | ||
tag="${os}-${release}-pg${pgshort}" | ||
args+="build -t citus/packaging:${tag} -f ${dockerfiles_dir}/${tag}/Dockerfile .\n" | ||
done | ||
elif [[ "${os}" = 'pgxn' ]]; then | ||
tag="${os}-all" | ||
args+="build -t citus/packaging:${tag} -f ${dockerfiles_dir}/${tag}/Dockerfile .\n" | ||
else | ||
echo "$0: unrecognized OS -- ${os}" >&2 | ||
exit $badusage | ||
fi | ||
|
||
|
||
echo -e "${args}" | xargs -t -L1 -P "${nprocs}" docker |
This file was deleted.
Oops, something went wrong.