summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-12-21 21:13:13 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-12-21 21:13:13 +0100
commit3cb8f01b9a33925bd65347f4a97c6db2f787589c (patch)
tree1d4e5bfe1ae84ac6da0a31c357da7f6395a4398b
parent9809a9af8a3980f8a65262295cfd9701e793ac11 (diff)
downloadgitlab-ce-3cb8f01b9a33925bd65347f4a97c6db2f787589c.tar.gz
Added Autodeploy script for OpenShift
-rw-r--r--spec/features/auto_deploy_spec.rb4
-rw-r--r--vendor/gitlab-ci-yml/autodeploy/OpenShift.gitlab-ci.yml74
2 files changed, 76 insertions, 2 deletions
diff --git a/spec/features/auto_deploy_spec.rb b/spec/features/auto_deploy_spec.rb
index 92c5b1cbb3b..e581aa411b0 100644
--- a/spec/features/auto_deploy_spec.rb
+++ b/spec/features/auto_deploy_spec.rb
@@ -37,7 +37,7 @@ describe 'Auto deploy' do
click_button 'Choose a GitLab CI Yaml template'
within '.gitlab-ci-yml-selector' do
- expect(page).to have_content('Kubernetes')
+ expect(page).to have_content('OpenShift')
end
end
@@ -45,7 +45,7 @@ describe 'Auto deploy' do
click_link 'Set up autodeploy'
click_button 'Choose a GitLab CI Yaml template'
within '.gitlab-ci-yml-selector' do
- click_on 'Kubernetes'
+ click_on 'OpenShift'
end
wait_for_ajax
click_button 'Commit Changes'
diff --git a/vendor/gitlab-ci-yml/autodeploy/OpenShift.gitlab-ci.yml b/vendor/gitlab-ci-yml/autodeploy/OpenShift.gitlab-ci.yml
new file mode 100644
index 00000000000..e384b585ae0
--- /dev/null
+++ b/vendor/gitlab-ci-yml/autodeploy/OpenShift.gitlab-ci.yml
@@ -0,0 +1,74 @@
+image: registry.gitlab.com/gitlab-examples/openshift-deploy
+
+variables:
+ # Application deployment domain
+ KUBE_DOMAIN: domain.example.com
+
+stages:
+ - build
+ - test
+ - review
+ - staging
+ - production
+
+build:
+ stage: build
+ script:
+ - command build
+ only:
+ - branches
+
+production:
+ stage: production
+ variables:
+ CI_ENVIRONMENT_URL: http://production.$KUBE_DOMAIN
+ script:
+ - command deploy
+ environment:
+ name: production
+ url: http://production.$KUBE_DOMAIN
+ when: manual
+ only:
+ - master
+
+staging:
+ stage: staging
+ variables:
+ CI_ENVIRONMENT_URL: http://staging.$KUBE_DOMAIN
+ script:
+ - command deploy
+ environment:
+ name: staging
+ url: http://staging.$KUBE_DOMAIN
+ only:
+ - master
+
+review:
+ stage: review
+ variables:
+ CI_ENVIRONMENT_URL: http://$CI_ENVIRONMENT_SLUG.$KUBE_DOMAIN
+ script:
+ - command deploy
+ environment:
+ name: review/$CI_BUILD_REF_NAME
+ url: http://$CI_ENVIRONMENT_SLUG.$KUBE_DOMAIN
+ on_stop: stop_review
+ only:
+ - branches
+ except:
+ - master
+
+stop_review:
+ stage: review
+ variables:
+ GIT_STRATEGY: none
+ script:
+ - command destroy
+ environment:
+ name: review/$CI_BUILD_REF_NAME
+ action: stop
+ when: manual
+ only:
+ - branches
+ except:
+ - master