From 3361edaefdc16985ce23c56b8046f0a49fb5b0ab Mon Sep 17 00:00:00 2001 From: Daniel Rodowicz Date: Tue, 14 May 2024 14:53:31 -0400 Subject: [PATCH 1/2] remove manifest update scripts No-Issue --- .github/post-job-template.yml.j2 | 20 ----- .github/workflows/ci.yml | 20 ----- .github/workflows/scripts/update_manifest.sh | 83 -------------------- template_config.yml | 4 +- 4 files changed, 1 insertion(+), 126 deletions(-) delete mode 100644 .github/post-job-template.yml.j2 delete mode 100755 .github/workflows/scripts/update_manifest.sh diff --git a/.github/post-job-template.yml.j2 b/.github/post-job-template.yml.j2 deleted file mode 100644 index ba5c40c4e4..0000000000 --- a/.github/post-job-template.yml.j2 +++ /dev/null @@ -1,20 +0,0 @@ -update_manifest: - runs-on: ubuntu-latest - needs: test - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: "Set GITHUB_BRANCH" - run: | - GITHUB_BRANCH=`sed 's/^refs\/heads\///' <<< $GITHUB_REF` - echo "GITHUB_BRANCH=${GITHUB_BRANCH}" >> $GITHUB_ENV - - - name: Update Manifest for Ansible Hub UI - env: - GITHUB_PULL_REQUEST: {{ "${{ github.event.number }}" }} - MANIFEST_PASSPHRASE: {{ "${{ secrets.MANIFEST_PASSPHRASE }}" }} - shell: bash - run: | - cd .. - .github/workflows/scripts/update_manifest.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43dd462ef9..86a5894322 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,23 +79,3 @@ jobs: echo '${{toJson(needs)}}' | jq -r 'to_entries[]|select(.value.result!="success")|.key + ": " + .value.result' echo '${{toJson(needs)}}' | jq -e 'to_entries|map(select(.value.result!="success"))|length == 0' echo "CI says: Looks good!" - update_manifest: - runs-on: ubuntu-latest - needs: test - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: "Set GITHUB_BRANCH" - run: | - GITHUB_BRANCH=`sed 's/^refs\/heads\///' <<< $GITHUB_REF` - echo "GITHUB_BRANCH=${GITHUB_BRANCH}" >> $GITHUB_ENV - - - name: Update Manifest for Ansible Hub UI - env: - GITHUB_PULL_REQUEST: ${{ github.event.number }} - MANIFEST_PASSPHRASE: ${{ secrets.MANIFEST_PASSPHRASE }} - shell: bash - run: | - cd .. - .github/workflows/scripts/update_manifest.sh diff --git a/.github/workflows/scripts/update_manifest.sh b/.github/workflows/scripts/update_manifest.sh deleted file mode 100755 index c746eaa596..0000000000 --- a/.github/workflows/scripts/update_manifest.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env bash - - -set -o nounset -set -o errexit - - -readonly GITHUB_PULL_REQUEST="${GITHUB_PULL_REQUEST:-}" -readonly GITHUB_BRANCH="${GITHUB_BRANCH:-}" - -readonly MANIFESTS_GIT_USER="${MANIFESTS_GIT_USER:-rh-galaxy-droid}" -readonly MANIFESTS_GIT_EMAIL="${MANIFESTS_GIT_EMAIL:-galaxy_ng+manifests@example.com}" -readonly MANIFESTS_GIT_URL="git@github.com:RedHatInsights/manifests.git" - -readonly MANIFESTS_DIR='/tmp/manifests' -readonly MANIFEST_FILE="${MANIFESTS_DIR}/automation-hub/automation-hub-api.txt" - -readonly PREFIX='services-ansible-automation-hub:api' -readonly DOCKERFILE='Dockerfile' - - -log_message() { - echo "$BASH_SOURCE:" "$@" >&2 -} - -generate_python_manifest() { - # "aiodns==3.0.0" -> "services-ansible-automation-hub:api/aiodns:3.0.0.pypi" - sed -e 's/#.*$//' -e '/^\s*$/d' -e '/^git+/d' -e 's/^/'"$PREFIX"'\//' -e 's/==/:/' -e 's/$/.pypi/' requirements/requirements.insights.txt | sort -} - -generate_docker_manifest() { - base_image=$(sed -n -e 's/^FROM //p' "${DOCKERFILE}") - if [[ "$base_image" != */* ]]; then - base_image="docker.io/${base_image}" - fi - echo "${PREFIX}/Dockerfile-FROM-${base_image}" -} - -if [[ -n "$GITHUB_PULL_REQUEST" ]]; then - log_message 'Ignoring manifest update for pull request.' - exit 0 -fi - -if [[ "${GITHUB_BRANCH}" == 'master' || "${GITHUB_BRANCH}" == 'stable' ]]; then - manifests_branch="${GITHUB_BRANCH}" -else - log_message "Ignoring manifest update for branch '${GITHUB_BRANCH}'." - exit 0 -fi - -# decrypt deploy key and use -gpg --quiet --batch --yes --decrypt --passphrase="$MANIFEST_PASSPHRASE" --output .github/workflows/scripts/deploy_manifest .github/workflows/scripts/deploy_manifest.gpg - -chmod 600 .github/workflows/scripts/deploy_manifest -eval `ssh-agent -s` -ssh-add .github/workflows/scripts/deploy_manifest - - -git clone --depth=10 --branch="${manifests_branch}" \ - "${MANIFESTS_GIT_URL}" "${MANIFESTS_DIR}" &>/dev/null - -mkdir -p "$(dirname "${MANIFEST_FILE}")" - -# Generate Docker dependencies -generate_docker_manifest > "${MANIFEST_FILE}" -# Generate python dependencies -generate_python_manifest >> "${MANIFEST_FILE}" - -cd "${MANIFESTS_DIR}" -git config user.name "${MANIFESTS_GIT_USER}" -git config user.email "${MANIFESTS_GIT_EMAIL}" - -git add "${MANIFEST_FILE}" - -if ! git diff-index --quiet HEAD; then - git commit --message "Update manifest for Automation Hub UI" - if ! git push origin "${manifests_branch}" &>/dev/null; then - log_message "Error: git push to branch '${manifests_branch}' failed." - exit 1 - fi -else - log_message "Nothing to commit." -fi diff --git a/template_config.yml b/template_config.yml index 384e8d1058..758a625ee2 100644 --- a/template_config.yml +++ b/template_config.yml @@ -45,9 +45,7 @@ plugin_name: galaxy_ng plugins: - app_label: galaxy name: galaxy_ng -post_job_template: - name: update_manifest - path: galaxy_ng/.github/post-job-template.yml.j2 +post_job_template: {} pre_job_template: name: check_commit path: galaxy_ng/.github/pre-job-template.yml.j2 From 4c3ff26ebae85003c52221e5986173f06c5df9b1 Mon Sep 17 00:00:00 2001 From: Daniel Rodowicz Date: Wed, 15 May 2024 08:26:36 -0400 Subject: [PATCH 2/2] also remove deploy_manifest.gpg --- .github/workflows/scripts/deploy_manifest.gpg | Bin 2066 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .github/workflows/scripts/deploy_manifest.gpg diff --git a/.github/workflows/scripts/deploy_manifest.gpg b/.github/workflows/scripts/deploy_manifest.gpg deleted file mode 100644 index fea7fb7c485800c7a43b22b555c0375ed621f509..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2066 zcmV+t2<`Wb4Fm}T0!g1=mMR2U#Q)Ok0Ti{*0)-oiaj({IA>%8QL6#a5rF#@;+olRV z5SC*798c<$85}|leJ=AK z=ja44RUx%l2#6;AFeNp_IyXrdCNo`n11)4*=K&<58u!7^aA8{>qad%V=9?=H&*I$E zD8I8`Egk&!jQTB9P%P!^8*^PuZx?`p&c+c@+j>*D{wwKVx!(% z{7*uJ{3D08c_88g-|aXtm^i^NE-bM;9JVu7Z4SzSK$K=j`S3!R%l~*ywoCU5!lWTA zG)K%cViDAyZyDlK`UM!H9DmPDv`*VRFM`l{%USQ~(q<%`4UtzL@!kWe-t*Kg^7o{y zZ2vrSSuOIE=p&vHUlVR@d>xzppV@!oH)IzUdZ`tptcDx$pE;n~X9K|2MurcbxUThk zcf5xFj%OGH2&O?*2pYAieyZ`4E$9trJLJvLzEIr-rA97-(GSCBG|nAsU@^Z6FRvz? z_@lpD<(l`p>Ef}2d>+sP+V@P@A5{lC zs4jWeSp^dnn6A_-wZ|Ufmm*}l1|4Cg-#~V#inhS-RRY042o1{cQja-O)i<#NRk@Ov zD3djwn8cuE51ae5ox>#|`)JAs_P)O;GDRdcdIyv&Dq0DpYb-8fA>RqBZcmZqJ&hi* zOd)%Z-qUN@WuIZ=uqvEaq*9iYkq(+#_lL0L2Dv{Ass}UD;*+k!mW=zGansZc2kx$Q7vGu4ueAmeQbT&;pC%qSaU7E3&osG(ourA!7PP+xwQTD{4^s zj$R+X(aoP8DoiDYvWP>;IMU}lYIfr0|JjZr{b$V&;LVbn*ZwsXxw5!v3-WLgsJB2OK0Tac0# zhW61;(ZP62WHuP?Bsfu$lbE0G4uy?wZ752CjvMtY8?3z$27Gb~D~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