Adding auto deploy to staging in kube (#219)
This commit is contained in:
parent
c7adc1dfb8
commit
0440d5fbe6
19
Jenkinsfile
vendored
19
Jenkinsfile
vendored
@ -9,14 +9,23 @@ node('node') {
|
||||
sh 'make test-docker images'
|
||||
}
|
||||
|
||||
stage('Deploy') {
|
||||
if (env.BRANCH_NAME != 'master') {
|
||||
echo 'Skipping deploy stage'
|
||||
return
|
||||
}
|
||||
stage('Push Images') {
|
||||
echo 'Push to Repo'
|
||||
sh 'make push-images'
|
||||
}
|
||||
|
||||
stage('Deploy') {
|
||||
/* This should only deploy to staging if the branch is master */
|
||||
if (env.BRANCH_NAME == "master") {
|
||||
sh "./scripts/deploy.staging.sh satellite storjlabs/storj-satellite:${commit_id}"
|
||||
for (int i = 1; i < 60; i++) {
|
||||
sh "./scripts/deploy.staging.sh storage-node-${i} storjlabs/storj-storage-node:${commit_id}"
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
catch (err) {
|
||||
currentBuild.result = "FAILURE"
|
||||
|
7
scripts/deploy.staging.sh
Executable file
7
scripts/deploy.staging.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
PROJECT_NAME=$1
|
||||
CONTAINER=$2
|
||||
|
||||
kubectl config set-cluster storj-nonprod
|
||||
kubectl --namespace storj-staging patch deployment $PROJECT_NAME -p"{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"$PROJECT_NAME\",\"image\":\"$CONTAINER\"}]}}}}"
|
Loading…
Reference in New Issue
Block a user