From cbeb4237233fd3c188b807fe5e20845de88aa71d Mon Sep 17 00:00:00 2001 From: Karl Cardenas Date: Mon, 25 Sep 2023 15:08:07 -0700 Subject: [PATCH] ci: updated README and backport CI (#1606) (cherry picked from commit de7356b59b592045629d5e72c00351a3a3b1fbcf) --- .dockerignore | 3 ++- .github/workflows/version-branch-update.yaml | 5 ----- Dockerfile | 3 ++- Makefile | 1 + README.md | 23 ++++++++++++-------- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.dockerignore b/.dockerignore index 8f62ede6eb..c75f282c3f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,4 +3,5 @@ README.md CHANGES .gitignore .cache -prow/ \ No newline at end of file +prow/ +.env \ No newline at end of file diff --git a/.github/workflows/version-branch-update.yaml b/.github/workflows/version-branch-update.yaml index 456e85151e..d01f38b3e7 100644 --- a/.github/workflows/version-branch-update.yaml +++ b/.github/workflows/version-branch-update.yaml @@ -62,11 +62,6 @@ jobs: run: | netlify build --context deploy-preview - - name: compile - run: | - make build - - - name: Deploy to Netlify id: netlify uses: nwtgck/actions-netlify@v2.1.0 diff --git a/Dockerfile b/Dockerfile index 58fb2d4814..943538d053 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,8 @@ RUN apk add util-linux && \ chmod +x /entry.sh && \ mkdir .cache && \ npm ci && \ -chown -R node:node /librarium +chown -R node:node /librarium && \ +echo -e "ALGOLIA_APP_ID=1234567890\nALGOLIA_SEARCH_KEY=1234567890" > .env EXPOSE 9000 USER node diff --git a/Makefile b/Makefile index 1fd168fc4a..db552749e2 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ help: ## Display this help initialize: ## Initialize the repository dependencies @echo "initializing npm dependencies" npm ci + touch .env npx husky-init clean: ## Clean build artifacts diff --git a/README.md b/README.md index fc2a92cc04..13bcd0e020 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,12 @@ To contribute, we recommend having the following software installed locally on y To get started with the Docker based local development approach ensure you are in the root context of this repository. +Initailize the repository by issuing the following command: + +```shell +make init +``` + Next, issue the following command to build the Docker image. **Note**: The first time issuing the command may take several minutes. @@ -35,15 +41,13 @@ make docker-image To start the Dockererized local development server, issue the command: -``` +```shell make docker-start ``` The local development server is ready when the following output is displayed in your terminal. ```shell -npm run start - > spectro-cloud-docs@4.0.0 start > docusaurus start --host 0.0.0.0 --port 9000 @@ -62,12 +66,6 @@ To exit from the local development Docker container. Press `Ctrl + Z`. ## Local Development Setup (Non-Docker) -Make a folder somewhere you can easily find - -```sh -mkdir ~/Work -``` - Clone the repository and run the initialization script ```sh @@ -77,6 +75,13 @@ cd librarium make init ``` +Next, populate the `.env` file with the following content. The local development server will not start without the required environment variables. The values are not important for local development. + +```shell +ALGOLIA_APP_ID=1234567890 +ALGOLIA_SEARCH_KEY=1234567890 +``` + ## Documentation Content Create a branch to keep track of all your changes.