Skip to content

Commit

Permalink
Merge pull request #1873 from EnterpriseDB/release/2021-09-22
Browse files Browse the repository at this point in the history
Release: 2021-09-22
  • Loading branch information
josh-heyer authored Sep 23, 2021
2 parents ea73e64 + 5c163d6 commit c3537b0
Show file tree
Hide file tree
Showing 259 changed files with 54,479 additions and 16,902 deletions.
8 changes: 3 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/shar
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# latest gatsby, yarn
# latest gatsby
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh \
&& npm install -g gatsby-cli \
&& npm install -g yarn" 2>&1
&& npm install -g gatsby-cli" 2>&1

# Enable docker-in-docker (see: https://github.com/microsoft/vscode-dev-containers/blob/master/script-library/docs/docker-in-docker.md)
COPY library-scripts/*.sh /tmp/library-scripts/
RUN wget -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& apt-get update \
RUN apt-get update \
&& /bin/bash /tmp/library-scripts/docker-in-docker-debian.sh
ENTRYPOINT ["/usr/local/share/docker-init.sh"]
VOLUME [ "/var/lib/docker" ]
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"appPort": [8000],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "yarn install",
"postCreateCommand": "npm install",

// docker in docker (https://github.com/microsoft/vscode-dev-containers/blob/master/script-library/docs/docker-in-docker.md)
"runArgs": ["--init", "--privileged"],
Expand Down
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
*
!icons-pkg/
!scripts/
!gatsby*.js
!package*.json
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
layout node
dotenv_if_exists .env.development
22 changes: 14 additions & 8 deletions .github/workflows/deploy-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- develop
workflow_dispatch:

jobs:
build-deploy:
runs-on: ubuntu-latest
Expand All @@ -12,7 +14,6 @@ jobs:

- uses: actions/checkout@v2
with:
ref: develop
fetch-depth: 0 # fetch whole repo so git-restore-mtime can work
lfs: true
- name: Adjust file watchers limit
Expand All @@ -21,12 +22,17 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: "14.x"
- name: Install yarn
run: sudo npm -g install yarn
- name: Yarn install
run: yarn install --immutable
- name: update npm
run: npm install -g npm@7
env:
NODE_ENV: ${{ secrets.NODE_ENV }}
- name: npm install
run: |
npm run presetup
npm ci
env:
NODE_ENV: ${{ secrets.NODE_ENV }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- uses: actions/setup-python@v2
with:
Expand Down Expand Up @@ -54,9 +60,9 @@ jobs:
${{ runner.os }}-gatsby-build-develop-
- name: Fix mtimes
run: yarn fix-mtimes --force
run: npm run fix-mtimes --force
- name: Gatsby build
run: yarn build
run: npm run build
env:
APP_ENV: staging
NODE_ENV: ${{ secrets.NODE_ENV }}
Expand All @@ -68,7 +74,7 @@ jobs:

- name: Netlify deploy
run: |
sudo yarn global add netlify-cli
sudo npm install -g netlify-cli
netlify deploy --dir=public --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
Expand Down
136 changes: 71 additions & 65 deletions .github/workflows/deploy-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: Deploy branch draft on Netlify
on:
pull_request:
types: [labeled, opened, synchronize]
workflow_dispatch:

concurrency:
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

Expand All @@ -14,76 +15,81 @@ jobs:
(github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'deploy'))
runs-on: ubuntu-latest
steps:
- name: inject slug/short variables
uses: rlespinasse/[email protected]
- name: inject slug/short variables
uses: rlespinasse/[email protected]

- name: compose a name for the build environment
run: echo "BUILD_ENV_NAME=pr-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}" >> $GITHUB_ENV

- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0 # fetch whole repo so git-restore-mtime can work
lfs: true
- name: compose a name for the build environment
run: echo "BUILD_ENV_NAME=pr-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}" >> $GITHUB_ENV

- name: Adjust file watchers limit
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0 # fetch whole repo so git-restore-mtime can work
lfs: true

- uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Adjust file watchers limit
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

# ref: https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Get yarn cache directory
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/setup-node@v1
with:
node-version: "14.x"

- name: Checking Yarn cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn install
run: npx yarn install --immutable
env:
NODE_ENV: ${{ secrets.NODE_ENV }}
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Checking Gatsby cache
id: gatsby-cache-build
uses: actions/cache@v2
with:
path: |
public
.cache
key: ${{ runner.os }}-gatsby-build-draft-${{ github.head_ref }}
- name: update npm
run: npm install -g npm@7
env:
NODE_ENV: ${{ secrets.NODE_ENV }}
- name: Install dependencies
run: |
npm run presetup
npm ci
env:
NODE_ENV: ${{ secrets.NODE_ENV }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Fix mtimes
run: yarn fix-mtimes --force

- name: Gatsby build
run: yarn build
env:
APP_ENV: staging
NODE_ENV: ${{ secrets.NODE_ENV }}
NODE_OPTIONS: --max-old-space-size=4096
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_INDEX_NAME: edb-docs-staging
INDEX_ON_BUILD: false
- name: Checking Gatsby cache
id: gatsby-cache-build
uses: actions/cache@v2
with:
path: |
public
.cache
key: ${{ runner.os }}-gatsby-build-draft-${{ github.head_ref }}

- name: Deploy to Netlify
id: netlify-deploy
uses: nwtgck/[email protected]
with:
publish-dir: './public'
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: ${{ github.event.pull_request.title }}
enable-commit-comment: false
github-deployment-environment: ${{ env.BUILD_ENV_NAME }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }}
- name: Fix mtimes
run: npm run fix-mtimes --force

- name: Gatsby build
run: npm run build
env:
APP_ENV: staging
NODE_ENV: ${{ secrets.NODE_ENV }}
NODE_OPTIONS: --max-old-space-size=4096
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_INDEX_NAME: edb-docs-staging
INDEX_ON_BUILD: false

- name: Deploy to Netlify
id: netlify-deploy
uses: nwtgck/[email protected]
with:
publish-dir: "./public"
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: ${{ github.event.pull_request.title }}
enable-commit-comment: false
github-deployment-environment: ${{ env.BUILD_ENV_NAME }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }}
24 changes: 15 additions & 9 deletions .github/workflows/deploy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- main
workflow_dispatch:

jobs:
build-deploy:
runs-on: ubuntu-latest
Expand All @@ -15,19 +17,24 @@ jobs:
ref: main
fetch-depth: 0 # fetch whole repo so git-restore-mtime can work
lfs: true

- name: Adjust file watchers limit
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- uses: actions/setup-node@v2
with:
node-version: "14.x"
- name: Install yarn
run: sudo npm -g install yarn
- name: Yarn install
run: yarn install --immutable
- name: update npm
run: npm install -g npm@7
env:
NODE_ENV: ${{ secrets.NODE_ENV }}
- name: npm install
run: |
npm run presetup
npm ci
env:
NODE_ENV: ${{ secrets.NODE_ENV }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- uses: actions/setup-python@v2
with:
Expand All @@ -43,7 +50,6 @@ jobs:
- name: Build all pdfs
run: npm run build-all-pdfs-ci


- name: Checking Gatsby cache
id: gatsby-cache-build
uses: actions/cache@v2
Expand All @@ -56,9 +62,9 @@ jobs:
${{ runner.os }}-gatsby-build-main-
- name: Fix mtimes
run: yarn fix-mtimes --force
run: npm run fix-mtimes --force
- name: Gatsby build
run: yarn build
run: npm run build
env:
APP_ENV: production
NODE_ENV: ${{ secrets.NODE_ENV }}
Expand All @@ -71,7 +77,7 @@ jobs:

- name: Netlify deploy
run: |
sudo yarn global add netlify-cli
sudo npm install -g netlify-cli
netlify deploy --dir=public --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
Expand Down
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# yarn is preferred for us (and heroku)
package-lock.json

# Logs
logs
*.log
Expand Down Expand Up @@ -45,6 +42,9 @@ typings/
# Optional npm cache directory
.npm

# npm config file
.npmrc

# Optional eslint cache
.eslintcache

Expand Down Expand Up @@ -81,4 +81,7 @@ product_docs/content/
product_docs/content_build/
static/nginx_redirects.generated
temp_kubernetes/
temp_bdr/
temp_bdr/

# Track base direnv file
!.envrc
4 changes: 3 additions & 1 deletion .husky/_/husky.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/sh
if [ -z "$husky_skip_init" ]; then
debug () {
[ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1"
if [ "$HUSKY_DEBUG" = "1" ]; then
echo "husky (debug) - $1"
fi
}

readonly hook_name="$(basename "$0")"
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn pretty-quick --staged --pattern 'src/**/*.js' --pattern 'gatsby-*.js'
npx pretty-quick --staged --pattern 'src/**/*.js' --pattern 'gatsby-*.js'
Loading

0 comments on commit c3537b0

Please sign in to comment.