switch to node version specified in .nvmrc file (#2225)
This commit is contained in:
118
.github/workflows/jobs.yaml
vendored
118
.github/workflows/jobs.yaml
vendored
@@ -289,12 +289,18 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go-version }}
|
go-version: ${{ matrix.go-version }}
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: '17'
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Read .nvmrc
|
||||||
|
id: node_version
|
||||||
|
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.NVMRC }}
|
||||||
|
|
||||||
- name: Get yarn cache directory path
|
- name: Get yarn cache directory path
|
||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
@@ -387,12 +393,18 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go-version }}
|
go-version: ${{ matrix.go-version }}
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: '16'
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Read .nvmrc
|
||||||
|
id: node_version
|
||||||
|
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.NVMRC }}
|
||||||
|
|
||||||
- name: Get yarn cache directory path
|
- name: Get yarn cache directory path
|
||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
@@ -466,12 +478,18 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go-version }}
|
go-version: ${{ matrix.go-version }}
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: '16'
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Read .nvmrc
|
||||||
|
id: node_version
|
||||||
|
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.NVMRC }}
|
||||||
|
|
||||||
- name: Get yarn cache directory path
|
- name: Get yarn cache directory path
|
||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
@@ -545,12 +563,18 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go-version }}
|
go-version: ${{ matrix.go-version }}
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: '16'
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Read .nvmrc
|
||||||
|
id: node_version
|
||||||
|
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.NVMRC }}
|
||||||
|
|
||||||
- name: Get yarn cache directory path
|
- name: Get yarn cache directory path
|
||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
@@ -626,11 +650,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go-version }}
|
go-version: ${{ matrix.go-version }}
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: '16'
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Read .nvmrc
|
||||||
|
id: node_version
|
||||||
|
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.NVMRC }}
|
||||||
- name: Get yarn cache directory path
|
- name: Get yarn cache directory path
|
||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
@@ -695,11 +722,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go-version }}
|
go-version: ${{ matrix.go-version }}
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: '16'
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Read .nvmrc
|
||||||
|
id: node_version
|
||||||
|
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.NVMRC }}
|
||||||
- name: Get yarn cache directory path
|
- name: Get yarn cache directory path
|
||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
@@ -764,11 +794,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go-version }}
|
go-version: ${{ matrix.go-version }}
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: '16'
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Read .nvmrc
|
||||||
|
id: node_version
|
||||||
|
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.NVMRC }}
|
||||||
- name: Get yarn cache directory path
|
- name: Get yarn cache directory path
|
||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
@@ -833,11 +866,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go-version }}
|
go-version: ${{ matrix.go-version }}
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: '16'
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Read .nvmrc
|
||||||
|
id: node_version
|
||||||
|
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.NVMRC }}
|
||||||
- name: Get yarn cache directory path
|
- name: Get yarn cache directory path
|
||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
@@ -902,11 +938,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go-version }}
|
go-version: ${{ matrix.go-version }}
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: '16'
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Read .nvmrc
|
||||||
|
id: node_version
|
||||||
|
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.NVMRC }}
|
||||||
- name: Get yarn cache directory path
|
- name: Get yarn cache directory path
|
||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
@@ -971,12 +1010,18 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go-version }}
|
go-version: ${{ matrix.go-version }}
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: '16'
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Read .nvmrc
|
||||||
|
id: node_version
|
||||||
|
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.NVMRC }}
|
||||||
|
|
||||||
- name: Get yarn cache directory path
|
- name: Get yarn cache directory path
|
||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
@@ -1050,11 +1095,18 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go-version }}
|
go-version: ${{ matrix.go-version }}
|
||||||
id: go
|
id: go
|
||||||
- uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: '16'
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Read .nvmrc
|
||||||
|
id: node_version
|
||||||
|
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.NVMRC }}
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
name: Go Mod Cache
|
name: Go Mod Cache
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
FROM node:17 as uilayer
|
ARG NODE_VERSION
|
||||||
|
FROM node:$NODE_VERSION as uilayer
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
FROM node:17 as uilayer
|
ARG NODE_VERSION
|
||||||
|
FROM node:$NODE_VERSION as uilayer
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
8
Makefile
8
Makefile
@@ -6,6 +6,7 @@ BUILD_TIME:=$(shell date 2>/dev/null)
|
|||||||
TAG ?= "minio/console:$(BUILD_VERSION)-dev"
|
TAG ?= "minio/console:$(BUILD_VERSION)-dev"
|
||||||
MINIO_VERSION ?= "quay.io/minio/minio:latest"
|
MINIO_VERSION ?= "quay.io/minio/minio:latest"
|
||||||
TARGET_BUCKET ?= "target"
|
TARGET_BUCKET ?= "target"
|
||||||
|
NODE_VERSION := $(shell cat .nvmrc)
|
||||||
|
|
||||||
default: console
|
default: console
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@ console:
|
|||||||
@(GO111MODULE=on CGO_ENABLED=0 go build -trimpath --tags=kqueue,operator --ldflags "-s -w" -o console ./cmd/console)
|
@(GO111MODULE=on CGO_ENABLED=0 go build -trimpath --tags=kqueue,operator --ldflags "-s -w" -o console ./cmd/console)
|
||||||
|
|
||||||
k8sdev:
|
k8sdev:
|
||||||
@docker build -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' .
|
@docker build -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' --build-arg NODE_VERSION='$(NODE_VERSION)' .
|
||||||
@kind load docker-image $(TAG)
|
@kind load docker-image $(TAG)
|
||||||
@echo "Done, now restart your console deployment"
|
@echo "Done, now restart your console deployment"
|
||||||
|
|
||||||
@@ -63,7 +64,8 @@ swagger-operator:
|
|||||||
@swagger generate server -A operator --main-package=operator --server-package=operatorapi --exclude-main -P models.Principal -f ./swagger-operator.yml -r NOTICE
|
@swagger generate server -A operator --main-package=operator --server-package=operatorapi --exclude-main -P models.Principal -f ./swagger-operator.yml -r NOTICE
|
||||||
|
|
||||||
assets:
|
assets:
|
||||||
@(cd portal-ui; yarn install --prefer-offline; make build-static; yarn prettier --write . --loglevel warn; cd ..)
|
@(if [ -f "${NVM_DIR}/nvm.sh" ]; then \. "${NVM_DIR}/nvm.sh" && nvm install && nvm use && npm install -g yarn ; fi &&\
|
||||||
|
cd portal-ui; yarn install --prefer-offline; make build-static; yarn prettier --write . --loglevel warn; cd ..)
|
||||||
|
|
||||||
test-integration:
|
test-integration:
|
||||||
@(docker stop pgsqlcontainer || true)
|
@(docker stop pgsqlcontainer || true)
|
||||||
@@ -261,7 +263,7 @@ clean:
|
|||||||
@rm -vf console
|
@rm -vf console
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
@docker buildx build --output=type=docker --platform linux/amd64 -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' .
|
@docker buildx build --output=type=docker --platform linux/amd64 -t $(TAG) --build-arg build_version=$(BUILD_VERSION) --build-arg build_time='$(BUILD_TIME)' --build-arg NODE_VERSION='$(NODE_VERSION)' .
|
||||||
|
|
||||||
release: swagger-gen
|
release: swagger-gen
|
||||||
@echo "Generating Release: $(RELEASE)"
|
@echo "Generating Release: $(RELEASE)"
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ default: build-static
|
|||||||
|
|
||||||
build-static:
|
build-static:
|
||||||
@echo "Building frontend static assets to 'build'"
|
@echo "Building frontend static assets to 'build'"
|
||||||
NODE_OPTIONS=--openssl-legacy-provider yarn build
|
@if [ -f "${NVM_DIR}/nvm.sh" ]; then \. "${NVM_DIR}/nvm.sh" && nvm install && nvm use; fi && \
|
||||||
|
NODE_OPTIONS=--openssl-legacy-provider yarn build
|
||||||
|
|
||||||
test-warnings:
|
test-warnings:
|
||||||
./check-warnings.sh
|
./check-warnings.sh
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ -f "$NVM_DIR/nvm.sh" ]
|
||||||
|
then
|
||||||
|
\. "$NVM_DIR/nvm.sh";
|
||||||
|
nvm use;
|
||||||
|
fi
|
||||||
yarn install
|
yarn install
|
||||||
yarn prettier --check .
|
yarn prettier --check .
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ die() {
|
|||||||
|
|
||||||
try() { "$@" &> yarn.log || die "cannot $*"; }
|
try() { "$@" &> yarn.log || die "cannot $*"; }
|
||||||
|
|
||||||
rm yarn.log
|
rm -f yarn.log
|
||||||
try make build-static
|
try make build-static
|
||||||
|
|
||||||
if cat yarn.log | grep "Compiled with warnings"; then
|
if cat yarn.log | grep "Compiled with warnings"; then
|
||||||
|
|||||||
Reference in New Issue
Block a user