-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added crc-support component. Fix #40.
Signed-off-by: Adrian Riobo <[email protected]>
- Loading branch information
1 parent
7cb9077
commit 8b9d808
Showing
13 changed files
with
691 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: crc-support-builder | ||
|
||
on: | ||
push: | ||
tags: [ 'crc-support-v*' ] | ||
pull_request: | ||
branches: [ main ] | ||
paths: ['Makefile', 'crc-support/**', '.github\/workflows\/crc-support*' ] | ||
|
||
jobs: | ||
build: | ||
name: build | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build image for PR | ||
if: ${{ github.event_name == 'pull_request' }} | ||
env: | ||
CRC_SUPPORT: ghcr.io/crc-org/ci-crc-support | ||
CRC_SUPPORT_V: pr-${{ github.event.number }} | ||
run: | | ||
make crc-support-oci-build | ||
make crc-support-oci-save | ||
echo "image=${CRC_SUPPORT}:${CRC_SUPPORT_V}" >> "$GITHUB_ENV" | ||
- name: Build image for Release | ||
if: ${{ github.event_name == 'push' }} | ||
run: | | ||
make crc-support-oci-build | ||
make crc-support-oci-save | ||
echo "image=$(sed -n 1p crc-support/release-info):v$(sed -n 2p crc-support/release-info)" >> "$GITHUB_ENV" | ||
- name: Create image metadata | ||
run: | | ||
echo ${{ env.image }} > crc-support-image | ||
echo ${{ github.event_name }} > crc-support-build-event | ||
- name: Upload crc-support | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: crc-support | ||
path: crc-support* | ||
|
||
tkn-check: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Template tkn for PR | ||
if: ${{ github.event_name == 'pull_request' }} | ||
env: | ||
CRC_SUPPORT: ghcr.io/crc-org/ci-crc-support | ||
CRC_SUPPORT_V: pr-${{ github.event.number }} | ||
run: | | ||
make crc-support-tkn-create | ||
- name: Check tkn specs | ||
run: | | ||
if [[ ! -f crc-support/tkn/task.yaml ]]; then | ||
exit 1 | ||
fi | ||
# Check if version is in sync | ||
- name: Create k8s Kind Cluster | ||
uses: helm/kind-action@v1 | ||
|
||
# https://docs.openshift.com/pipelines/1.15/about/op-release-notes.html | ||
- name: Deploy min supported tekton version | ||
run: kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.44.5/release.yaml | ||
|
||
- name: Deploy tasks | ||
run: | | ||
kubectl apply -f crc-support/tkn/task.yaml | ||
- name: Upload crc-support-tkn | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: crc-support-tkn | ||
path: crc-support/tkn/crc-support* | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: crc-support-pusher | ||
|
||
on: | ||
workflow_run: | ||
workflows: [ 'crc-support-builder' ] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
push: | ||
name: push | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-24.04 | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Download crc-support assets | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: crc-support | ||
run-id: ${{ github.event.workflow_run.id }} | ||
github-token: ${{ github.token }} | ||
|
||
- name: Get crc-support build informaiton | ||
run: | | ||
echo "source_event=$(cat crc-support-build-event)" >> "$GITHUB_ENV" | ||
echo "image=$(cat crc-support-image)" >> "$GITHUB_ENV" | ||
- name: Log in to ghcr.io | ||
if: ${{ env.source_event == 'pull_request' }} | ||
uses: redhat-actions/podman-login@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Log in quay.io | ||
if: ${{ env.source_event == 'push' }} | ||
uses: redhat-actions/podman-login@v1 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_IO_USERNAME }} | ||
password: ${{ secrets.QUAY_IO_PASSWORD }} | ||
|
||
- name: Push crc-support | ||
run: | | ||
# Load | ||
podman load -i crc-support-linux.tar | ||
podman load -i crc-support-windows.tar | ||
podman load -i crc-support-darwin.tar | ||
# Push | ||
podman push ${{ env.image }}-linux | ||
podman push ${{ env.image }}-windows | ||
podman push ${{ env.image }}-darwin | ||
- name: Download crc-support-tkn assets | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: crc-support-tkn | ||
run-id: ${{ github.event.workflow_run.id }} | ||
github-token: ${{ github.token }} | ||
|
||
- name: Push crc-support-tkn | ||
env: | ||
TKN_VERSION: '0.37.0' | ||
run: | | ||
curl -LO "https://github.com/tektoncd/cli/releases/download/v${TKN_VERSION}/tkn_${TKN_VERSION}_Linux_x86_64.tar.gz" | ||
tar xvzf "tkn_${TKN_VERSION}_Linux_x86_64.tar.gz" tkn | ||
./tkn bundle push ${{ env.image }}-tkn \ | ||
-f crc-support-installer.yaml \ | ||
-f crc-support.yaml | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Overview | ||
|
||
crc-support component allows to manage remote operations to setup a environment for testing Openshift Local, it contains the scripts based on each target platform, and it basically manages: | ||
|
||
* Cleanup environments to ensure fresh installations | ||
* Download bundles | ||
* Download and install Openshift Local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# v0.0.7 | ||
FROM quay.io/rhqp/deliverest@sha256:67ed1a47f1580141854c5baa742a50fc21920cf77d9d07eb798d7743508e52eb | ||
|
||
LABEL org.opencontainers.image.authors="CRCQE <[email protected]>" | ||
|
||
ARG OS | ||
|
||
ENV ASSETS_FOLDER=/opt/crc-support \ | ||
OS=${OS} | ||
|
||
COPY /lib/${OS}/* ${ASSETS_FOLDER}/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
|
||
# Remove any content from any previous crc installation | ||
force_fresh_environment () { | ||
crc cleanup 2>/dev/null | ||
sudo kill -9 $(pgrep crc-tray | head -1) 2>/dev/null | ||
sudo rm -rf /Applications/Red\ Hat\ OpenShift\ Local.app/ | ||
sudo rm /usr/local/bin/crc | ||
rm -rf ~/.crc/ | ||
} | ||
|
||
# Return 1 if true 0 false | ||
required_download () { | ||
if [[ ! -f $aName ]]; then | ||
return 1 | ||
fi | ||
cat $aSHAName | grep $aName | shasum -a 256 -c - | ||
return ${?} | ||
} | ||
|
||
# $1 downloadle url | ||
# Return 1 if not valid, 0 if valid | ||
check_download() { | ||
cat $aSHAName | grep $aName | shasum -a 256 -c - | ||
return ${?} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./../unix/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
# Remove any content from any previous crc installation | ||
force_fresh_environment () { | ||
crc cleanup | ||
sudo rm -rf /usr/local/bin/crc | ||
rm -rf ~/.crc/ | ||
} | ||
|
||
# Return 1 if true 0 false | ||
required_download () { | ||
if [[ ! -f ${DOWNLOADED_ITEM_NAME} ]]; then | ||
return 1 | ||
fi | ||
cat ${SHASUM_FILE} | grep ${DOWNLOADED_ITEM_NAME} | sha256sum -c - | ||
return ${?} | ||
} | ||
|
||
# $1 downloadle url | ||
# Return 1 if not valid, 0 if valid | ||
check_download() { | ||
cat ${SHASUM_FILE} | grep ${DOWNLOADED_ITEM_NAME} | sha256sum -c - | ||
return ${?} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./../unix/run.sh |
Oops, something went wrong.