Skip to content

Commit

Permalink
Merge pull request #633 from CS-SI/pr/updatemaster
Browse files Browse the repository at this point in the history
Update master to v22.11.6
  • Loading branch information
oscarpicas authored Feb 16, 2023
2 parents 276985c + 76d35bc commit f9a158b
Show file tree
Hide file tree
Showing 100 changed files with 1,765 additions and 393 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

strategy:
matrix:
go: [ 1.18.4 ]
go: [ 1.18.4, 1.19.5 ]
tags: [ releasetags, debug, tunnel ]

runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.current
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,6 @@ COPY --from=builder /exported/safescaled /exported/safescaled
COPY --from=builder /exported/safescale /exported/safescale
COPY --from=builder /exported/go.mod /exported/go.mod
COPY --from=builder /exported/go.sum /exported/go.sum
COPY --from=builder /exported/safescale.proto /exported/safescale.proto
COPY --from=builder /exported/safescale_pb.js /exported/safescale_pb.js
COPY --from=builder /exported/safescale_grpc_web_pb.js /exported/safescale_grpc_web_pb.js
1 change: 1 addition & 0 deletions Dockerfile.local
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,6 @@ COPY --from=builder /exported/safescaled /exported/safescaled
COPY --from=builder /exported/safescale /exported/safescale
COPY --from=builder /exported/go.mod /exported/go.mod
COPY --from=builder /exported/go.sum /exported/go.sum
COPY --from=builder /exported/safescale.proto /exported/safescale.proto
COPY --from=builder /exported/safescale_pb.js /exported/safescale_pb.js
COPY --from=builder /exported/safescale_grpc_web_pb.js /exported/safescale_grpc_web_pb.js
28 changes: 16 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ sharetests:
@echo "settings go build tags for sharetests"
@$(eval BUILD_TAGS = "sharetests,$(BUILD_TAGS)")

labeltests:
@echo "settings go build tags for labeltests"
@$(eval BUILD_TAGS = "labeltests,$(BUILD_TAGS)")

ifeq ($(OS),Windows_NT)
releasearchive:
@printf "%b" "$(OK_COLOR)$(OK_STRING) Creating release archive $(NO_COLOR)\n";
Expand Down Expand Up @@ -167,7 +171,7 @@ common: begin ground getdevdeps mod sdk generate

versioncut:
@printf "%b" "$(OK_COLOR)$(INFO_STRING) Go version check$(NO_COLOR)\n";
@(($(GO) version | grep go1.19) || ($(GO) version | grep go1.18)) || (printf "%b" "$(ERROR_COLOR)$(ERROR_STRING) Minimum go version is 1.18 ! $(NO_COLOR)\n" && false);
@(($(GO) version | grep go1.20) || ($(GO) version | grep go1.19) || ($(GO) version | grep go1.18)) || (printf "%b" "$(ERROR_COLOR)$(ERROR_STRING) Minimum go version is 1.18 ! $(NO_COLOR)\n" && false);

begin: versioncut
@printf "%b" "$(OK_COLOR)$(INFO_STRING) Build begins, branch $$(git rev-parse --abbrev-ref HEAD), commit $$(git log --format="%H" -n 1), go '$$($(GO) version)', protoc '$$(protoc --version)' ...$(NO_COLOR)\n";
Expand Down Expand Up @@ -231,7 +235,7 @@ ground: begin
cideps: begin ground
@$(WHICH) gojq > /dev/null; if [ $$? -ne 0 ]; then \
printf "%b" "$(OK_COLOR)$(INFO_STRING) Downloading gojq...$(NO_COLOR)\n"; \
$(GO) install $(GOJQ)@v0.12.9 &>/dev/null || true; \
$(GO) install $(GOJQ)@v0.12.11 &>/dev/null || true; \
fi
@$(WHICH) gron > /dev/null; if [ $$? -ne 0 ]; then \
printf "%b" "$(OK_COLOR)$(INFO_STRING) Downloading gron...$(NO_COLOR)\n";
Expand Down Expand Up @@ -539,12 +543,12 @@ gofmt: begin

