diff --git a/.circleci/config.yml b/.circleci/config.yml index 101533d..3e42c3c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,43 +38,19 @@ jobs: - run: | node -v - - run: - name: Install GuPM - command: curl -fsSL https://azukaar.github.io/GuPM/install.sh | bash - - run: docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD - - run: - name: Install Go provider - command: ~/.gupm/gupm/g plugin install https://azukaar.github.io/GuPM-official/repo:provider-go - - - run: - name: Install NPM provider - command: ~/.gupm/gupm/g plugin install https://azukaar.github.io/GuPM-official/repo:provider-npm - - run: name: Install dependencies - command: ~/.gupm/gupm/g make + command: npm install - run: name: Build UI - command: node .bin/vite build --base=/ui/ + command: npm run client-build - run: - name: Build Linux (ARM) - command: ~/.gupm/gupm/g ci/build linux arm64 - - - run: - name: Build docker (ARM) - command: ~/.gupm/gupm/g docker arm64 - - - run: - name: Build Linux - command: ~/.gupm/gupm/g ci/build linux amd64 - - - run: - name: Build docker - command: ~/.gupm/gupm/g docker + name: Build and publish dockerfiles + command: sh docker.sh workflows: version: 2 diff --git a/.gitignore b/.gitignore index 0c7870e..c99293d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,10 @@ -go_modules -gupm_modules node_modules build -dev.gs -localcert.csr -localcert.crt -localcert.key .vite -dev.json static .bin client/dist client/.vite config_dev.json tests -todo.txt -config_dev.backup.json \ No newline at end of file +todo.txt \ No newline at end of file diff --git a/.gupm_rc.gs b/.gupm_rc.gs deleted file mode 100644 index 23edf84..0000000 --- a/.gupm_rc.gs +++ /dev/null @@ -1,12 +0,0 @@ -// look up dependencies in local go_modules and gupm_modules directories -env("GOPATH", run("go", ["env", "GOROOT"]) + ":" + pwd() + "/go_modules" + ":" + pwd() + "/gupm_modules") -env("GO111MODULE", "off") -env("LOG_LEVEL", "DEBUG") -env("HTTP_PORT", 8080) -env("HTTPS_PORT", 8443) -env("EZ", "UTC") - -// dev mode -if(fileExists("./config_dev.json")) { - env("CONFIG_FILE", "./config_dev.json") -} \ No newline at end of file diff --git a/build arm64.sh b/build arm64.sh new file mode 100644 index 0000000..79cd79c --- /dev/null +++ b/build arm64.sh @@ -0,0 +1,6 @@ +rm -rf build +env GOARCH=arm64 go build -o build/cosmos src/*.go +if [ $? -ne 0 ]; then + exit 1 +fi +cp -r static build/ \ No newline at end of file diff --git a/build.gs b/build.gs deleted file mode 100644 index bec40ba..0000000 --- a/build.gs +++ /dev/null @@ -1,5 +0,0 @@ -removeFiles(["build"]); -var goArgs = ["build", "-o", "build/bin"] -goArgs = goArgs.concat(dir("src/*.go")) -exec("go", goArgs); -copyFiles("client/dist/", "build/static/") \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..f26b560 --- /dev/null +++ b/build.sh @@ -0,0 +1,6 @@ +rm -rf build +go build -o build/cosmos src/*.go +if [ $? -ne 0 ]; then + exit 1 +fi +cp -r static build/ \ No newline at end of file diff --git a/ci/build.gs b/ci/build.gs deleted file mode 100644 index e37d9b6..0000000 --- a/ci/build.gs +++ /dev/null @@ -1,31 +0,0 @@ -removeFiles("build") - -var goArgs = ["build", "-o"] - -if(typeof $1 != "undefined" && $1 == "windows") { - goArgs.push("build/cosmos.exe") -} else { - goArgs.push("build/cosmos") -} - -goArgs = goArgs.concat(dir("src/*.go")) - -var archi = "amd64" -if(typeof $2 != "undefined") { - archi = $2 -} - -if(typeof $1 != "undefined" && $1 == "mac") { - env("GOOS", "darwin") - env("GOARCH", archi) - exec("go", goArgs) -} -if(typeof $1 != "undefined" && $1 == "windows") { - env("GOOS", "windows") - env("GOARCH", archi) - exec("go", goArgs) -} else { - env("GOOS", "linux") - env("GOARCH", archi) - exec("go", goArgs) -} diff --git a/client/index.html b/client/index.html index 1ee4a67..354bddf 100644 --- a/client/index.html +++ b/client/index.html @@ -4,7 +4,7 @@ Cosmos - +