Skip to content

Commit

Permalink
Merge pull request #227 from eitsupi/update-bakefiles
Browse files Browse the repository at this point in the history
Merge and change the structure of stack files and update build strategy, and some improvements
  • Loading branch information
cboettig authored Sep 1, 2021
2 parents 30fca60 + 3f8af8d commit daf1b2f
Show file tree
Hide file tree
Showing 224 changed files with 3,309 additions and 2,589 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ jobs:
uses: docker/setup-buildx-action@v1
- name: Build and push Docker images
run: |
BAKE_JSON=bakefiles/${{ matrix.r_version }}.docker-bake.json BAKE_OPTION=--push make bake-json-all
BAKE_JSON=bakefiles/${{ matrix.r_version }}.docker-bake.json BAKE_GROUP=${{ matrix.group }} BAKE_OPTION=--push make bake-json-group
1 change: 0 additions & 1 deletion .github/workflows/dockerfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
install2.r --error --skipinstalled -r https://r-lib.github.io/p/pak/dev/ -n -1 pak
- name: Make changes to pull request
run: |
./build/sync-template-vars.R
./build/make-stacks.R
make clean
make setup
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/extra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build & Push extra images

on:
schedule:
- cron: "0 0 1 * *"
workflow_dispatch:

jobs:
generate_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
- id: set-matrix
run: |
CONTENT=$(jq '{ group: [.group[] | keys[]] }' -r bakefiles/extra.docker-bake.json)
echo ::set-output name=matrix::${CONTENT}
echo ${CONTENT}
build:
needs: generate_matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate_matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v2
- uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and push Docker images
run: |
BAKE_JSON=bakefiles/extra.docker-bake.json BAKE_GROUP=${{ matrix.group }} BAKE_OPTION=--push make bake-json-group
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- id: set-version
run: |
VERSION=$(jq '.include[-1].r_version' -r build/matrix/latest.json)
VERSION=$(jq '.r_version[-1]' -r build/matrix/latest.json)
echo ::set-output name=version::${VERSION}
echo ${VERSION}
- name: Bump version and push tag
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
echo ${JSON}
- id: set-matrix
run: |
CONTENT=$(jq -r 'tostring' ${{ steps.set-json.outputs.json }})
CONTENT=$(jq -r 'with_entries(select(.key == "r_version")) | tostring' ${{ steps.set-json.outputs.json }})
echo ::set-output name=matrix::${CONTENT}
echo ${CONTENT}
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ setup:
./build/make-dockerfiles.R
./build/write-compose.R
./build/make-bakejson.R
./build/make-matrix.R

IMAGE_SOURCE ?= https://github.com/rocker-org/rocker-versioned2
COMMIT_HASH := $(shell git rev-parse HEAD)
Expand Down Expand Up @@ -38,6 +39,8 @@ bake-json/%:
docker buildx bake -f $(BAKE_JSON) --set=*.labels.org.opencontainers.image.revision=$(IMAGE_REVISION) $(BAKE_OPTION) $(@F)
bake-json-all: $(foreach I, $(shell jq '.target | keys_unsorted | .[]' -r $(BAKE_JSON)), bake-json/$(I))

BAKE_GROUP ?= default
bake-json-group: $(foreach I, $(shell jq '.group[].$(BAKE_GROUP)[].targets[]' -r $(BAKE_JSON)), bake-json/$(I))

IMAGE_FILTER ?= label=org.opencontainers.image.source=$(IMAGE_SOURCE)
inspect-image/%:
Expand Down
Loading

0 comments on commit daf1b2f

Please sign in to comment.