err: begin generate
@printf "%b" "$(OK_COLOR)$(INFO_STRING) Running errcheck, $(NO_COLOR)target $(OBJ_COLOR)$(@)$(NO_COLOR)\n";
@$(GO) list ./... 2>&1 | grep -v mock | grep -v rules | grep -v cli | xargs errcheck -asserts | grep -v test | grep -v .pb. | grep -v nolint | $(TEE) err_results.log
@$(GO) list ./... 2>&1 | grep -v mock | grep -v rules | grep -v cli | xargs errcheck -asserts | grep -v test | grep -v .pb. | grep -v nolint 2>&1 | $(TEE) err_results.log
@if [ -s ./err_results.log ]; then printf "%b" "$(ERROR_COLOR)$(ERROR_STRING) errcheck FAILED !$(NO_COLOR)\n";exit 1;else printf "%b" "$(OK_COLOR)$(OK_STRING) CONGRATS. NO PROBLEMS DETECTED ! $(NO_COLOR)\n";fi;

vet: begin generate
@printf "%b" "$(OK_COLOR)$(INFO_STRING) Running vet checks, $(NO_COLOR)target $(OBJ_COLOR)$(@)$(NO_COLOR)\n";
@$(GO) list ./... | grep -v mock | grep -v rules | grep -v cli | xargs $(GO) vet | $(TEE) vet_results.log
@$(GO) list ./... | grep -v mock | grep -v rules | grep -v cli | xargs $(GO) vet 2>&1 | $(TEE) vet_results.log
@if [ -s ./vet_results.log ]; then printf "%b" "$(ERROR_COLOR)$(ERROR_STRING) vet FAILED !$(NO_COLOR)\n";exit 1;else printf "%b" "$(OK_COLOR)$(OK_STRING) CONGRATS. NO PROBLEMS DETECTED ! $(NO_COLOR)\n";fi

