From c7c898e7e5a7c06a51d0fc4420b50e4fe5ee5024 Mon Sep 17 00:00:00 2001 From: "Ali R. Vahdati" Date: Mon, 6 May 2024 14:49:29 +0200 Subject: [PATCH 1/2] Remove old info --- README.md | 43 +++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 52f1327..8106e94 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,11 @@ For testing, just build `main.go` for each command: go build -o cmd/datasetIngestor/datasetIngestor cmd/datasetIngestor/main.go ``` -To build all applications and target architectures, use the build script: +All applications are built automatically and can be downloaded from the [Releases](https://github.com/paulscherrerinstitute/scicat-cli/releases) section of this repo. -``` -cmd/build.sh -``` +To build the applications and target architectures locally, use GoReleaser. Check `.goreleaser.yaml` to see the configurations. +To use GoReleaser, you can run the command `goreleaser release --snapshot --clean` in your terminal. This will build the binaries, create the archives and generate the changelog. The `--snapshot flag` ensures that no publishing will happen. +Before running this command, you should ensure that you have [installed GoReleaser](https://goreleaser.com/install/). Tools are compiled for the following architectures: @@ -24,39 +24,30 @@ These can be cross-compiled from any system. ## Deployment -Tools are deployed by committing the binaries to this repository. - -1. Run `deploy.sh`. This script - - 1. Builds executables for all targets - 2. Commits all changes to the git *rollout* repository. - - After this step the version numbers are out of sync until the deploy steps below are performed. +* Deploy linux versions to online beamline consoles (you need to have write access rights): -2. Deploy to the scicat tools repo. This is the public deployment - - Following this step the commands can be fetched via curl from - https://gitlab.psi.ch/scicat/tools/$OS - -3. Deploy linux versions to online beamline consoles (you need to have write access rights): - -``` +```bash cd linux scp datasetArchiver datasetIngestor datasetRetriever datasetGetProposal datasetCleaner SciCat egli@gfa-lc.psi.ch:/work/sls/bin/ ``` -4. Deploy linux versions to the ingest server pbaingest01 +* Deploy linux versions to the ingest server pbaingest01 -``` +```bash ssh egli@pbaingest01.psi.ch cd bin/ -curl -O https://gitlab.psi.ch/scicat/tools/raw/master/linux/datasetIngestor;chmod +x datasetIngestor -curl -O https://gitlab.psi.ch/scicat/tools/raw/master/linux/datasetArchiver;chmod +x datasetArchiver -curl -O https://gitlab.psi.ch/scicat/tools/raw/master/linux/datasetGetProposal;chmod +x datasetGetProposal +curl -s https://api.github.com/repos/paulscherrerinstitute/scicat-cli/releases/latest \ +| grep "browser_download_url.*Linux*tar.gz" \ +| cut -d : -f 2,3 \ +| tr -d \" \ +| wget -qi - +tar -xzf scicat-cli_*_Linux_x86_64.tar.gz +chmod +x datasetIngestor datasetArchiver datasetGetProposal ``` -5. Deploy to Ra cluster as a pmodule +* Deploy to Ra cluster as a pmodule -``` +```bash cd pmodules/buildblocks/Tools/datacatalog kinit aklog From 55ebb52a34f88fc1450a41cbdc6294a05331bd56 Mon Sep 17 00:00:00 2001 From: "Ali R. Vahdati" <3798865+kavir1698@users.noreply.github.com> Date: Thu, 16 May 2024 20:35:17 +0200 Subject: [PATCH 2/2] Remove build.sh --- build.sh | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100755 build.sh diff --git a/build.sh b/build.sh deleted file mode 100755 index 0b2ec6e..0000000 --- a/build.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -# Compiles all tools -# Usage: build.sh [OS list] -# Valid OS: linux, darwin, windows -set -e - -OS="${@:-linux windows}" -APPS="datasetArchiver datasetGetProposal datasetRetriever datasetIngestor datasetCleaner" -PREFIX="build" - -for APP in $APPS; do - for GOOS in $OS; do - echo "Building $APP for $GOOS" - - GO_TOOL=cmd/${APP} - OUT="$PREFIX/$GOOS" - mkdir -p "$OUT" - - case $GOOS in - windows) - GOARCH=amd64 GOOS=$GOOS go build -o $OUT/${APP}.exe $GO_TOOL/main.go - ;; - darwin) - GOARCH=amd64 GOOS=$GOOS go build -o $OUT/${APP}-darwin-amd64 $GO_TOOL/main.go - GOARCH=arm64 GOOS=$GOOS go build -o $OUT/${APP}-darwin-arm64 $GO_TOOL/main.go - # universal binary - lipo -create -output $OUT/${APP} $OUT/${APP}-darwin-amd64 $OUT/${APP}-darwin-arm64 - rm $OUT/${APP}-darwin-amd64 $OUT/${APP}-darwin-arm64 - ;; - linux) - GOARCH=amd64 GOOS=$GOOS go build -o $OUT/${APP} $GO_TOOL/main.go - ;; - *) - # Best effort for other OS versions - echo "Warning: Unsupported OS $OS" - GOARCH="${GOARCH:-amd64}" GOOS=$GOOS go build -o $OUT/${APP} $GO_TOOL/main.go - ;; - esac - - done -done