Skip to content

Commit

Permalink
chore: reuse component builds for aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobmoellerdev committed Nov 4, 2024
1 parent b620c9c commit 7131f04
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
name: "Build"
strategy:
matrix:
component: [ocmcli]
# component: [ocmcli, helminstaller, helmdemo, subchartsdemo, ecrplugin]
component: [ocmcli, helminstaller, helmdemo, subchartsdemo, ecrplugin]
runs-on: large_runner
steps:
- name: Self Hosted Runner Post Job Cleanup Action
Expand Down Expand Up @@ -70,8 +69,7 @@ jobs:
runs-on: large_runner
needs: build
env:
components: ocmcli
# components: ocmcli helminstaller helmdemo subchartsdemo ecrplugin
components: ocmcli helminstaller helmdemo subchartsdemo ecrplugin
steps:
- name: Self Hosted Runner Post Job Cleanup Action
uses: TooMuch4U/[email protected]
Expand Down Expand Up @@ -109,23 +107,23 @@ jobs:
path: gen/downloaded-ctfs
- name: Move CTFs into correct directory for aggregation
run: |
IFS=" " read -a COMPONENTS <<< ${{ env.components }}
IFS=" " read -a COMPONENTS <<< "${{ env.components }}"
for i in "${COMPONENTS[@]}"; do
mkdir -p ${{ github.workspace }}/gen/${i}
mv ${{ github.workspace }}/gen/downloaded-ctfs/ctf-component-${i} ${{ github.workspace }}/gen/${i}/ctf
ls -R ${{ github.workspace }}/gen/${i}
done
- name: Create aggregated CTF
run: |
PATH=$PATH:$(go env GOPATH)/bin CTF_TYPE=${{ env.CTF_TYPE }} COMPONENTS=${{ env.components }} make plain-ctf
PATH=$PATH:$(go env GOPATH)/bin CTF_TYPE=${{ env.CTF_TYPE }} COMPONENTS="${{ env.components }}" make plain-ctf
- name: Upload aggregated CTF
# only update on main
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
overwrite: true
retention-days: 1
retention-days: 90
name: ctf-aggregated
path: gen/ctf
- name: Delete old CTFs that lead up to aggregation
Expand Down
2 changes: 1 addition & 1 deletion components/demoplugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ info:

.PHONY: describe
describe: $(GEN)/ctf $(OCM_BIN)
$(OCM) get resources --lookup $(OCMREPO) -c -o treewide $(GEN)/ctf
$(OCM) get resources --lookup $(OCMREPO) -r -o treewide $(GEN)/ctf

.PHONY: descriptor
descriptor: $(GEN)/ctf $(OCM_BIN)
Expand Down
2 changes: 1 addition & 1 deletion components/ecrplugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ info:

.PHONY: describe
describe: $(GEN)/ctf $(OCM_BIN)
$(OCM) get resources --lookup $(OCMREPO) -c -o treewide $(GEN)/ctf
$(OCM) get resources --lookup $(OCMREPO) -r -o treewide $(GEN)/ctf

.PHONY: descriptor
descriptor: $(GEN)/ctf $(OCM_BIN)
Expand Down
8 changes: 4 additions & 4 deletions components/subchartsdemo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ info:
@echo "CREDS: $(CREDS)"

.PHONY: describe
describe: $(GEN)/ctf
ocm get resources --lookup $(OCMREPO) -o treewide $(GEN)/ctf
describe: $(GEN)/ctf $(OCM_BIN)
$(OCM) get resources --lookup $(OCMREPO) -r -o treewide $(GEN)/ctf

.PHONY: descriptor
descriptor: $(GEN)/ctf
ocm get component -S v3alpha1 -o yaml $(GEN)/ctf
descriptor: $(GEN)/ctf $(OCM_BIN)
$(OCM) get component -S v3alpha1 -o yaml $(GEN)/ctf

.PHONY: clean
clean:
Expand Down

0 comments on commit 7131f04

Please sign in to comment.