semgrep: begin
Expand All @@ -553,9 +557,9 @@ semgrep: begin
@($(WHICH) ruleguard > /dev/null || (echo "ruleguard not installed in your system" && exit 1))
ifeq ($(shell $(MD5) --status -c sums.log 2>/dev/null && echo 0 || echo 1 ),1)
@$(RM) semgrep_results.log || true
@ruleguard -c=0 -rules build/rules/ruleguard.rules.$(CERR).go ./... 2>&1 | tr '\n' '\0' | xargs -0 -n2 | grep -v nolint | grep -v _test.go | grep -v mock | grep -v .pb. | awk 'NF' | $(TEE) semgrep_results.log
@ruleguard -c=0 -rules build/rules/ruleguard.rules.json.go ./... 2>&1 | tr '\n' '\0' | xargs -0 -n2 | grep -v nolint | grep -v mock | grep -v _test.go | grep -v .pb. | awk 'NF' | $(TEE) -a semgrep_results.log
@ruleguard -c=0 -rules build/rules/ruleguard.rules.locks.go ./... 2>&1 | tr '\n' '\0' | xargs -0 -n2 | grep -v defer | grep -v nolint | grep -v mock | grep -v _test.go | grep -v .pb. | awk 'NF' | $(TEE) -a semgrep_results.log
@ruleguard -c=0 -rules build/rules/ruleguard.rules.$(CERR).go ./... 2>&1 | tr '\n' '\0' | xargs -0 -n2 | grep -v nolint | grep -v _test.go | grep -v mock | grep -v .pb. | awk 'NF' 2>&1 | $(TEE) semgrep_results.log
@ruleguard -c=0 -rules build/rules/ruleguard.rules.json.go ./... 2>&1 | tr '\n' '\0' | xargs -0 -n2 | grep -v nolint | grep -v mock | grep -v _test.go | grep -v .pb. | awk 'NF' 2>&1 | $(TEE) -a semgrep_results.log
@ruleguard -c=0 -rules build/rules/ruleguard.rules.locks.go ./... 2>&1 | tr '\n' '\0' | xargs -0 -n2 | grep -v defer | grep -v nolint | grep -v mock | grep -v _test.go | grep -v .pb. | awk 'NF' 2>&1 | $(TEE) -a semgrep_results.log
@if [ -s ./semgrep_results.log ]; then printf "%b" "$(ERROR_COLOR)$(ERROR_STRING) semgrep FAILED, look at semgrep_results.log !$(NO_COLOR)\n";exit 1;else printf "%b" "$(OK_COLOR)$(OK_STRING) CONGRATS. NO PROBLEMS DETECTED ! $(NO_COLOR)\n";fi
else
@printf "%b" "$(OK_COLOR)$(OK_STRING) Nothing to do $(NO_COLOR)target $(OBJ_COLOR)$(@)$(NO_COLOR)\n";
Expand All @@ -569,7 +573,7 @@ metalint: begin
@($(WHICH) golangci-lint > /dev/null || (echo "golangci-lint not installed in your system" && exit 1))
ifeq ($(shell $(MD5) --status -c sums.log 2>/dev/null && echo 0 || echo 1 ),1)
@$(RM) metalint_results.log || true
@golangci-lint --color never --timeout=16m --no-config --disable=unused --disable=goconst --disable=maligned --enable=unparam --enable=deadcode --disable=gocyclo --enable=varcheck --enable=staticcheck --enable=structcheck --disable=typecheck --enable=errcheck --enable=ineffassign --enable=interfacer --enable=unconvert --enable=gosec --enable=megacheck --enable=gocritic --enable=dogsled --disable=funlen --disable=gochecknoglobals --enable=depguard run ./lib/... 2>/dev/null | tr '\n' '\0' | xargs -0 -n3 | grep -v nolint | grep -v _test.go | grep -v .pb. | grep -v "\s*^\s*" | grep -v ^[[:space:]]*$ | $(TEE) metalint_results.log
@golangci-lint --color never --timeout=16m --no-config --disable=unused --disable=goconst --disable=maligned --enable=unparam --enable=deadcode --disable=gocyclo --enable=varcheck --enable=staticcheck --enable=structcheck --disable=typecheck --enable=errcheck --enable=ineffassign --enable=interfacer --enable=unconvert --enable=gosec --enable=megacheck --enable=gocritic --enable=dogsled --disable=funlen --disable=gochecknoglobals --enable=depguard run ./lib/... 2>/dev/null | tr '\n' '\0' | xargs -0 -n3 | grep -v nolint | grep -v _test.go | grep -v .pb. | grep -v "\s*^\s*" | grep -v ^[[:space:]]*$ 2>&1 | $(TEE) metalint_results.log
@if [ -s ./metalint_results.log ]; then printf "%b" "$(ERROR_COLOR)$(ERROR_STRING) metalint FAILED, look at metalint_results.log !$(NO_COLOR)\n";exit 1;else printf "%b" "$(OK_COLOR)$(OK_STRING) CONGRATS. NO PROBLEMS DETECTED ! $(NO_COLOR)\n";fi
else
@printf "%b" "$(OK_COLOR)$(OK_STRING) Nothing to do $(NO_COLOR)target $(OBJ_COLOR)$(@)$(NO_COLOR)\n";
Expand All @@ -590,7 +594,7 @@ style: begin
@($(WHICH) golangci-lint > /dev/null || (echo "golangci-lint not installed in your system" && exit 1))
ifeq ($(shell $(MD5) --status -c sums.log 2>/dev/null && echo 0 || echo 1 ),1)
@$(RM) style_results.log || true
@golangci-lint --color never --timeout=10m --no-config --disable=unused --disable=goconst --disable=gocyclo --enable=errcheck --enable=stylecheck --disable=typecheck --enable=deadcode --enable=revive --enable=gocritic --enable=staticcheck --enable=gosimple --enable=govet --enable=ineffassign --enable=varcheck run ./... 2>/dev/null | tr '\n' ' ' | tr "^" '\0' | xargs -0 -n1 | grep -v _test.go | grep -v nolint | grep -v .pb. | grep -v typecheck | awk 'NF' | $(TEE) style_results.log
@golangci-lint --color never --timeout=10m --no-config --disable=unused --disable=goconst --disable=gocyclo --enable=errcheck --enable=stylecheck --disable=typecheck --enable=deadcode --enable=revive --enable=gocritic --enable=staticcheck --enable=gosimple --enable=govet --enable=ineffassign --enable=varcheck run ./... 2>/dev/null | tr '\n' ' ' | tr "^" '\0' | xargs -0 -n1 | grep -v _test.go | grep -v nolint | grep -v .pb. | grep -v typecheck | awk 'NF' 2>&1 | $(TEE) style_results.log
@if [ -s ./style_results.log ]; then printf "%b" "$(ERROR_COLOR)$(ERROR_STRING) style FAILED, look at style_results.log !$(NO_COLOR)\n";exit 1;else printf "%b" "$(OK_COLOR)$(OK_STRING) CONGRATS. NO PROBLEMS DETECTED ! $(NO_COLOR)\n";fi
else
@printf "%b" "$(OK_COLOR)$(OK_STRING) Nothing to do $(NO_COLOR)target $(OBJ_COLOR)$(@)$(NO_COLOR)\n";
Expand All @@ -614,7 +618,7 @@ badpractices: begin
@($(WHICH) ireturn > /dev/null || (echo "ireturn not installed in your system" && exit 1))
ifeq ($(shell $(MD5) --status -c sums.log 2>/dev/null && echo 0 || echo 1 ),1)
@$(RM) practices_results.log || true
@ireturn ./... 2>&1 | grep -v mock_ | grep -v fail.Error | $(TEE) practices_results.log
@ireturn ./... 2>&1 | grep -v mock_ | grep -v fail.Error 2>&1 | $(TEE) practices_results.log
@if [ -s ./practices_results.log ]; then printf "%b" "$(ERROR_COLOR)$(ERROR_STRING) maint FAILED, look at practices_results.log !$(NO_COLOR)\n";exit 1;else printf "%b" "$(OK_COLOR)$(OK_STRING) CONGRATS. NO PROBLEMS DETECTED ! $(NO_COLOR)\n";fi
else
@printf "%b" "$(OK_COLOR)$(OK_STRING) Nothing to do $(NO_COLOR)target $(OBJ_COLOR)$(@)$(NO_COLOR)\n";
Expand All @@ -627,7 +631,7 @@ ctxcheck: begin
@($(WHICH) contextcheck > /dev/null || (echo "contextcheck not installed in your system" && exit 1))
ifeq ($(shell $(MD5) --status -c sums.log 2>/dev/null && echo 0 || echo 1 ),1)
@$(RM) ctxcheck_results.log || true
@contextcheck ./lib/backend/resources/operations/... 2>&1 | grep -v mock_ | grep -v fail.Error | grep -v nolint | $(TEE) ctxcheck_results.log
@contextcheck ./lib/backend/resources/operations/... 2>&1 | grep -v mock_ | grep -v fail.Error | grep -v nolint 2>&1 | $(TEE) ctxcheck_results.log
@if [ -s ./ctxcheck_results.log ]; then printf "%b" "$(ERROR_COLOR)$(ERROR_STRING) maint FAILED, look at ctxcheck_results.log !$(NO_COLOR)\n";exit 1;else printf "%b" "$(OK_COLOR)$(OK_STRING) CONGRATS. NO PROBLEMS DETECTED ! $(NO_COLOR)\n";fi
else
@printf "%b" "$(OK_COLOR)$(OK_STRING) Nothing to do $(NO_COLOR)target $(OBJ_COLOR)$(@)$(NO_COLOR)\n";
Expand All @@ -637,7 +641,7 @@ warnings: begin
@printf "%b" "$(OK_COLOR)$(INFO_STRING) Running warnings checks, $(NO_COLOR)target $(OBJ_COLOR)$(@)$(NO_COLOR)\n";
@($(WHICH) golangci-lint > /dev/null || (echo "golangci-lint not installed in your system" && exit 1))
@$(RM) warnings_results.log || true
@golangci-lint --color never --timeout=16m run ./... 2>/dev/null | tr '\n' ' ' | sed -e "s/\^/\n/g" | grep -v nolint | grep -v rangeValCopy | grep -v json.camel | grep -v magic.numbers | grep -v _test.go | grep -v .pb. | $(TEE) warnings_results.log
@golangci-lint --color never --timeout=16m run ./... 2>/dev/null | tr '\n' ' ' | sed -e "s/\^/\n/g" | grep -v nolint | grep -v rangeValCopy | grep -v json.camel | grep -v magic.numbers | grep -v _test.go | grep -v .pb. 2>&1 | $(TEE) warnings_results.log
@if [ -s ./warnings_results.log ]; then printf "%b" "$(ERROR_COLOR)$(ERROR_STRING) warnings FAILED, look at warnings_results.log !$(NO_COLOR)\n";exit 1;else printf "%b" "$(OK_COLOR)$(OK_STRING) CONGRATS. NO PROBLEMS DETECTED ! $(NO_COLOR)\n";fi

