Skip to content

Commit

Permalink
feat: support 1.13.x and 2.0.x clusters
Browse files Browse the repository at this point in the history
this is the final step towards the idea of an evergreen-ui.

we use /dcos-version to allow for a couple feature flags in order to show/hide
version-dependant features. having a central place allows us to maintain an
overview of those feature flags. please keep on removing those that are for
cluster versions `< n-2` (so remove 1.13-related stuff once 2.2 is GA).

we're currently running system-tests against all cluster-versions. we'll change
that in a short while, so we only run all things, when on master. that way we
have a reasonable security-barrier.

once this is merged, we can support all supported DC/OS'es with a single version
of the UI 🎉
  • Loading branch information
pierrebeitz committed Jun 15, 2020
1 parent 8dd9eda commit bc4c48c
Show file tree
Hide file tree
Showing 8 changed files with 373 additions and 84 deletions.
243 changes: 231 additions & 12 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pipeline {
}
}

stage("Test current versions") {
stage("Master") {
parallel {
stage("Unit Tests") {
// at this point we already ran tslint and the typecheck, see above!
Expand All @@ -101,19 +101,20 @@ pipeline {
}
}

stage("System Test OSS") {
stage("OSS") {
environment {
DCOS_DIR = "/tmp/.dcos-OSS"
DCOS_DIR = "/tmp/.dcos-OSS-latest"
PROXY_PORT = "4201"
TERRAFORM_DIR = "./scripts/terraform-oss-latest"
TF_VAR_cluster_name = "ui-oss-${cluster_suffix}-${BUILD_NUMBER}"
TF_VAR_custom_dcos_download_path = "https://downloads.dcos.io/dcos/testing/master/dcos_generate_config.sh"
TF_VAR_variant = "open"
}
steps {
withCredentials([ aws_id, aws_key ]) {
sh '''
export CLUSTER_URL=$(cd scripts/terraform && ./up.sh | tail -n1)
rsync -aH ./scripts/terraform/ $TERRAFORM_DIR
export CLUSTER_URL=$(cd $TERRAFORM_DIR && ./up.sh | tail -n1)
. scripts/utils/load_auth_env_vars
dcos cluster setup $CLUSTER_URL --provider=dcos-oidc-auth0 --insecure
npm run test:system
Expand All @@ -124,18 +125,18 @@ pipeline {
post {
always {
withCredentials([ aws_id, aws_key ]) {
sh "cd scripts/terraform && ./down.sh"
sh "cd $TERRAFORM_DIR && ./down.sh"
}
archiveArtifacts "cypress/**/*"
junit "cypress/result-system.xml"
}
}
}

stage("System Test EE") {
stage("EE") {
environment {
DCOS_DIR = "/tmp/.dcos-EE"
DCOS_DIR = "/tmp/.dcos-EE-master"
PROXY_PORT = "4202"
TERRAFORM_DIR = "./scripts/terraform-ee-master"
TF_VAR_cluster_name = "ui-ee-${cluster_suffix}-${BUILD_NUMBER}"
TF_VAR_custom_dcos_download_path = "https://downloads.mesosphere.com/dcos-enterprise/testing/master/dcos_generate_config.ee.sh"
TF_VAR_variant = "ee"
Expand All @@ -147,12 +148,230 @@ pipeline {
steps {
withCredentials([ aws_id, aws_key, string(credentialsId: "8667643a-6ad9-426e-b761-27b4226983ea", variable: "TF_VAR_license_key")]) {
sh '''
rsync -aH ./scripts/terraform/ $TERRAFORM_DIR
export CLUSTER_URL=$(cd $TERRAFORM_DIR && ./up.sh | tail -n1)
. scripts/utils/load_auth_env_vars
dcos cluster setup $CLUSTER_URL --provider=dcos-users --insecure
rsync -aH ./system-tests/ ./system-tests-ee/
npm run test:system
'''
}
}

post {
always {
withCredentials([ aws_id, aws_key ]) {
sh "cd $TERRAFORM_DIR && ./down.sh"
}
archiveArtifacts "cypress/**/*"
junit "cypress/result-system.xml"
}
}
}
}
}

stage("2.1") {
// when { expression { master_branches.contains(BRANCH_NAME) } }
parallel {
stage("OSS") {
environment {
DCOS_DIR = "/tmp/.dcos-OSS-2.1"
PROXY_PORT = "4300"
TERRAFORM_DIR = "./scripts/terraform-oss-2.1"
TF_VAR_cluster_name = "ui-21oss-${cluster_suffix}-${BUILD_NUMBER}"
TF_VAR_custom_dcos_download_path = "https://downloads.dcos.io/dcos/stable/2.1.0/dcos_generate_config.sh"
TF_VAR_variant = "open"
}
steps {
withCredentials([ aws_id, aws_key ]) {
sh '''
rsync -aH ./scripts/terraform/ $TERRAFORM_DIR
export CLUSTER_URL=$(cd $TERRAFORM_DIR && ./up.sh | tail -n1)
. scripts/utils/load_auth_env_vars
dcos cluster setup $CLUSTER_URL --provider=dcos-oidc-auth0 --insecure
npm run test:system
'''
}
}

post {
always {
withCredentials([ aws_id, aws_key ]) {
sh "cd $TERRAFORM_DIR && ./down.sh"
}
archiveArtifacts "cypress/**/*"
junit "cypress/result-system.xml"
}
}
}
stage("EE") {
environment {
DCOS_DIR = "/tmp/.dcos-EE-2.1"
PROXY_PORT = "4301"
TERRAFORM_DIR = "./scripts/terraform-ee-2.1"
TF_VAR_cluster_name = "ui-21ee-${cluster_suffix}-${BUILD_NUMBER}"
TF_VAR_custom_dcos_download_path = "https://downloads.mesosphere.com/dcos-enterprise/stable/2.1.0/dcos_generate_config.ee.sh"
TF_VAR_variant = "ee"

// EE-stuff
ADDITIONAL_CYPRESS_CONFIG = ",integrationFolder=system-tests-ee"
TESTS_FOLDER = "system-tests-ee"
}
steps {
withCredentials([ aws_id, aws_key, string(credentialsId: "8667643a-6ad9-426e-b761-27b4226983ea", variable: "TF_VAR_license_key")]) {
sh '''
rsync -aH ./scripts/terraform/ $TERRAFORM_DIR
export CLUSTER_URL=$(cd $TERRAFORM_DIR && ./up.sh | tail -n1)
. scripts/utils/load_auth_env_vars
dcos cluster setup $CLUSTER_URL --provider=dcos-users --insecure
rsync -aH ./system-tests/ ./system-tests-ee/
npm run test:system
'''
}
}

post {
always {
withCredentials([ aws_id, aws_key ]) {
sh "cd $TERRAFORM_DIR && ./down.sh"
}
archiveArtifacts "cypress/**/*"
junit "cypress/result-system.xml"
}
}
}
}
}

stage("2.0") {
// when { expression { master_branches.contains(BRANCH_NAME) } }
parallel {
stage("OSS") {
environment {
DCOS_DIR = "/tmp/.dcos-OSS-2.0"
PROXY_PORT = "4400"
TERRAFORM_DIR = "./scripts/terraform-oss-2.0"
TF_VAR_cluster_name = "ui-20oss-${cluster_suffix}-${BUILD_NUMBER}"
TF_VAR_custom_dcos_download_path = "https://downloads.dcos.io/dcos/stable/2.0.4/dcos_generate_config.sh"
TF_VAR_variant = "open"
}
steps {
withCredentials([ aws_id, aws_key ]) {
sh '''
rsync -aH ./scripts/terraform/ $TERRAFORM_DIR
export CLUSTER_URL=$(cd $TERRAFORM_DIR && ./up.sh | tail -n1)
. scripts/utils/load_auth_env_vars
dcos cluster setup $CLUSTER_URL --provider=dcos-oidc-auth0 --insecure
npm run test:system
'''
}
}

post {
always {
withCredentials([ aws_id, aws_key ]) {
sh "cd $TERRAFORM_DIR && ./down.sh"
}
archiveArtifacts "cypress/**/*"
junit "cypress/result-system.xml"
}
}
}
stage("EE") {
environment {
DCOS_DIR = "/tmp/.dcos-EE-2.0"
PROXY_PORT = "4401"
TERRAFORM_DIR = "./scripts/terraform-ee-2.0"
TF_VAR_cluster_name = "ui-20ee-${cluster_suffix}-${BUILD_NUMBER}"
TF_VAR_custom_dcos_download_path = "https://downloads.mesosphere.com/dcos-enterprise/stable/2.0.4/dcos_generate_config.ee.sh"
TF_VAR_variant = "ee"

// EE-stuff
ADDITIONAL_CYPRESS_CONFIG = ",integrationFolder=system-tests-ee"
TESTS_FOLDER = "system-tests-ee"
}
steps {
withCredentials([ aws_id, aws_key, string(credentialsId: "8667643a-6ad9-426e-b761-27b4226983ea", variable: "TF_VAR_license_key")]) {
sh '''
rsync -aH ./scripts/terraform/ $TERRAFORM_DIR
export CLUSTER_URL=$(cd $TERRAFORM_DIR && ./up.sh | tail -n1)
. scripts/utils/load_auth_env_vars
dcos cluster setup $CLUSTER_URL --provider=dcos-users --insecure
rsync -aH ./system-tests/ ./system-tests-ee/
rsync -aH ./scripts/terraform/ ./scripts/terraform-ee/
export CLUSTER_URL=$(cd scripts/terraform-ee && ./up.sh | tail -n1)
npm run test:system
'''
}
}

post {
always {
withCredentials([ aws_id, aws_key ]) {
sh "cd $TERRAFORM_DIR && ./down.sh"
}
archiveArtifacts "cypress/**/*"
junit "cypress/result-system.xml"
}
}
}
}
}

stage("1.13") {
// when { expression { master_branches.contains(BRANCH_NAME) } }
parallel {
stage("OSS") {
environment {
DCOS_DIR = "/tmp/.dcos-OSS-1.13"
PROXY_PORT = "4500"
TERRAFORM_DIR = "./scripts/terraform-oss-1.13"
TF_VAR_cluster_name = "ui-113oss-${cluster_suffix}-${BUILD_NUMBER}"
TF_VAR_custom_dcos_download_path = "https://downloads.dcos.io/dcos/stable/1.13.7/dcos_generate_config.sh"
TF_VAR_variant = "open"
}
steps {
withCredentials([ aws_id, aws_key ]) {
sh '''
rsync -aH ./scripts/terraform/ $TERRAFORM_DIR
export CLUSTER_URL=$(cd $TERRAFORM_DIR && ./up.sh | tail -n1)
. scripts/utils/load_auth_env_vars
dcos cluster setup $CLUSTER_URL --provider=dcos-oidc-auth0 --insecure
npm run test:system
'''
}
}

post {
always {
withCredentials([ aws_id, aws_key ]) {
sh "cd $TERRAFORM_DIR && ./down.sh"
}
archiveArtifacts "cypress/**/*"
junit "cypress/result-system.xml"
}
}
}
stage("EE") {
environment {
DCOS_DIR = "/tmp/.dcos-EE-1.13"
PROXY_PORT = "4501"
TERRAFORM_DIR = "./scripts/terraform-ee-1.13"
TF_VAR_cluster_name = "ui-113ee-${cluster_suffix}-${BUILD_NUMBER}"
TF_VAR_custom_dcos_download_path = "https://downloads.mesosphere.com/dcos-enterprise/stable/1.13.7/dcos_generate_config.ee.sh"
TF_VAR_variant = "ee"

// EE-stuff
ADDITIONAL_CYPRESS_CONFIG = ",integrationFolder=system-tests-ee"
TESTS_FOLDER = "system-tests-ee"
}
steps {
withCredentials([ aws_id, aws_key, string(credentialsId: "8667643a-6ad9-426e-b761-27b4226983ea", variable: "TF_VAR_license_key")]) {
sh '''
rsync -aH ./scripts/terraform/ $TERRAFORM_DIR
export CLUSTER_URL=$(cd $TERRAFORM_DIR && ./up.sh | tail -n1)
. scripts/utils/load_auth_env_vars
dcos cluster setup $CLUSTER_URL --provider=dcos-users --insecure
rsync -aH ./system-tests/ ./system-tests-ee/
npm run test:system
'''
}
Expand All @@ -161,7 +380,7 @@ pipeline {
post {
always {
withCredentials([ aws_id, aws_key ]) {
sh "cd scripts/terraform-ee && ./down.sh"
sh "cd $TERRAFORM_DIR && ./down.sh"
}
archiveArtifacts "cypress/**/*"
junit "cypress/result-system.xml"
Expand Down
Loading

0 comments on commit bc4c48c

Please sign in to comment.