Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix release/1.9.x deploy previews #15157

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1,909 changes: 931 additions & 978 deletions .circleci/config.yml

Large diffs are not rendered by default.

14 changes: 0 additions & 14 deletions .circleci/config/jobs/algolia-index.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .circleci/config/jobs/website-docker-image.yml

This file was deleted.

15 changes: 3 additions & 12 deletions .circleci/config/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ jobs:
- test-go-race-remote-docker:
requires:
- pre-flight-checks
- website-docker-image:
context: vault-docs
filters:
branches:
only:
- main
- algolia-index:
context: vault-docs
filters:
branches:
only:
- stable-website
- semgrep:
requires:
- pre-flight-checks
2 changes: 2 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ out
# As per Next.js conventions (https://nextjs.org/docs/basic-features/environment-variables#default-environment-variables)
.env*.local
!.env*

website-preview
80 changes: 31 additions & 49 deletions website/Makefile
Original file line number Diff line number Diff line change
@@ -1,56 +1,38 @@
# Default: run this if working on the website locally to run in watch mode.
website:
@echo "==> Downloading latest Docker image..."
@docker pull hashicorp/vault-website
@echo "==> Starting website in Docker..."
@docker run \
--interactive \
.DEFAULT_GOAL := website

PWD=$$(pwd)
DOCKER_IMAGE="hashicorp/dev-portal"
DOCKER_IMAGE_LOCAL="dev-portal-local"
DOCKER_RUN_FLAGS=-it \
--publish "3000:3000" \
--rm \
--tty \
--workdir "/website" \
--volume "$(shell pwd):/website" \
--volume "/website/node_modules" \
--publish "3000:3000" \
hashicorp/vault-website \
npm start
--volume "$(PWD)/content:/app/content" \
--volume "$(PWD)/public:/app/public" \
--volume "$(PWD)/data:/app/data" \
--volume "$(PWD)/redirects.js:/app/redirects.js" \
--volume "next-dir:/app/website-preview/.next" \
--volume "$(PWD)/.env:/app/.env" \
-e "REPO=vault"

# This command will generate a static version of the website to the "out" folder.
build:
# Default: run this if working on the website locally to run in watch mode.
.PHONY: website
website:
@echo "==> Downloading latest Docker image..."
@docker pull hashicorp/vault-website
@echo "==> Starting build in Docker..."
@docker run \
--interactive \
--rm \
--tty \
--workdir "/website" \
--volume "$(shell pwd):/website" \
--volume "/website/node_modules" \
hashicorp/vault-website \
npm run static
@docker pull $(DOCKER_IMAGE)
@echo "==> Starting website..."
@docker run $(DOCKER_RUN_FLAGS) $(DOCKER_IMAGE)

# If you are changing node dependencies locally, run this to generate a new
# local Docker image with the dependency changes included.
build-image:
@echo "==> Building Docker image..."
@docker build -t hashicorp-vault-website-local .
# Use this if you have run `website/build-local` to use the locally built image.
.PHONY: website/local
website/local:
@echo "==> Starting website from local image..."
@docker run $(DOCKER_RUN_FLAGS) $(DOCKER_IMAGE_LOCAL)

# Use this if you have run `build-image` to use the locally built image
# rather than our CI-generated image to test dependency changes.
website-local:
@echo "==> Downloading latest Docker image..."
@docker pull hashicorp/vault-website
@echo "==> Starting website in Docker..."
@docker run \
--interactive \
--rm \
--tty \
--workdir "/website" \
--volume "$(shell pwd):/website" \
--volume "/website/node_modules" \
--publish "3000:3000" \
hashicorp-vault-website-local \
npm start
# Run this to generate a new local Docker image.
.PHONY: website/build-local
website/build-local:
@echo "==> Building local Docker image"
@docker build https://github.com/hashicorp/dev-portal.git\#main \
-t $(DOCKER_IMAGE_LOCAL)

.DEFAULT_GOAL := website
.PHONY: build build-image website website-local
8 changes: 3 additions & 5 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vault Website

This subdirectory contains the entire source for the [Vault Website](https://vaultproject.io/). This is a [NextJS](https://nextjs.org/) project, which builds a static site from these source files.
This subdirectory contains the content for the [Vault Website](https://vaultproject.io/).

<!--
This readme file contains several blocks of generated text, to make it easier to share common information
Expand Down Expand Up @@ -40,11 +40,10 @@ The website can be run locally through node.js or [Docker](https://www.docker.co

> **Note:** If you are using a text editor that uses a "safe write" save style such as **vim** or **goland**, this can cause issues with the live reload in development. If you turn off safe write, this should solve the problem. In vim, this can be done by running `:set backupcopy=yes`. In goland, search the settings for "safe write" and turn that setting off.

| :warning: WARNING :warning: |
|:----------------------------|
| :warning: WARNING :warning: |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| If you've previously run the website successfully using either the Docker or Node.js approach but are now facing some issue then try `docker rmi $(docker images -aq hashicorp-vault-website-local) && make build-image && make website-local` or `rm -rf node_modules`; failing that consider cloning this repository again and re-attempting the steps anew in a clean clone. |


### With Docker

Running the site locally is simple. Provided you have Docker installed, clone this repo, run `make`, and then visit `http://localhost:3000`.
Expand Down Expand Up @@ -82,7 +81,6 @@ This file can be standard Markdown and also supports [YAML frontmatter](https://
title: 'My Title'
description: "A thorough, yet succinct description of the page's contents"
---

```

The significant keys in the YAML frontmatter are:
Expand Down
13 changes: 0 additions & 13 deletions website/components/before-after-diagram/fragment.graphql

This file was deleted.

87 changes: 0 additions & 87 deletions website/components/before-after-diagram/index.jsx

This file was deleted.

31 changes: 0 additions & 31 deletions website/components/before-after-diagram/server.js

This file was deleted.