show-cov: begin
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ Supplemental software and/or configurations can be installed in 3 ways on SafeSc

A "SafeScale `Feature`" is a file in YAML format that describes the operations to check/add/remove software and/or configuration on a target (Host or Cluster).

A `Feature` can describe operations using different methods:
- `package`: just define the package(s) concerned
- `bash`: uses bash snippets
- `helm`: uses helm chart, the "package" engine for Kubernetes
- `ansible`: defines playbook to run, SafeScale providing inventory
A `Feature` can describe operations using bash snippets.

Additionally, a `Feature` is able to apply:
- reverse proxy rules
Expand Down
1 change: 1 addition & 0 deletions build-safescale-cover-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ CIBIN=/exported make installci force_sdk_python force_sdk_js

cp ${WRKDIR}/SafeScale/go.mod /exported
cp ${WRKDIR}/SafeScale/go.sum /exported
cp ${WRKDIR}/SafeScale/lib/protocol/safescale.proto /exported
cp ${WRKDIR}/SafeScale/lib/protocol/javascript/* /exported
cp ${WRKDIR}/SafeScale/lib/protocol/python3/* /exported

Expand Down
1 change: 1 addition & 0 deletions build-safescale-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ CIBIN=/exported make installci force_sdk_js force_sdk_python

cp ${WRKDIR}/SafeScale/go.mod /exported
cp ${WRKDIR}/SafeScale/go.sum /exported
cp ${WRKDIR}/SafeScale/lib/protocol/safescale.proto /exported
cp ${WRKDIR}/SafeScale/lib/protocol/javascript/* /exported
cp ${WRKDIR}/SafeScale/lib/protocol/python3/* /exported

Expand Down
16 changes: 16 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ RUN wget --no-check-certificate https://github.com/google/protobuf/releases/down
&& ln -s /usr/local/protoc/bin/protoc /usr/local/bin \
&& rm /tmp/protoc-$PROTOVERSION-linux-x86_64.zip

RUN wget --no-check-certificate https://github.com/grpc/grpc-web/releases/download/1.3.1/protoc-gen-grpc-web-1.3.1-linux-x86_64 -O /usr/bin/protoc-gen-grpc-web \
&& chmod ugo+x /usr/bin/protoc-gen-grpc-web

FROM base AS builder

WORKDIR /tmp
Expand All @@ -43,11 +46,18 @@ WORKDIR /tmp
RUN apt-get install -y --allow-unauthenticated --no-install-recommends \
locales \
sudo \
locate \
build-essential \
make \
wget \
curl \
unzip \
vim \
git \
jq \
iproute2 \
iputils-ping \
openssh-server \
python3 \
python3-pip \
&& apt-get autoclean -y \
Expand All @@ -61,6 +71,9 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN python3 -c "print('testing UTF8: 👌')"

RUN wget --no-check-certificate https://github.com/grpc/grpc-web/releases/download/1.3.1/protoc-gen-grpc-web-1.3.1-linux-x86_64 -O /usr/bin/protoc-gen-grpc-web \
&& chmod ugo+x /usr/bin/protoc-gen-grpc-web

ENV SHELL /bin/bash
ENV GOPATH /go
COPY build-safescale.sh /opt/build-safescale.sh
Expand Down Expand Up @@ -100,3 +113,6 @@ COPY --from=builder /exported/safescaled /exported/safescaled
COPY --from=builder /exported/safescale /exported/safescale
COPY --from=builder /exported/go.mod /exported/go.mod
COPY --from=builder /exported/go.sum /exported/go.sum
COPY --from=builder /exported/safescale.proto /exported/safescale.proto
COPY --from=builder /exported/safescale_pb.js /exported/safescale_pb.js
COPY --from=builder /exported/safescale_grpc_web_pb.js /exported/safescale_grpc_web_pb.js
16 changes: 16 additions & 0 deletions build/Dockerfile2
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ RUN wget --no-check-certificate https://github.com/google/protobuf/releases/down
&& ln -s /usr/local/protoc/bin/protoc /usr/local/bin \
&& rm /tmp/protoc-$PROTOVERSION-linux-x86_64.zip

RUN wget --no-check-certificate https://github.com/grpc/grpc-web/releases/download/1.3.1/protoc-gen-grpc-web-1.3.1-linux-x86_64 -O /usr/bin/protoc-gen-grpc-web \
&& chmod ugo+x /usr/bin/protoc-gen-grpc-web

FROM base AS builder

WORKDIR /tmp
Expand All @@ -45,11 +48,18 @@ WORKDIR /tmp
RUN apt-get install -y --allow-unauthenticated --no-install-recommends \
locales \
sudo \
locate \
build-essential \
make \
wget \
curl \
unzip \
vim \
git \
jq \
iproute2 \
iputils-ping \
openssh-server \
python3 \
python3-pip \
&& apt-get autoclean -y \
Expand All @@ -63,6 +73,9 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN python3 -c "print('testing UTF8: 👌')"

RUN wget --no-check-certificate https://github.com/grpc/grpc-web/releases/download/1.3.1/protoc-gen-grpc-web-1.3.1-linux-x86_64 -O /usr/bin/protoc-gen-grpc-web \
&& chmod ugo+x /usr/bin/protoc-gen-grpc-web

ENV SHELL /bin/bash
ENV GOPATH /go
COPY build-safescale2.sh /opt/build-safescale.sh
Expand Down Expand Up @@ -102,3 +115,6 @@ COPY --from=builder /exported-$GOOSX-$GOARCHX/safescaled /exported-$GOOSX-$GOARC
COPY --from=builder /exported-$GOOSX-$GOARCHX/safescale /exported-$GOOSX-$GOARCHX/safescale
COPY --from=builder /exported-$GOOSX-$GOARCHX/go.mod /exported-$GOOSX-$GOARCHX/go.mod
COPY --from=builder /exported-$GOOSX-$GOARCHX/go.sum /exported-$GOOSX-$GOARCHX/go.sum
COPY --from=builder /exported-$GOOSX-$GOARCHX/safescale.proto /exported-$GOOSX-$GOARCHX/safescale.proto
COPY --from=builder /exported-$GOOSX-$GOARCHX/safescale_pb.js /exported-$GOOSX-$GOARCHX/safescale_pb.js
COPY --from=builder /exported-$GOOSX-$GOARCHX/safescale_grpc_web_pb.js /exported-$GOOSX-$GOARCHX/safescale_grpc_web_pb.js
5 changes: 4 additions & 1 deletion build/build-safescale.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,13 @@ echo "Export"
export CIBIN=/exported
mkdir -p /exported

CIBIN=/exported make installci
CIBIN=/exported make installci force_sdk_js force_sdk_python
[ $? -ne 0 ] && echo "Export failure" && exit 1

cp ${WRKDIR}/SafeScale/go.mod /exported
cp ${WRKDIR}/SafeScale/go.sum /exported
cp ${WRKDIR}/SafeScale/lib/protocol/safescale.proto /exported
cp ${WRKDIR}/SafeScale/lib/protocol/javascript/* /exported
cp ${WRKDIR}/SafeScale/lib/protocol/python3/* /exported

exit 0
5 changes: 4 additions & 1 deletion build/build-safescale2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,13 @@ echo "Export"
export CIBIN=/exported-$GOOS-$GOARCH
mkdir -p /exported-$GOOS-$GOARCH

CIBIN=/exported-$GOOS-$GOARCH make installci
CIBIN=/exported-$GOOS-$GOARCH make installci force_sdk_js force_sdk_python
[ $? -ne 0 ] && echo "Export failure" && exit 1

cp ${WRKDIR}/SafeScale/go.mod /exported-$GOOS-$GOARCH
cp ${WRKDIR}/SafeScale/go.sum /exported-$GOOS-$GOARCH
cp ${WRKDIR}/SafeScale/lib/protocol/safescale.proto /exported-$GOOS-$GOARCH
cp ${WRKDIR}/SafeScale/lib/protocol/javascript/* /exported-$GOOS-$GOARCH
cp ${WRKDIR}/SafeScale/lib/protocol/python3/* /exported-$GOOS-$GOARCH

exit 0
23 changes: 23 additions & 0 deletions build/releaseit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#! /bin/bash -x

if [ -z "$1" ]; then
echo "Must specify a version number ..."
exit 1
fi

export BRANCH_NAME=develop
docker system prune -a -f
BRANCH_NAME=develop ./create-docker.sh -f
docker system prune -a -f
BRANCH_NAME=develop GOOSX=darwin GOARCHX=arm64 ./create-docker2.sh -f
docker system prune -a -f
BRANCH_NAME=develop GOOSX=linux GOARCHX=arm ./create-docker2.sh -f
docker system prune -a -f
BRANCH_NAME=develop GOOSX=windows GOARCHX=amd64 ./create-docker2.sh -f
docker system prune -a -f
mv ./exported-windows-amd64/safescale ./exported-windows-amd64/safescale.exe
mv ./exported-windows-amd64/safescaled ./exported-windows-amd64/safescaled.exe
tar -czf safescale-$1-linux-amd64.tar.gz -C ./exported .
tar -czf safescale-$1-linux-arm.tar.gz -C ./exported-linux-arm .
tar -czf safescale-$1-darwin-arm64.tar.gz -C ./exported-darwin-arm64 .
tar -czf safescale-$1-windows-amd64.tar.gz -C ./exported-windows-amd64 .
6 changes: 6 additions & 0 deletions cli/safescale/commands/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,10 @@ var clusterCreateCommand = cli.Command{
Name: "disable",
Usage: "Allows to disable addition of default features (can be used several times to disable several features)",
},
cli.StringSliceFlag{
Name: "enable",
Usage: "Allows to enable addition of features (can be used several times to enable several features)",
},
cli.StringFlag{
Name: "os",
Usage: "Defines the operating system to use",
Expand Down Expand Up @@ -492,6 +496,7 @@ var clusterCreateCommand = cli.Command{
keep := c.Bool("keep-on-failure")
cidr := c.String("cidr")
disable := c.StringSlice("disable")
enable := c.StringSlice("enable")
los := c.String("os")
gatewaySSHPort := uint32(c.Int("gwport"))

Expand Down Expand Up @@ -533,6 +538,7 @@ var clusterCreateCommand = cli.Command{
KeepOnFailure: keep,
Cidr: cidr,
Disabled: disable,
Enabled: enable,
Os: los,
GlobalSizing: globalDef,
GatewaySizing: gatewaysDef,
Expand Down
Loading

0 comments on commit f9a158b

Please sign in to comment.