Skip to content

Commit

Permalink
feat: Allow to use OpenVsx in plug-in registry
Browse files Browse the repository at this point in the history
Change-Id: I6b42aa61a6d6b8077441fab270d6950954e29698
Signed-off-by: Florent Benoit <fbenoit@redhat.com>
  • Loading branch information
benoitf committed Aug 16, 2022
1 parent 8d02ea7 commit c7aca23
Show file tree
Hide file tree
Showing 18 changed files with 280 additions and 359 deletions.
5 changes: 2 additions & 3 deletions .ci/openshift-ci/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,15 @@ RUN mkdir -m 777 /var/www/html/v3 && \
mkdir -m 777 /var/www/html/v3/plugins && \
mkdir -m 777 /var/www/html/v3/images

COPY --from=builder /che-plugin-registry/build/dockerfiles/rhel.entrypoint.sh /che-plugin-registry/build/dockerfiles/entrypoint.sh /usr/local/bin/
COPY --from=builder /che-plugin-registry/build/dockerfiles/entrypoint.sh /usr/local/bin/

RUN chmod g+rwX /usr/local/bin/entrypoint.sh /usr/local/bin/rhel.entrypoint.sh
RUN chmod g+rwX /usr/local/bin/entrypoint.sh

COPY --from=builder /che-plugin-registry/README.md /che-plugin-registry/.htaccess /var/www/html/
COPY --from=builder /che-plugin-registry/output/v3 /var/www/html/v3
COPY --from=builder /che-plugin-registry/v3/plugins/.htaccess /var/www/html/v3/plugins/
COPY --from=builder /che-plugin-registry/v3/images/default.png /var/www/html/v3/images/

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["/usr/local/bin/rhel.entrypoint.sh"]

# append Brew metadata here
56 changes: 0 additions & 56 deletions .ci/openshift-ci/build/alpine.Dockerfile

This file was deleted.

128 changes: 0 additions & 128 deletions .ci/openshift-ci/build/alpine.entrypoint.sh

This file was deleted.

15 changes: 2 additions & 13 deletions .github/workflows/happy-path.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#

# che-plugin-registry Happy Path workflow
# matrix jobs with alpine and ubi8
name: Happy Path

on:
Expand All @@ -23,10 +22,6 @@ on:

jobs:
happy-path:
strategy:
fail-fast: false
matrix:
dist: ['alpine', 'rhel']
runs-on: ubuntu-20.04
steps:
- name: Clone source code
Expand Down Expand Up @@ -69,14 +64,8 @@ jobs:
export SKIP_FORMAT=true
export SKIP_LINT=true
export SKIP_TEST=true
if [[ "${{matrix.dist}}" == "alpine" ]]; then
docker pull quay.io/eclipse/che-plugin-registry:next
BUILDER=docker ./build.sh --tag happy-path
elif [[ "${{matrix.dist}}" == "rhel" ]]; then
BUILDER=docker ./build.sh --rhel --tag happy-path
fi
# save locally built image
docker pull quay.io/eclipse/che-plugin-registry:next
# save locally built image
docker save -o docker-image.tar quay.io/eclipse/che-plugin-registry:happy-path
- name: Start minikube
id: run-minikube
Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/image-build-pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ on: [push, pull_request]

jobs:
image-build:
strategy:
matrix:
dist: [ 'alpine', 'rhel' ]
runs-on: ubuntu-20.04
steps:
- name: Clone source code
Expand Down Expand Up @@ -54,14 +51,9 @@ jobs:
export SKIP_FORMAT=true
export SKIP_LINT=true
export SKIP_TEST=true
if [[ "${{matrix.dist}}" == "alpine" ]]; then
docker pull quay.io/eclipse/che-plugin-registry:next
BUILDER=docker ./build.sh --tag pr-check
EXPORTED_FOLDER=/usr/local/apache2/htdocs/v3
elif [[ "${{matrix.dist}}" == "rhel" ]]; then
BUILDER=docker ./build.sh --rhel --tag pr-check
EXPORTED_FOLDER=/var/www/html/v3
fi
docker pull quay.io/eclipse/che-plugin-registry:next
BUILDER=docker ./build.sh --tag pr-check
EXPORTED_FOLDER=/var/www/html/v3
ls -la output/
docker run --rm --entrypoint=sh quay.io/eclipse/che-plugin-registry:pr-check -c "ls -la ${EXPORTED_FOLDER}"
docker create --name pluginRegistry quay.io/eclipse/che-plugin-registry:pr-check sh
Expand All @@ -72,8 +64,8 @@ jobs:
tar zcvf content-${{matrix.dist}}.tgz -C root-dir .
- uses: actions/upload-artifact@v3
with:
name: plugin-registry-content-${{matrix.dist}}
path: content-${{matrix.dist}}.tgz
name: plugin-registry-content
path: content.tgz
pull-request-info:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-20.04
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/publish-pr-check-content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@ jobs:
publish:
# only if it's a pull request
if: github.event.workflow_run.event == 'pull_request'
strategy:
matrix:
dist: [ 'alpine', 'rhel' ]
name: publish
runs-on: ubuntu-20.04
steps:
- name: download dist artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: plugin-registry-content-${{matrix.dist}}
name: plugin-registry-content
path: content
- name: PR number
uses: dawidd6/action-download-artifact@v2
Expand Down Expand Up @@ -75,12 +72,12 @@ jobs:
PARENT_DIR=$(dirname $file);
cp ${PARENT_DIR}/meta.yaml ${PARENT_DIR}/index.html
done
export DEPLOY_DOMAIN=https://pr-check-${PR_NUMBER}-${{matrix.dist}}-che-plugin-registry.surge.sh
export DEPLOY_DOMAIN=https://pr-check-${PR_NUMBER}-che-plugin-registry.surge.sh
echo "DEPLOY_DOMAIN=$DEPLOY_DOMAIN" >> $GITHUB_ENV
surge ./unpacked --domain $DEPLOY_DOMAIN
- name: 'Comment PR'
uses: actions/github-script@v6
with:
script: |
const { repo: { owner, repo } } = context;
await github.rest.repos.createCommitStatus({ owner, repo, sha: process.env.PR_SHA, state: "success", target_url: process.env.DEPLOY_DOMAIN, description: "Browse registry content (${{matrix.dist}}) live", context: "surge(${{matrix.dist}})"})
await github.rest.repos.createCommitStatus({ owner, repo, sha: process.env.PR_SHA, state: "success", target_url: process.env.DEPLOY_DOMAIN, description: "Browse registry content live", context: "surge"})
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ Options:
--offline
Build offline version of registry, with all artifacts included
cached in the registry; disabled by default.
--rhel
Build using the rhel.Dockerfile (UBI images) instead of Alpine
--skip-oci-image
Build artifacts but do not create the image
```
Expand Down
6 changes: 0 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ Options:
--offline
Build offline version of registry, with all artifacts included
cached in the registry; disabled by default.
--rhel
Build using the rhel.Dockerfile (UBI images) instead of default
--skip-oci-image
Build artifacts but do not create the image
--skip-digest-generation
Expand Down Expand Up @@ -74,10 +72,6 @@ function parse_arguments() {
BUILD_FLAGS_ARRAY+=("--skip-digest-generation:true")
shift;
;;
--rhel)
DOCKERFILE="./build/dockerfiles/rhel.Dockerfile"
shift
;;
*)
print_usage
exit 0
Expand Down
Loading

0 comments on commit c7aca23

Please sign in to comment.