diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..8742036 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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 +--- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6494b1e --- /dev/null +++ b/CONTRIBUTING.md @@ -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 +``` \ No newline at end of file diff --git a/Makefile b/Makefile index 865f6cd..734b317 100644 --- a/Makefile +++ b/Makefile @@ -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 . \ No newline at end of file diff --git a/resources/screenshots/7.png b/resources/screenshots/7.png new file mode 100644 index 0000000..fd5504c Binary files /dev/null and b/resources/screenshots/7.png differ diff --git a/resources/screenshots/8.png b/resources/screenshots/8.png new file mode 100644 index 0000000..db4a663 Binary files /dev/null and b/resources/screenshots/8.png differ