diff --git a/go.mod b/go.mod index 899f83c..49b300a 100644 --- a/go.mod +++ b/go.mod @@ -6,13 +6,13 @@ require ( github.com/containerd/containerd v1.5.7 // indirect github.com/docker/docker v20.10.9+incompatible github.com/docker/go-connections v0.4.0 - github.com/go-chi/chi/v5 v5.0.7 // indirect + github.com/go-chi/chi/v5 v5.0.7 github.com/golang-jwt/jwt v3.2.1+incompatible github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/websocket v1.4.2 github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect github.com/morikuni/aec v1.0.0 // indirect - github.com/pkg/errors v0.9.1 // indirect + github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 github.com/robfig/cron/v3 v3.0.1 github.com/rs/cors v1.8.0 diff --git a/scripts/install-spinup-dev.sh b/scripts/install-spinup-dev.sh index 6929457..138f4f4 100755 --- a/scripts/install-spinup-dev.sh +++ b/scripts/install-spinup-dev.sh @@ -22,22 +22,13 @@ if [ -z "$SPINUP_API_KEY" ]; then fi SPINUP_DIR=${SPINUP_DIR:-"${HOME}/.local/spinup"} - -if [ -z "$API_VERSION" ]; then +if [ -z "$VERSION" ]; then echo "Fetching latest Spinup version..." SPINUP_VERSION=$(curl --silent "https://api.github.com/repos/spinup-host/spinup/releases" | jq -r 'first | .tag_name') else - SPINUP_VERSION=$API_VERSION -fi - -if [ -z "$UI_VERSION" ]; then - echo "Fetching latest Spinup version..." - SPINUP_UI_VERSION=main -else - SPINUP_UI_VERSION=$UI_VERSION + SPINUP_VERSION=$VERSION fi - OS=$(go env GOOS) ARCH=$(go env GOARCH) PLATFORM="${OS}-${ARCH}" @@ -55,7 +46,7 @@ go build -o spinup-backend ./main.go ./spinup-backend version cp ${SPINUP_TMP_DIR}/spinup-api/spinup-backend ${SPINUP_DIR}/spinup -git clone --depth=1 --branch=${UI_VERSION} https://github.com/spinup-host/spinup-dash.git ${SPINUP_TMP_DIR}/spinup-dash +git clone --depth=1 https://github.com/spinup-host/spinup-dash.git ${SPINUP_TMP_DIR}/spinup-dash cd ${SPINUP_TMP_DIR}/spinup-dash # setup env variables for dashboard's npm build cat >.env <<-EOF diff --git a/scripts/install-spinup.sh b/scripts/install-spinup.sh index aab2286..138f4f4 100755 --- a/scripts/install-spinup.sh +++ b/scripts/install-spinup.sh @@ -22,13 +22,16 @@ if [ -z "$SPINUP_API_KEY" ]; then fi SPINUP_DIR=${SPINUP_DIR:-"${HOME}/.local/spinup"} -echo "Fetching latest Spinup version..." -SPINUP_VERSION=$(curl --silent "https://api.github.com/repos/spinup-host/spinup/releases" | jq -r 'first | .tag_name') +if [ -z "$VERSION" ]; then + echo "Fetching latest Spinup version..." + SPINUP_VERSION=$(curl --silent "https://api.github.com/repos/spinup-host/spinup/releases" | jq -r 'first | .tag_name') +else + SPINUP_VERSION=$VERSION +fi OS=$(go env GOOS) ARCH=$(go env GOARCH) PLATFORM="${OS}-${ARCH}" -API_DL_URL="https://github.com/spinup-host/spinup/releases/download/${SPINUP_VERSION}/spinup-backend-${SPINUP_VERSION}-${PLATFORM}.tar.gz" SPINUP_PACKAGE="spinup-${SPINUP_VERSION}-${OS}-${ARCH}.tar.gz" SPINUP_TMP_DIR="/tmp/spinup-install" @@ -36,12 +39,12 @@ SPINUP_TMP_DIR="/tmp/spinup-install" mkdir -p ${SPINUP_DIR} mkdir -p ${SPINUP_TMP_DIR} -curl -LSs ${API_DL_URL} -o ${SPINUP_TMP_DIR}/${SPINUP_PACKAGE} -tar xzvf ${SPINUP_TMP_DIR}/${SPINUP_PACKAGE} -C "${SPINUP_TMP_DIR}/" -rm -f ${SPINUP_TMP_DIR}/${SPINUP_PACKAGE} - -${SPINUP_TMP_DIR}/spinup-backend version -cp ${SPINUP_TMP_DIR}/spinup-backend ${SPINUP_DIR}/spinup +echo "git clone --depth=1 --branch=${SPINUP_VERSION} https://github.com/spinup-host/spinup.git ${SPINUP_TMP_DIR}/spinup-api" +git clone --depth=1 --branch=${SPINUP_VERSION} https://github.com/spinup-host/spinup.git ${SPINUP_TMP_DIR}/spinup-api +cd ${SPINUP_TMP_DIR}/spinup-api +go build -o spinup-backend ./main.go +./spinup-backend version +cp ${SPINUP_TMP_DIR}/spinup-api/spinup-backend ${SPINUP_DIR}/spinup git clone --depth=1 https://github.com/spinup-host/spinup-dash.git ${SPINUP_TMP_DIR}/spinup-dash cd ${SPINUP_TMP_DIR}/spinup-dash