Makefile: Add "dev" target to install latest Go / NPM in dev environment

This commit is contained in:
Michael Mayer 2021-08-05 11:09:26 +02:00
parent dd958bfda8
commit f2685698b8
3 changed files with 14 additions and 4 deletions

View file

@ -1,4 +1,4 @@
.PHONY: build dep dep-go dep-js dep-list dep-tensorflow dep-upgrade dep-upgrade-js test install fmt upgrade start stop;
.PHONY: build dev npm dep dep-go dep-js dep-list dep-tensorflow dep-upgrade dep-upgrade-js test install fmt upgrade start stop;
.SILENT: ; # no need for @
.ONESHELL: ; # recipes execute in same shell
.NOTPARALLEL: ; # wait for target to finish
@ -34,6 +34,14 @@ fmt: fmt-js fmt-go fmt-imports
upgrade: dep-upgrade-js dep-upgrade
clean-local: clean-local-config clean-local-cache
clean-install: clean-local dep build-js install-bin install-assets
dev: dev-npm dev-go-amd64
dev-npm:
$(info Upgrading NPM in local dev environment...)
sudo npm update -g npm
dev-go-amd64:
$(info Installing Go in local AMD64 dev environment...)
sudo docker/scripts/install-go.sh amd64
go build -v ./...
acceptance-restart:
cp -f storage/acceptance/backup.db storage/acceptance/index.db
cp -f storage/acceptance/config/settingsBackup.yml storage/acceptance/config/settings.yml

View file

@ -107,7 +107,9 @@ RUN umask 0000 && npm install --unsafe-perm=true --allow-root -g npm && npm conf
# Install Go
RUN /root/.local/bin/install-go.sh ${TARGETARCH}
RUN /root/.local/bin/install-go.sh ${TARGETARCH} && \
mkdir -p "/go/src" "/go/bin" && \
chmod -R 777 "/go"
# Download TensorFlow model and test files
RUN rm -rf /tmp/* && mkdir -p /tmp/photoprism && \

View file

@ -22,8 +22,8 @@ else
fi
wget -O go.tgz $URL
echo $CHECKSUM | sha256sum -c -
rm -rf /usr/local/go
tar -C /usr/local -xzf go.tgz
rm go.tgz
go version
mkdir -p "/go/src" "/go/bin" && chmod -R 777 "/go"
/usr/local/go/bin/go version
fi