From 0ccfdd30af03c1d056248b0f69a39ac080ef22d2 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 27 Jun 2022 21:49:30 +0200 Subject: [PATCH] Build javascript directly in container Signed-off-by: Knut Ahlers --- .repo-runner.yaml | 16 +++++++++++++--- Makefile | 15 ++++++--------- cmd/password/go.mod | 4 ++-- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.repo-runner.yaml b/.repo-runner.yaml index f3fdc18..dcfe73f 100644 --- a/.repo-runner.yaml +++ b/.repo-runner.yaml @@ -1,14 +1,24 @@ --- -image: "reporunner/golang-alpine" +image: "reporunner/archlinux" checkout_dir: /go/src/github.com/Luzifer/password commands: - - make publish + - pacman -Sy --noconfirm + go + nodejs-lts-gallium + npm + zip + - make compile_js + - make + -C cmd/password + -f ../../Makefile + publish environment: CGO_ENABLED: 0 DRAFT: 'false' GHUSER: Luzifer - PACKAGES: github.com/Luzifer/password/cmd/password + GOPATH: /go + PACKAGES: . REPO: password diff --git a/Makefile b/Makefile index 59a4fe7..1b3f1ff 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,11 @@ default: -compile_js: - rm -f ./frontend/assets/* - docker run --rm -i \ - -v "$(CURDIR):$(CURDIR)" \ - -w "$(CURDIR)/js" \ - -u $(shell id -u) \ - node:18-alpine \ - sh -c "node build.mjs" +compile_js: js/node_modules + cd js && node build.mjs -publish: compile_js +js/node_modules: + cd js && npm ci + +publish: curl -sSLo golang.sh https://raw.githubusercontent.com/Luzifer/github-publish/master/golang.sh bash golang.sh diff --git a/cmd/password/go.mod b/cmd/password/go.mod index ae9c4f8..7be9e51 100644 --- a/cmd/password/go.mod +++ b/cmd/password/go.mod @@ -1,4 +1,4 @@ -module github.com/Luzifer/password/cmd/password +module github.com/Luzifer/password/v2/cmd/password go 1.18 @@ -8,12 +8,12 @@ require ( github.com/Luzifer/go_helpers/v2 v2.13.0 github.com/Luzifer/password/v2 v2.2.0 github.com/gorilla/mux v1.8.0 + github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.5.0 ) require ( github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/pkg/errors v0.9.1 // indirect github.com/sirupsen/logrus v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tredoe/osutil v1.0.6 // indirect