add readme

This commit is contained in:
Hao Liu
2023-02-28 09:51:30 -05:00
parent c0927e1c29
commit 0cd7a00339
2 changed files with 41 additions and 20 deletions

View File

@@ -3,32 +3,32 @@ UI_NEXT_DIR := $(shell realpath --relative-to $(CURDIR) $(dir $(UI_NEXT_MKFILE_P
UI_NEXT_SRC_DIR := $(UI_NEXT_DIR)/src UI_NEXT_SRC_DIR := $(UI_NEXT_DIR)/src
UI_NEXT_SRC_GIT_REPO_HTTPS ?= UI_NEXT_GIT_REPO_HTTPS ?=
UI_NEXT_SRC_GIT_REPO_SSH ?= UI_NEXT_GIT_REPO_SSH ?=
UI_NEXT_SRC_GIT_BRANCH ?= main UI_NEXT_GIT_BRANCH ?= main
UI_NEXT_LOCAL ?= UI_NEXT_LOCAL ?=
.PHONY: ui_next/clone-https .PHONY: ui_next/clone-https
## Shallow clone the ui_next repo via https skip if UI_NEXT_SRC_GIT_REPO_HTTPS is undefined ## Shallow clone the ui_next repo via https skip if UI_NEXT_GIT_REPO_HTTPS is undefined
ui_next/clone-https: ui_next/clone-https:
@if [ -z "$(UI_NEXT_SRC_GIT_REPO_HTTPS)" ]; then \ @if [ -z "$(UI_NEXT_GIT_REPO_HTTPS)" ]; then \
echo "SKIP: ui_next/clone-https. UI_NEXT_SRC_GIT_REPO_HTTPS is not set."; \ echo "SKIP: ui_next/clone-https. UI_NEXT_GIT_REPO_HTTPS is not set."; \
elif [ -d "$(UI_NEXT_SRC_DIR)" ]; then \ elif [ -d "$(UI_NEXT_SRC_DIR)" ]; then \
echo "SKIP: ui_next/clone-https. $(UI_NEXT_SRC_DIR) already exists."; \ echo "SKIP: ui_next/clone-https. $(UI_NEXT_SRC_DIR) already exists."; \
else \ else \
git clone --depth 1 --branch $(UI_NEXT_SRC_GIT_BRANCH) $(UI_NEXT_SRC_GIT_REPO_HTTPS) $(UI_NEXT_SRC_DIR) || true; \ git clone --depth 1 --branch $(UI_NEXT_GIT_BRANCH) $(UI_NEXT_GIT_REPO_HTTPS) $(UI_NEXT_SRC_DIR) || true; \
fi fi
.PHONY: ui_next/clone-ssh .PHONY: ui_next/clone-ssh
## Shallow clone the ui_next repo via ssh. ## Shallow clone the ui_next repo via ssh.
ui_next/clone-ssh: ui_next/clone-ssh:
@if [ -z "$(UI_NEXT_SRC_GIT_REPO_SSH)" ]; then \ @if [ -z "$(UI_NEXT_GIT_REPO_SSH)" ]; then \
echo "SKIP: ui_next/clone-ssh. UI_NEXT_SRC_GIT_REPO_SSH is not set."; \ echo "SKIP: ui_next/clone-ssh. UI_NEXT_GIT_REPO_SSH is not set."; \
elif [ -d "$(UI_NEXT_SRC_DIR)" ]; then \ elif [ -d "$(UI_NEXT_SRC_DIR)" ]; then \
echo "SKIP: ui_next/clone-ssh. $(UI_NEXT_SRC_DIR) already exists."; \ echo "SKIP: ui_next/clone-ssh. $(UI_NEXT_SRC_DIR) already exists."; \
else \ else \
git clone --depth 1 --branch $(UI_NEXT_SRC_GIT_BRANCH) $(UI_NEXT_SRC_GIT_REPO_SSH) $(UI_NEXT_SRC_DIR) || true; \ git clone --depth 1 --branch $(UI_NEXT_GIT_BRANCH) $(UI_NEXT_GIT_REPO_SSH) $(UI_NEXT_SRC_DIR) || true; \
fi fi
.PHONY: ui_next/link-local .PHONY: ui_next/link-local
@@ -42,9 +42,9 @@ ui_next/link-local:
ln -s $(UI_NEXT_LOCAL) $(UI_NEXT_SRC_DIR); \ ln -s $(UI_NEXT_LOCAL) $(UI_NEXT_SRC_DIR); \
fi fi
.PHONY: ui_next .PHONY: ui_next/src
## Try to link to a local clone of ui_next repo if it exist otherwise clone via ssh than https. ## Try to link to a local clone of ui_next repo if it exist otherwise clone via ssh than https.
ui_next: ui_next/src:
@if [ -d "$(UI_NEXT_SRC_DIR)" ]; then \ @if [ -d "$(UI_NEXT_SRC_DIR)" ]; then \
echo "SKIP: ui_next. $(UI_NEXT_SRC_DIR) already exists."; \ echo "SKIP: ui_next. $(UI_NEXT_SRC_DIR) already exists."; \
else \ else \
@@ -53,11 +53,11 @@ ui_next:
## Alias for ui_next, will not run if ui_next already exist ## Alias for ui_next, will not run if ui_next already exist
$(UI_NEXT_SRC_DIR): $(UI_NEXT_SRC_DIR):
$(MAKE) ui_next $(MAKE) ui_next/src
.PHONY: ui_next/build .PHONY: ui_next/build
## Build ui_next from source ## Build ui_next from source
ui_next/src/build: ui_next ui_next/src/build: ui_next/src
cd $(UI_NEXT_SRC_DIR) && \ cd $(UI_NEXT_SRC_DIR) && \
npm install webpack && \ npm install webpack && \
npm run build:awx npm run build:awx

View File

@@ -1,12 +1,33 @@
# Instruction to build ui_next directly from this directory
## Set src of the ui_next repo
``` ### via GIT
git clone git@github.com:ansible/ansible-ui.git
```bash
export UI_NEXT_GIT_BRANCH_REPO_HTTPS=https://<git repo>
``` ```
``` or
pushd ansible-ui
npm run build:controller ```bash
popd export UI_NEXT_GIT_BRANCH_REPO_SSH=git@<git repo>
``` ```
optionally set branch (default is main)
```bash
export UI_NEXT_GIT_BRANCH_BRANCH=main
```
### via symlink to existing clone
```bash
export UI_NEXT_LOCAL = /path/to/your/ui_next
```
## Build
```bash
make ui_next/build
```