-
Notifications
You must be signed in to change notification settings - Fork 28
New registry viewer build process #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
aff449d
registry viewer shell build scripts added.
michael-valdron e5b1c30
registry viewer build and push image workflow added.
michael-valdron 1059e9e
NEXT_PUBLIC_DEVFILE_REGISTRIES env variable added to build scripts an…
michael-valdron 4e7696c
license fixups.
michael-valdron 01da7e5
Push image workflow can be trigged by external dispatch.
michael-valdron 06c5fe6
license header added to Dockerfile.
michael-valdron 014e536
quay.io/devfile/registry-viewer:next is built from staging.
michael-valdron 070b25b
build args for registry viewer changed to match recent changes to Doc…
michael-valdron 2d44deb
registryViewerBuild job renamed to registry-viewer-build, label named…
michael-valdron c628a63
concurrency options added to pushimage-next
michael-valdron c8fcb60
NEXT_PUBLIC_ANALYTICS_WRITE_KEY removed as a secret.
michael-valdron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,80 @@ | ||
| # Copyright 2022 Red Hat, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: Next Dockerimage | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| repository_dispatch: | ||
| types: [build] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| registry-viewer-build: | ||
| name: Registry Viewer Build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out devfile web source code | ||
| uses: actions/checkout@v3 | ||
| - name: Login to Quay | ||
| uses: docker/login-action@v1 | ||
| with: | ||
| registry: quay.io | ||
| username: ${{ secrets.QUAY_USERNAME }} | ||
| password: ${{ secrets.QUAY_PASSWORD }} | ||
| - name: Build the registry viewer image | ||
| run: bash ./scripts/build_viewer.sh | ||
| - name: Push the registry viewer image | ||
| run: bash ./scripts/push.sh registry-viewer:latest quay.io/devfile/registry-viewer:next | ||
| dispatch: | ||
| needs: registry-viewer-build | ||
| strategy: | ||
| matrix: | ||
| repo: ['devfile/registry'] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Get the repository name and commit sha | ||
| id: get_commit_info | ||
| run: | | ||
| # Check if repository name is not set in the client payload | ||
| # If it's not set, the triggered commit came from this repo (devfile-web) | ||
| # If it is set, the triggered commit came from another source | ||
| if [ -z ${{ github.event.client_payload.repo }} ]; | ||
| then | ||
| echo ::set-output name=repo::$(echo ${{ github.event.repository.name }}) | ||
| else | ||
| echo ::set-output name=repo::$(echo ${{ github.event.client_payload.repo }}) | ||
| fi | ||
|
|
||
| # Check if commit sha is not set in the client payload | ||
| # If it's not set, the triggered commit came from this repo (devfile-web) | ||
| # If it is set, the triggered commit came from another source | ||
|
|
||
| if [ -z ${{ github.event.client_payload.sha }} ]; | ||
| then | ||
| echo ::set-output name=sha::$(echo ${{ github.sha }}) | ||
| else | ||
| echo ::set-output name=sha::$(echo ${{ github.event.client_payload.sha }}) | ||
| fi | ||
| - name: Repository dispatch | ||
| uses: peter-evans/repository-dispatch@v1 | ||
| with: | ||
| token: ${{ secrets.REPO_ACCESS_TOKEN }} | ||
| repository: ${{ matrix.repo }} | ||
| event-type: build | ||
| client-payload: '{"repo": "${{ steps.get_commit_info.outputs.REPO }}", "sha": "${{ steps.get_commit_info.outputs.SHA }}"}' | ||
This file contains hidden or 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 hidden or 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,21 @@ | ||
| # Copyright 2022 Red Hat, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| #!/usr/bin/env bash | ||
|
|
||
| docker build -t registry-viewer . \ | ||
| --build-arg PROJECT_NAME=registry-viewer \ | ||
| --build-arg SITE_URL=${SITE_URL:-"https://registry.stage.devfile.io/viewer"} \ | ||
| --build-arg NEXT_PUBLIC_BASE_PATH=${NEXT_PUBLIC_BASE_PATH:-"/viewer"} \ | ||
| --build-arg NEXT_PUBLIC_ANALYTICS_WRITE_KEY=${NEXT_PUBLIC_ANALYTICS_WRITE_KEY:-""} |
This file contains hidden or 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 hidden or 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,20 @@ | ||
| # Copyright 2022 Red Hat, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| #!/usr/bin/env bash | ||
|
|
||
| BASE_TAG=$1 | ||
| IMAGE_TAG=$2 | ||
| docker tag $BASE_TAG $IMAGE_TAG | ||
| docker push $IMAGE_TAG |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.