ci: cleanup ws before build, fix gateway install

Jenkins uses the same folder for different PR-s. Sometimes other runs do
not cleanup after themselves (e.g. timeout), hence add a cleanWs step to
ensure we delete files in the workspace.

gateway-st introduced a replace directive in go.mod, which does not work
with go install. Hardcode to the last version without the directive.
Using this fix to unblock ci builds.

Change-Id: I5e5d75bf47e30a5a8b6d835867c0c9176f25e08a
This commit is contained in:
Egon Elbre 2021-09-23 13:48:20 +03:00
parent bd4017b2a6
commit 8ef03b0967
5 changed files with 12 additions and 5 deletions

View File

@ -8,7 +8,8 @@ pipeline {
}
}
options {
timeout(time: 36, unit: 'MINUTES')
timeout(time: 36, unit: 'MINUTES')
skipDefaultCheckout(true)
}
environment {
NPM_CONFIG_CACHE = '/npm/cache'
@ -18,6 +19,11 @@ pipeline {
stages {
stage('Checkout') {
steps {
cleanWs(
deleteDirs: true,
disableDeferredWipeout: true,
)
checkout scm
sh 'mkdir -p .build'
@ -64,7 +70,7 @@ pipeline {
stage('go -race gateway') {
steps {
// install gateway for storj-sim
sh 'go install -race -v storj.io/gateway@latest'
sh 'go install -race -v storj.io/gateway@5da0ff79b964560906bab67ce6f1eb16b89a93de'
}
}

View File

@ -95,7 +95,7 @@ install-sim: ## install storj-sim
## install exact version of storj/gateway
## TODO replace 'main' with 'latest' when gateway with multipart will be released
go install -race -v storj.io/gateway@main
go install -race -v storj.io/gateway@5da0ff79b964560906bab67ce6f1eb16b89a93de
##@ Test

View File

@ -68,6 +68,7 @@ EOF
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
sed -i -e 's#storj.io/gateway@main#storj.io/gateway@5da0ff79b964560906bab67ce6f1eb16b89a93de#g' "$RELEASE_DIR"/Makefile
GOBIN="$RELEASE_DIR"/bin make -C "$RELEASE_DIR" install-sim
GOBIN="$BRANCH_DIR"/bin make -C "$BRANCH_DIR" install-sim

View File

@ -118,7 +118,7 @@ install_sim(){
mkdir -p .build/gateway-tmp
pushd .build/gateway-tmp
## TODO replace 'main' with 'latest' when gateway with multipart will be released
go mod init gatewaybuild && GOBIN=${bin_dir} GO111MODULE=on go get storj.io/gateway@main
go mod init gatewaybuild && GOBIN=${bin_dir} GO111MODULE=on go get storj.io/gateway@5da0ff79b964560906bab67ce6f1eb16b89a93de
popd
fi

View File

@ -93,7 +93,7 @@ install_sim(){
else
mkdir -p ${work_dir}/build/gateway-tmp
## TODO replace 'main' with 'latest' when gateway with multipart will be released
(cd ${work_dir}/build/gateway-tmp && go mod init gatewaybuild && GOBIN=${bin_dir} GO111MODULE=on go get storj.io/gateway@main;)
(cd ${work_dir}/build/gateway-tmp && go mod init gatewaybuild && GOBIN=${bin_dir} GO111MODULE=on go get storj.io/gateway@5da0ff79b964560906bab67ce6f1eb16b89a93de;)
rm -rf ${work_dir}/build/gateway-tmp
fi
if [ -d "${work_dir}/cmd/multinode" ]; then