Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
ci: minor edits to scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpitz committed Oct 20, 2021
1 parent 16245a2 commit 9cca884
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 2 deletions.
Empty file added cr.yaml
Empty file.
Empty file added ct.yaml
Empty file.
3 changes: 2 additions & 1 deletion docker/devtools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ RUN GOBIN=/usr/local/bin go get \
google.golang.org/protobuf/cmd/protoc-gen-go@v1.27.1 \
google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1.0 \
github.com/envoyproxy/protoc-gen-validate@v0.6.1 \
github.com/goreleaser/goreleaser@v0.177.0 \
moul.io/protoc-gen-gotemplate@v1.11.2 \
github.com/google/addlicense@v1.0.0 \
github.com/goreleaser/goreleaser@v0.177.0 \
github.com/golangci/golangci-lint@v1.42.1 \
7 changes: 6 additions & 1 deletion scripts/dist-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ set -e -o pipefail
go mod download
go mod verify

goreleaser --snapshot --skip-publish --rm-dist
if [[ -z "${VERSION}" ]]; then
goreleaser --snapshot --skip-publish --rm-dist
else
goreleaser
fi

1 change: 1 addition & 0 deletions scripts/dist-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Copyright (C) The AetherFS Authors - All Rights Reserved
# See LICENSE for more information.

set -e -o pipefail

readonly lock_file="dist/aetherfs_proto.lock"

Expand Down
26 changes: 26 additions & 0 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Copyright (C) The AetherFS Authors - All Rights Reserved
# See LICENSE for more information.

set -e -o pipefail

golangci-lint run --fix

cd web

if [[ -e node_modules/.cache/platform.txt ]]; then
last_platform="$(cat node_modules/.cache/platform.txt)"
fi

package_json_last_modified=$(date +%s -r package.json)
node_modules_last_modified=$(date +%s -r node_modules || echo -n "")

# reinstall dependencies if there are new dependencies or if we switch platforms
if [[ $(( package_json_last_modified )) -gt $(( node_modules_last_modified )) ]] || [[ "${last_platform}" != "${current_platform}" ]]; then
npm install
mkdir -p node_modules/.cache
echo -n "${current_platform}" > node_modules/.cache/platform.txt
npm audit fix
fi

npm run lint

0 comments on commit 9cca884

Please sign in to comment.