You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2022/04/19 15:51:40 UTC

[solr-docker] branch main updated: SOLR-15321: Auto-update official images via PR when repo is updated (#2)

This is an automated email from the ASF dual-hosted git repository.

houston pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-docker.git


The following commit(s) were added to refs/heads/main by this push:
     new c6f5da7  SOLR-15321: Auto-update official images via PR when repo is updated (#2)
c6f5da7 is described below

commit c6f5da773a4cb6ad88fecf778b0824c9c4e46fa0
Author: Houston Putman <ho...@apache.org>
AuthorDate: Tue Apr 19 11:51:37 2022 -0400

    SOLR-15321: Auto-update official images via PR when repo is updated (#2)
    
    This does not yet create PRs in the docker-library/official-images repo. For now it creates PRs in the docker-solr/official-images fork, until we have finished our testing of this feature.
---
 .github/workflows/pr-for-official-repo.yml | 53 ++++++++++++++++++++++++++++++
 generate-stackbrew-library.sh              |  2 +-
 2 files changed, 54 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/pr-for-official-repo.yml b/.github/workflows/pr-for-official-repo.yml
new file mode 100644
index 0000000..a17d085
--- /dev/null
+++ b/.github/workflows/pr-for-official-repo.yml
@@ -0,0 +1,53 @@
+name: Create PR for Official Images Repo
+
+on:
+  push:
+    branches:
+      - 'main'
+    paths:
+      - '.github/workflows/pr-for-official-repo.yml'
+      - 'old-solr-versions'
+      - 'generate-stackbrew-library.sh'
+      - '[0-9]+.[0-9]+/**'
+
+jobs:
+  test:
+    name: Create PR
+
+    runs-on: ubuntu-latest
+
+    steps:
+      # Setup
+      - uses: actions/checkout@v3
+      - name: Checkout official-images fork
+        uses: actions/checkout@v3
+        with:
+          repository: docker-solr/official-images
+          path: official-images
+      - name: Install BashBrew
+        run: |
+          mkdir -p "${HOME}/.local/bin"
+          wget -nv --output-document="${HOME}/.local/bin/bashbrew" https://github.com/docker-library/bashbrew/releases/download/v0.1.3/bashbrew-amd64
+          chmod a+x "${HOME}/.local/bin/bashbrew"
+          echo "${HOME}/.local/bin" >> $GITHUB_PATH
+      - name: Generate new Solr manifest
+        run: ./generate-stackbrew-library.sh > official-images/library/solr
+      - name: Create Pull Request
+        uses: peter-evans/create-pull-request@v4
+        with:
+          path: official-images
+          #push-to-fork: docker-solr/official-images
+          add-paths: library/solr
+          branch-suffix: short-commit-hash
+          commit-message: "Apache Solr - ${{ github.event.commits[0].message }}"
+          title: "Apache Solr - ${{ github.event.commits[0].message }}"
+          body: |
+            Apache Solr:
+            
+            ${{ github.event.commits[0].message }}
+            
+            Relevant Maintainers: @HoustonPutman @janhoy @dsmiley @janhoy
+            
+            This is an automated PR based on a change made in the https://github.com/apache/solr-docker repository's `main` branch.
+          delete-branch: true
+          token: ${{ secrets.DOCKER_SOLR_BUILD_PAT }}
diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh
index 03d3fa5..6195694 100755
--- a/generate-stackbrew-library.sh
+++ b/generate-stackbrew-library.sh
@@ -50,7 +50,7 @@ getArches() {
 	local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/'
 
 		eval "declare -g -A parentRepoToArches=( $(
-		find . -path ./builder -prune -o -name 'Dockerfile' -exec awk '
+		find . -name 'Dockerfile' -not -path "./official-images/*" -exec awk '
 				toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|microsoft\/[^:]+)(:|$)/ {
 					print "'"$officialImagesUrl"'" $2
 				}