diff --git a/.github/workflows/build-package.yml b/.github/workflows/build-package.yml new file mode 100644 index 000000000..42625a4e4 --- /dev/null +++ b/.github/workflows/build-package.yml @@ -0,0 +1,76 @@ +name: Build Package + +env: + CURRENT_BRANCH: ${GITHUB_REF##*/} + GH_TOKEN: "${{ secrets.GH_TOKEN }}" + PACKAGING_SECRET_KEY: "${{ secrets.PACKAGING_SECRET_KEY }}" + PACKAGE_CLOUD_REPO_NAME: "sample" + PACKAGE_ENCRYPTION_KEY: "${{ secrets.PACKAGE_ENCRYPTION_KEY }}" + PACKAGING_PASSPHRASE: "${{ secrets.PACKAGING_PASSPHRASE }}" +on: + push: + branches: "**" + + workflow_dispatch: + +jobs: + build_package: + name: Build package + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + TARGET_PLATFORM: + - centos,8 + - centos,7 + - debian,buster + - debian,stretch + - oraclelinux,8 + - oraclelinux,7 + - ubuntu,focal + - ubuntu,bionic + - ubuntu,xenial + - pgxn + + steps: + - name: Export target platform + run: echo $TARGET_PLATFORM > os-list.csv + + - name: Pwd0 + run: echo $(pwd) + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install package dependencies + run: sudo apt-get update && sudo apt install libcurl4-openssl-dev libssl-dev + + - name: Pwd + run: echo $(pwd) + + - name: Update and check dockerfiles + run: | + ./update_dockerfiles + git add --intent-to-add dockerfiles + git diff --exit-code dockerfiles + + - name: Build images + run: | + git checkout -- dockerfiles + ./update_images + + - name: Clone tools repo for test + run: git clone -b develop_tests --depth=1 https://github.com/citusdata/tools.git tools + + - name: Pwd 2 + run: echo $(pwd) + + - 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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0299a8dc6..000000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -sudo: required -services: [docker] -language: perl -perl: "5.18" -env: - matrix: - - TARGET_PLATFORM=centos,8 - - TARGET_PLATFORM=centos,7 - - TARGET_PLATFORM=debian,buster - - TARGET_PLATFORM=debian,stretch - - TARGET_PLATFORM=oraclelinux,8 - - TARGET_PLATFORM=oraclelinux,7 - - TARGET_PLATFORM=oraclelinux,6 - - TARGET_PLATFORM=ubuntu,focal - - TARGET_PLATFORM=ubuntu,bionic - - TARGET_PLATFORM=ubuntu,xenial - - TARGET_PLATFORM=pgxn -before_install: - - echo $TARGET_PLATFORM > os-list.csv -install: true -script: - - ./update_dockerfiles - - git add --intent-to-add dockerfiles - - git diff --exit-code dockerfiles - - git checkout -- dockerfiles - - ./update_images - - ./ci/push_images diff --git a/ci/push_images b/ci/push_images index c3ad883e7..6103e888f 100755 --- a/ci/push_images +++ b/ci/push_images @@ -12,12 +12,12 @@ badusage=64 nprocs="${1:-1}" -if [[ $TRAVIS_PULL_REQUEST != "false" ]] || [[ $TRAVIS_BRANCH != "develop" ]] ; then +if [[ ${CURRENT_BRANCH} != "develop" ]] ; then echo "PR is not merged to develop, not pushing to DockerHub" exit 0; fi -echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin +echo "${DOCKERHUB_PASSWORD}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin declare args