Skip to content

Commit

Permalink
improved makefile and added documentation (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalk007 authored Aug 20, 2024
1 parent 3401b8f commit 79f0797
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- [ ] All [tests](https://github.com/jfrog/jfrog-docker-desktop-extension#tests) passed. If this feature is not already covered by the tests, I added new tests.
- [ ] This pull request is on the dev branch.
- [ ] I used "yarn lint" for formatting the code before submitting the pull request.
- [ ] Update [documentation](https://github.com/jfrog/documentation) about new features / new supported technologies
---
56 changes: 56 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Guidelines
## Prerequisites
Make sure you have these tools on your computer:
- yarn 1.x.x
- docker
- docker for windows

#### Make sure to run the all the "make" commands from the root directory of the project repository.

### Adding Tests

If the existing tests do not already cover your changes, please add tests.

## Building and running the project locally
To build and run the plugin, follow these steps:
1. Clone the code from this git repository https://github.com/jfrog/jfrog-docker-desktop-extension
2. Run this command to build the image locally:
```bash
make build-extension
```
3. Run this command to install the extension on your docker desktop:

```bash
make install-extension
```
4. Make sure the checkbox labeled "Allow only extensions distributed through Docker Marketplace" is unchecked:
![Alt text](resources/screenshots/7.png)
5. Go to "My Extensions" tab on docker desktop and press Open":
![Alt text](resources/screenshots/8.png)
You can now use the extension locally on your docker desktop!
## Updating and debugging code
- To update the extension to include new code run:
```bash
make update
```
- To debug the code run:
```bash
make debug
```
- To stop debugging run:
```bash
make stop-debug
```
## Publishing
To publish new code run this command:
- Pushes the image with the latest tag:
```bash
make release
```
24 changes: 19 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,28 @@ IMAGE?=jfrog/jfrog-docker-desktop-extension

BUILDER=buildx-multi-arch

extension: ## Build service image to be deployed as a desktop extension
build-extension: ## Build service image to be deployed as a desktop extension
docker build --tag=$(IMAGE) .

install-extension: ## installs the extension on docker desktop with the local image
yes | docker extension install $(IMAGE)

update: ## update the extension locally to include new changes
docker build --tag=$(IMAGE) . && yes | docker extension update $(IMAGE)

debug: ## opens the devtools tab
docker extension dev debug $(IMAGE)

stop-debug: ## closes devtools tab
docker extension dev reset $(IMAGE)

prepare-buildx: ## Create buildx builder for multi-arch build, if not exists
docker buildx inspect $(BUILDER) || docker buildx create --name=$(BUILDER) --driver=docker-container --driver-opt=network=host

push-extension: prepare-buildx ## Build & Upload extension image to hub. Do not push if tag already exists: make push-extension tag=0.1
docker pull $(IMAGE):$(tag) && echo "Failure: Tag already exists" || docker buildx build --push --builder=$(BUILDER) --platform=linux/amd64,linux/arm64 --build-arg TAG=${tag)} --tag=$(IMAGE):$(tag) .
push-extension: prepare-buildx ## Build & upload extension image to hub. Do not push if tag already exists.
docker pull $(IMAGE):$(tag) && echo "Failure: Tag already exists" || docker buildx build --push --builder=$(BUILDER) --platform=linux/amd64,linux/arm64 --build-arg TAG=$(tag) --tag=$(IMAGE):$(tag) .

release: prepare-buildx ## Build & Upload extension image to hub with the given tag and the 'latest' tag.
docker pull $(IMAGE):$(tag) && echo "Failure: Tag already exists" || docker buildx build --push --builder=$(BUILDER) --platform=linux/amd64,linux/arm64 --tag=$(IMAGE):$(tag) --tag=$(IMAGE):latest .
# Build & upload extension image to hub with the given tag and the 'latest' tag.
# Usage: make release tag=0.1
release: prepare-buildx ## Build & upload extension image to hub with the given tag and the 'latest' tag.
docker pull $(IMAGE):$(tag) && echo "Failure: Tag already exists" || docker buildx build --push --builder=$(BUILDER) --platform=linux/amd64,linux/arm64 --tag=$(IMAGE):$(tag) --tag=$(IMAGE):latest .
Binary file added resources/screenshots/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 79f0797

Please sign in to comment.