diff --git a/lib/commands/deploy.mjs b/lib/commands/deploy.mjs index e5183d04..8205fa4f 100644 --- a/lib/commands/deploy.mjs +++ b/lib/commands/deploy.mjs @@ -37,14 +37,14 @@ export async function deploy(options, _programOpts) { } log.info( - `Logs are available at: ${protocol()}://${clusterCredentials.clusterHost()}:${secrets["GRAFANA_PORT"]}` + `Logs are available at: ${protocol()}://${clusterCredentials.clusterHost()}:${secrets["BROWSERUP_GRAFANA_PORT"]}` ); log.info(`Deploy cluster completed successfully, webconsole URL: ${clusterCredentials.clusterUrl}`); return clusterCredentials; } function protocol() { - return process.env.WEBCONSOLE_PROTOCOL || "http"; + return process.env.BROWSERUP_WEBCONSOLE_PROTOCOL || "http"; } async function deployLocalCluster(clusterParams) diff --git a/lib/commands/post-install.mjs b/lib/commands/post-install.mjs index 620a18ec..d72f5f9c 100644 --- a/lib/commands/post-install.mjs +++ b/lib/commands/post-install.mjs @@ -39,17 +39,16 @@ async function checkDockerVersion(){ } } -async function pullDockerImages() { +async function pullDockerImages(background = false){ log.debug("Looking for yaml at: " + BrowserUpPaths.dockerComposeYmlPath()); log.info("Pulling Docker images"); - await DockerClient.dockerPull({image: BROWSERUP_DEFAULT_IMAGE, silent: true}); + + await DockerClient.dockerPull({imageNameAndTag: BROWSERUP_DEFAULT_IMAGE, background: false}); await DockerClient.dockerComposePull( - {dockerComposePath: BrowserUpPaths.dockerComposeYmlPath(), services: '', background: true}); + {dockerComposePath: BrowserUpPaths.dockerComposeYmlPath(), services: '', background: false}); } - - function displayWelcome(){ const browserup = chalk.hex("#de792b")("Browser") + chalk.hex("#3a3a3a")("Up ") const banner = ` @@ -67,7 +66,7 @@ Launch the cluster and start the test: ${chalk.blue('browserup load start')} -${chalk.green('View the Test:')} http://localhost:6730 +${chalk.green('View the Test:')} http://localhost:23000 ${chalk.green('username:')} superadmin ${chalk.green('password:')} changeme! diff --git a/lib/config/env.properties b/lib/config/env.properties index b18942c6..56637125 100644 --- a/lib/config/env.properties +++ b/lib/config/env.properties @@ -1,52 +1,52 @@ -S3_MINIO_HOST=minio -S3_MINIO_PORT_1=6790 -S3_MINIO_PORT_2=6791 -S3_MINIO_ARTIFACTS_BUCKET=artifacts -S3_MINIO_ACCESS_KEY_ID=minio - -RABBITMQ_HOST=rabbitmq -RABBITMQ_PEER_DISCOVERY_PORT=6769 -RABBITMQ_QUEUE_PORT=6772 -RABBITMQ_MANAGEMENT_PORT=6767 -RABBITMQ_DEFAULT_PASS=just_testing - -ZOOKEEPER_HOST=zookeeper -ZOOKEEPER_CLIENT_PORT=6781 -ZOO_MAX_CLIENT_CNXNS=500 - -REDIS_HOST=redis -REDIS_PORT=6892 - -MYSQL_HOST=mysql -MYSQL_PORT=3306 -MYSQL_PASSWORD=just_testing -MYSQL_USERNAME=browserup - -WEBCONSOLE_HOST=webconsole -WEBCONSOLE_PORT=6730 -WEBCONSOLE_PROTOCOL=http -RAILS_MASTER_KEY=312ad97c276624b8069b61b73aa13a8a -LOCKBOX_MASTER_KEY=439e901f30a3ce31836dbc81e67411e1f84f43491740ca0f91df4a37a5cd6e8b - -GRID_JAVA_API_HOST=grid-java-api -GRID_JAVA_API_PORT=8080 - -CHRONOGRAF_HOST=chronograf -CHRONOGRAF_PORT=6788 - -INFLUX_DB_HOST=influxdb -INFLUX_DB_PORT=6786 -INFLUX_DB_NAME=browserup -INFLUX_DB_USER=browserup -INFLUX_TEST_DB_HOST=influx-test-db -INFLUX_TEST_DB_PORT=6786 -INFLUX_DB_PASSWORD=just_testing - -S3_MINIO_HOST_PORT_1=9000 - -GRAFANA_PORT=6799 -GRAFANA_USERNAME=browserup -GRAFANA_PASSWORD=just_testing - -PRIVATE_DNS_NAMESPACE_NAME=browserup-internal.com -CLUSTER_PUBLIC_IP=localhost +BROWSERUP_WEBCONSOLE_HOST=webconsole +BROWSERUP_WEBCONSOLE_PORT=23000 +BROWSERUP_WEBCONSOLE_PROTOCOL=http +BROWSERUP_RAILS_MASTER_KEY=312ad97c276624b8069b61b73aa13a8a +BROWSERUP_LOCKBOX_MASTER_KEY=439e901f30a3ce31836dbc81e67411e1f84f43491740ca0f91df4a37a5cd6e8b + +BROWSERUP_GRID_JAVA_API_HOST=grid-java-api +BROWSERUP_GRID_JAVA_API_PORT=23001 + +BROWSERUP_MYSQL_HOST=mysql +BROWSERUP_MYSQL_PORT=23002 +BROWSERUP_MYSQL_PASSWORD=just_testing +BROWSERUP_MYSQL_USERNAME=browserup + +BROWSERUP_S3_MINIO_HOST=minio +BROWSERUP_S3_MINIO_PORT_1=23003 +BROWSERUP_S3_MINIO_PORT_2=23004 +BROWSERUP_S3_MINIO_ARTIFACTS_BUCKET=artifacts +BROWSERUP_S3_MINIO_ACCESS_KEY_ID=minio + +BROWSERUP_RABBITMQ_HOST=rabbitmq +BROWSERUP_RABBITMQ_PEER_DISCOVERY_PORT=23005 +BROWSERUP_RABBITMQ_QUEUE_PORT=23006 +BROWSERUP_RABBITMQ_MANAGEMENT_PORT=23007 +BROWSERUP_RABBITMQ_DEFAULT_PASS=just_testing + +BROWSERUP_ZOOKEEPER_HOST=zookeeper +BROWSERUP_ZOOKEEPER_CLIENT_PORT=23008 +BROWSERUP_ZOO_MAX_CLIENT_CNXNS=500 + +BROWSERUP_REDIS_HOST=redis +BROWSERUP_REDIS_PORT=23009 + +BROWSERUP_CHRONOGRAF_HOST=chronograf +BROWSERUP_CHRONOGRAF_PORT=23010 + +BROWSERUP_INFLUX_DB_HOST=influxdb +BROWSERUP_INFLUX_DB_PORT=23011 +BROWSERUP_INFLUX_DB_NAME=browserup +BROWSERUP_INFLUX_DB_USER=browserup +BROWSERUP_INFLUX_TEST_DB_HOST=influx-test-db +BROWSERUP_INFLUX_TEST_DB_PORT=23011 +BROWSERUP_INFLUX_DB_PASSWORD=just_testing + +BROWSERUP_S3_MINIO_HOST_PORT_1=23012 + +BROWSERUP_GRAFANA_PORT=23013 +BROWSERUP_GRAFANA_USERNAME=browserup +BROWSERUP_GRAFANA_PASSWORD=just_testing + +BROWSERUP_PRIVATE_DNS_NAMESPACE_NAME=browserup-internal.com +BROWSERUP_CLUSTER_PUBLIC_IP=localhost diff --git a/lib/docker_compose/docker-compose.yml b/lib/docker_compose/docker-compose.yml index da2d03b5..1a5b9c2d 100644 --- a/lib/docker_compose/docker-compose.yml +++ b/lib/docker_compose/docker-compose.yml @@ -48,7 +48,7 @@ services: volumes: - /var/run/docker.sock:/var/run/docker.sock ports: - - "${GRID_JAVA_API_PORT}:8080" + - "${BROWSERUP_GRID_JAVA_API_PORT}:8080" restart: on-failure environment: - BROWSERUP_MINION_DEBUG_SUSPEND=n @@ -56,37 +56,37 @@ services: - BROWSERUP_MINION_DEBUG_PORT=8001 - BROWSERUP_GRID_API_DEBUG=${BROWSERUP_GRID_API_DEBUG} - BROWSERUP_GRID_API_DEBUG_PORT=8003 - - RABBITMQ_HOST=${RABBITMQ_HOST} - - RABBITMQ_DEFAULT_USER=browserup - - RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS} - - RABBITMQ_QUEUE_PORT=5672 - - ZOOKEEPER_HOST=${ZOOKEEPER_HOST} - - ZOOKEEPER_CLIENT_PORT=2181 - - INFLUX_DB_HOST=${INFLUX_DB_HOST} - - INFLUX_DB_PORT=8086 - - INFLUX_DB_NAME=browserup - - INFLUX_DB_USER=browserup - - INFLUX_DB_PASSWORD=${INFLUX_DB_PASSWORD} - - MINION_VUS=1 - - MAX_MINIONS_PER_EC2_INSTANCE=${MAX_MINIONS_PER_EC2_INSTANCE} - - IS_CLOUD=false - - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} - - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} - - AWS_REGION=${AWS_REGION} - - INSTANCE_TYPE=${INSTANCE_TYPE} - - IAM_INSTANCE_PROFILE=${IAM_INSTANCE_PROFILE} - - NUMBER_OF_CPU_UNITS=${NUMBER_OF_CPU_UNITS} - - NUMBER_OF_CPU_UNITS_FOR_TASK=${NUMBER_OF_CPU_UNITS_FOR_TASK} - - AMOUNT_OF_MEMORY_USED_BY_TASK=${AMOUNT_OF_MEMORY_USED_BY_TASK} - - EXECUTION_ROLE_ARN=${EXECUTION_ROLE_ARN} - - MINION_IMAGE_VERSION_TAG=${MINION_IMAGE_VERSION_TAG} - - S3_MINIO_ACCESS_KEY_ID=${S3_MINIO_ACCESS_KEY_ID} - - S3_MINIO_SECRET_ACCESS_KEY=${S3_MINIO_SECRET_ACCESS_KEY} - - S3_MINIO_HOST=${S3_MINIO_HOST} - - S3_MINIO_PORT_1=9000 - - S3_MINIO_PORT_2=9001 - - S3_MINIO_HOST_PORT_1=${S3_MINIO_PORT_1} - - S3_MINIO_ARTIFACTS_BUCKET=${S3_MINIO_ARTIFACTS_BUCKET} + - BROWSERUP_RABBITMQ_HOST=${BROWSERUP_RABBITMQ_HOST} + - BROWSERUP_RABBITMQ_DEFAULT_USER=browserup + - BROWSERUP_RABBITMQ_DEFAULT_PASS=${BROWSERUP_RABBITMQ_DEFAULT_PASS} + - BROWSERUP_RABBITMQ_QUEUE_PORT=5672 + - BROWSERUP_ZOOKEEPER_HOST=${BROWSERUP_ZOOKEEPER_HOST} + - BROWSERUP_ZOOKEEPER_CLIENT_PORT=2181 + - BROWSERUP_INFLUX_DB_HOST=${BROWSERUP_INFLUX_DB_HOST} + - BROWSERUP_INFLUX_DB_PORT=8086 + - BROWSERUP_INFLUX_DB_NAME=browserup + - BROWSERUP_INFLUX_DB_USER=browserup + - BROWSERUP_INFLUX_DB_PASSWORD=${BROWSERUP_INFLUX_DB_PASSWORD} + - BROWSERUP_MINION_VUS=1 + - BROWSERUP_MAX_MINIONS_PER_EC2_INSTANCE=${BROWSERUP_MAX_MINIONS_PER_EC2_INSTANCE} + - BROWSERUP_IS_CLOUD=false + - BROWSERUP_AWS_ACCESS_KEY_ID=${BROWSERUP_AWS_ACCESS_KEY_ID} + - BROWSERUP_AWS_SECRET_ACCESS_KEY=${BROWSERUP_AWS_SECRET_ACCESS_KEY} + - BROWSERUP_AWS_REGION=${BROWSERUP_AWS_REGION} + - BROWSERUP_INSTANCE_TYPE=${BROWSERUP_INSTANCE_TYPE} + - BROWSERUP_IAM_INSTANCE_PROFILE=${BROWSERUP_IAM_INSTANCE_PROFILE} + - BROWSERUP_NUMBER_OF_CPU_UNITS=${BROWSERUP_NUMBER_OF_CPU_UNITS} + - BROWSERUP_NUMBER_OF_CPU_UNITS_FOR_TASK=${BROWSERUP_NUMBER_OF_CPU_UNITS_FOR_TASK} + - BROWSERUP_AMOUNT_OF_MEMORY_USED_BY_TASK=${BROWSERUP_AMOUNT_OF_MEMORY_USED_BY_TASK} + - BROWSERUP_EXECUTION_ROLE_ARN=${BROWSERUP_EXECUTION_ROLE_ARN} + - BROWSERUP_MINION_IMAGE_VERSION_TAG=${BROWSERUP_MINION_IMAGE_VERSION_TAG} + - BROWSERUP_S3_MINIO_ACCESS_KEY_ID=${BROWSERUP_S3_MINIO_ACCESS_KEY_ID} + - BROWSERUP_S3_MINIO_SECRET_ACCESS_KEY=${BROWSERUP_S3_MINIO_SECRET_ACCESS_KEY} + - BROWSERUP_S3_MINIO_HOST=${BROWSERUP_S3_MINIO_HOST} + - BROWSERUP_S3_MINIO_PORT_1=9000 + - BROWSERUP_S3_MINIO_PORT_2=9001 + - BROWSERUP_S3_MINIO_HOST_PORT_1=${BROWSERUP_S3_MINIO_PORT_1} + - BROWSERUP_S3_MINIO_ARTIFACTS_BUCKET=${BROWSERUP_S3_MINIO_ARTIFACTS_BUCKET} - BROWSERUP_CLUSTER_NAME=${BROWSERUP_CLUSTER_NAME} depends_on: - influxdb @@ -106,7 +106,7 @@ services: restart: on-failure environment: - BROWSERUP_MINION_USE_LOCAL_CACHE=${BROWSERUP_MINION_USE_LOCAL_CACHE} - - STANDARD_IMAGE_VERSION_TAG_OVERRIDE=${STANDARD_IMAGE_VERSION_TAG_OVERRIDE} + - BROWSERUP_STANDARD_IMAGE_VERSION_TAG_OVERRIDE=${BROWSERUP_STANDARD_IMAGE_VERSION_TAG_OVERRIDE} - BROWSERUP_MINION_PROFILING=${BROWSERUP_MINION_PROFILING} - BROWSERUP_MINION_PROFILING_PORT=${BROWSERUP_MINION_PROFILING_PORT} - BROWSERUP_MINION_DEBUG_SUSPEND=${BROWSERUP_MINION_DEBUG_SUSPEND} @@ -114,30 +114,30 @@ services: - BROWSERUP_MINION_DEBUG_PORT=${BROWSERUP_MINION_DEBUG_PORT} - BROWSERUP_GRID_COORDINATOR_DEBUG=${BROWSERUP_GRID_COORDINATOR_DEBUG} - BROWSERUP_GRID_COORDINATOR_DEBUG_PORT=${BROWSERUP_GRID_COORDINATOR_DEBUG_PORT} - - RABBITMQ_HOST=${RABBITMQ_HOST} - - RABBITMQ_DEFAULT_USER=browserup - - RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS} - - RABBITMQ_QUEUE_PORT=5672 - - ZOOKEEPER_HOST=${ZOOKEEPER_HOST} - - ZOOKEEPER_CLIENT_PORT=2181 - - INFLUX_DB_HOST=${INFLUX_DB_HOST} - - INFLUX_DB_PORT=8086 - - INFLUX_DB_NAME=browserup - - INFLUX_DB_USER=browserup - - INFLUX_DB_PASSWORD=${INFLUX_DB_PASSWORD} - - MINION_VUS=1 - - MINION_IMAGE_VERSION_TAG=${MINION_IMAGE_VERSION_TAG} - - S3_MINIO_ACCESS_KEY_ID=${S3_MINIO_ACCESS_KEY_ID} - - S3_MINIO_SECRET_ACCESS_KEY=${S3_MINIO_SECRET_ACCESS_KEY} - - S3_MINIO_HOST=${S3_MINIO_HOST} - - S3_MINIO_PORT_1=9000 - - S3_MINIO_PORT_2=9001 - - IS_CLOUD=false - - S3_MINIO_ARTIFACTS_BUCKET=${S3_MINIO_ARTIFACTS_BUCKET} - - S3_MINIO_HOST_PORT_1=${S3_MINIO_PORT_1} + - BROWSERUP_RABBITMQ_HOST=${BROWSERUP_RABBITMQ_HOST} + - BROWSERUP_RABBITMQ_DEFAULT_USER=browserup + - BROWSERUP_RABBITMQ_DEFAULT_PASS=${BROWSERUP_RABBITMQ_DEFAULT_PASS} + - BROWSERUP_RABBITMQ_QUEUE_PORT=5672 + - BROWSERUP_ZOOKEEPER_HOST=${BROWSERUP_ZOOKEEPER_HOST} + - BROWSERUP_ZOOKEEPER_CLIENT_PORT=2181 + - BROWSERUP_INFLUX_DB_HOST=${BROWSERUP_INFLUX_DB_HOST} + - BROWSERUP_INFLUX_DB_PORT=8086 + - BROWSERUP_INFLUX_DB_NAME=browserup + - BROWSERUP_INFLUX_DB_USER=browserup + - BROWSERUP_INFLUX_DB_PASSWORD=${BROWSERUP_INFLUX_DB_PASSWORD} + - BROWSERUP_MINION_VUS=1 + - BROWSERUP_MINION_IMAGE_VERSION_TAG=${MINION_IMAGE_VERSION_TAG} + - BROWSERUP_S3_MINIO_ACCESS_KEY_ID=${BROWSERUP_S3_MINIO_ACCESS_KEY_ID} + - BROWSERUP_S3_MINIO_SECRET_ACCESS_KEY=${BROWSERUP_S3_MINIO_SECRET_ACCESS_KEY} + - BROWSERUP_S3_MINIO_HOST=${BROWSERUP_S3_MINIO_HOST} + - BROWSERUP_S3_MINIO_PORT_1=9000 + - BROWSERUP_S3_MINIO_PORT_2=9001 + - BROWSERUP_IS_CLOUD=false + - BROWSERUP_S3_MINIO_ARTIFACTS_BUCKET=${BROWSERUP_S3_MINIO_ARTIFACTS_BUCKET} + - BROWSERUP_S3_MINIO_HOST_PORT_1=${BROWSERUP_S3_MINIO_PORT_1} - BROWSERUP_CLUSTER_NAME=${BROWSERUP_CLUSTER_NAME} - - USER_ARTIFACT_CACHE_PATH=/bu/artifactcache - - USE_LOCAL_DOCKER_CACHED_IMAGE=${USE_LOCAL_DOCKER_CACHED_IMAGE} + - BROWSERUP_USER_ARTIFACT_CACHE_PATH=/bu/artifactcache + - BROWSERUP_USE_LOCAL_DOCKER_CACHED_IMAGE=${BROWSERUP_USE_LOCAL_DOCKER_CACHED_IMAGE} depends_on: - zookeeper - rabbitmq @@ -158,33 +158,33 @@ services: devices: - "/dev/fuse" ports: - - "${WEBCONSOLE_PORT}:3000" + - "${BROWSERUP_WEBCONSOLE_PORT}:3000" environment: - DOCKER_LOGS=true - - MYSQL_HOST=${MYSQL_HOST} - - MYSQL_USERNAME=browserup - - MYSQL_PASSWORD=${MYSQL_PASSWORD} - - MYSQL_PORT=3306 - - INFLUX_DB_HOST=${INFLUX_DB_HOST} - - INFLUX_DB_PORT=8086 - - INFLUX_DB_NAME=browserup - - INFLUX_DB_USER=browserup - - INFLUX_DB_PASSWORD=${INFLUX_DB_PASSWORD} - - GRID_SERVICE_URL=http://${GRID_JAVA_API_HOST}:8080/grid + - BROWSERUP_MYSQL_HOST=${BROWSERUP_MYSQL_HOST} + - BROWSERUP_MYSQL_USERNAME=browserup + - BROWSERUP_MYSQL_PASSWORD=${BROWSERUP_MYSQL_PASSWORD} + - BROWSERUP_MYSQL_PORT=3306 + - BROWSERUP_INFLUX_DB_HOST=${BROWSERUP_INFLUX_DB_HOST} + - BROWSERUP_INFLUX_DB_PORT=8086 + - BROWSERUP_INFLUX_DB_NAME=browserup + - BROWSERUP_INFLUX_DB_USER=browserup + - BROWSERUP_INFLUX_DB_PASSWORD=${BROWSERUP_INFLUX_DB_PASSWORD} + - BROWSERUP_GRID_SERVICE_URL=http://${BROWSERUP_GRID_JAVA_API_HOST}:8080/grid + - BROWSERUP_IS_CLOUD=false + - BROWSERUP_REDIS_URL=redis://${BROWSERUP_REDIS_HOST}:6379/1 + - BROWSERUP_S3_MINIO_ACCESS_KEY_ID=${BROWSERUP_S3_MINIO_ACCESS_KEY_ID} + - BROWSERUP_S3_MINIO_SECRET_ACCESS_KEY=${BROWSERUP_S3_MINIO_SECRET_ACCESS_KEY} + - BROWSERUP_S3_MINIO_ARTIFACTS_BUCKET=${BROWSERUP_S3_MINIO_ARTIFACTS_BUCKET} + - BROWSERUP_S3_MINIO_HOST=${BROWSERUP_S3_MINIO_HOST} + - BROWSERUP_S3_MINIO_PORT_1=9000 + - BROWSERUP_S3_MINIO_PORT_2=9001 + - BROWSERUP_WEBCONSOLE_PROTOCOL=${BROWSERUP_WEBCONSOLE_PROTOCOL} + - BROWSERUP_PRIVATE_DNS_NAMESPACE_NAME=${BROWSERUP_PRIVATE_DNS_NAMESPACE_NAME} + - BROWSERUP_CLUSTER_PUBLIC_IP=${BROWSERUP_CLUSTER_PUBLIC_IP} + - INITIAL_API_TOKEN=${INITIAL_API_TOKEN} - RAILS_LOG_TO_STDOUT=true - RAILS_SERVE_STATIC_FILES=true - - IS_CLOUD=false - - REDIS_URL=redis://${REDIS_HOST}:6379/1 - - INITIAL_API_TOKEN=${INITIAL_API_TOKEN} - - S3_MINIO_ACCESS_KEY_ID=${S3_MINIO_ACCESS_KEY_ID} - - S3_MINIO_SECRET_ACCESS_KEY=${S3_MINIO_SECRET_ACCESS_KEY} - - S3_MINIO_ARTIFACTS_BUCKET=${S3_MINIO_ARTIFACTS_BUCKET} - - S3_MINIO_HOST=${S3_MINIO_HOST} - - S3_MINIO_PORT_1=9000 - - S3_MINIO_PORT_2=9001 - - WEBCONSOLE_PROTOCOL=${WEBCONSOLE_PROTOCOL} - - PRIVATE_DNS_NAMESPACE_NAME=${PRIVATE_DNS_NAMESPACE_NAME} - - CLUSTER_PUBLIC_IP=${CLUSTER_PUBLIC_IP} depends_on: - mysql - influxdb @@ -202,7 +202,7 @@ services: chronograf: image: chronograf:1.7.16 ports: - - "${CHRONOGRAF_PORT}:8888" + - "${BROWSERUP_CHRONOGRAF_PORT}:8888" depends_on: - influxdb - fluentbit @@ -217,11 +217,11 @@ services: volumes: - influxdb-volume:/var/lib/influxdb ports: - - "${INFLUX_DB_PORT}:8086" + - "${BROWSERUP_INFLUX_DB_PORT}:8086" environment: - INFLUXDB_DB=browserup - INFLUX_DB_USER=browserup - - INFLUX_DB_PASSWORD=${INFLUX_DB_PASSWORD} + - INFLUX_DB_PASSWORD=${BROWSERUP_INFLUX_DB_PASSWORD} - INFLUXDB_LOGGING_LEVEL=debug - INFLUXDB_DATA_MAX_SERIES_PER_DATABASE=0 - INFLUXDB_DATA_MAX_VALUES_PER_TAG=0 @@ -241,12 +241,12 @@ services: - mysql-volume:/var/lib/mysql - ./resources/init.sql:/docker-entrypoint-initdb.d/z-create-test-db.sql ports: - - "${MYSQL_PORT}:3306" + - "${BROWSERUP_MYSQL_PORT}:3306" environment: - MYSQL_RANDOM_ROOT_PASSWORD=yes - MYSQL_DATABASE=browserup_development - MYSQL_USER=browserup - - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_PASSWORD=${BROWSERUP_MYSQL_PASSWORD} depends_on: - fluentbit logging: @@ -258,7 +258,7 @@ services: container_name: browserup_redis image: redis:6.2.5 ports: - - "${REDIS_PORT}:6379" + - "${BROWSERUP_REDIS_PORT}:6379" depends_on: - fluentbit logging: @@ -272,12 +272,12 @@ services: volumes: - rabbitmq-volume:/var/lib/rabbitmq ports: - - "${RABBITMQ_PEER_DISCOVERY_PORT}:4369" - - "${RABBITMQ_QUEUE_PORT}:5672" - - "${RABBITMQ_MANAGEMENT_PORT}:15672" + - "${BROWSERUP_RABBITMQ_PEER_DISCOVERY_PORT}:4369" + - "${BROWSERUP_RABBITMQ_QUEUE_PORT}:5672" + - "${BROWSERUP_RABBITMQ_MANAGEMENT_PORT}:15672" environment: - RABBITMQ_DEFAULT_USER=browserup - - RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS} + - RABBITMQ_DEFAULT_PASS=${BROWSERUP_RABBITMQ_DEFAULT_PASS} healthcheck: test: rabbitmq-diagnostics -q ping interval: 30s @@ -298,11 +298,11 @@ services: - zookeeper-data-volume:/data - zookeeper-datalog-volume:/datalog ports: - - "${ZOOKEEPER_CLIENT_PORT}:2181" + - "${BROWSERUP_ZOOKEEPER_CLIENT_PORT}:2181" environment: - ZOO_TICK_TIME=300000 # Helpful for debugging - ZOO_CFG_EXTRA=warn - - ZOO_MAX_CLIENT_CNXNS=${ZOO_MAX_CLIENT_CNXNS} + - ZOO_MAX_CLIENT_CNXNS=${BROWSERUP_ZOO_MAX_CLIENT_CNXNS} depends_on: - fluentbit - loki @@ -317,11 +317,11 @@ services: image: quay.io/minio/minio:RELEASE.2022-01-08T03-11-54Z command: server --console-address ":9001" /data ports: - - "${S3_MINIO_PORT_1}:9000" - - "${S3_MINIO_PORT_2}:9001" + - "${BROWSERUP_S3_MINIO_PORT_1}:9000" + - "${BROWSERUP_S3_MINIO_PORT_2}:9001" environment: - MINIO_ROOT_USER: ${S3_MINIO_ACCESS_KEY_ID} - MINIO_ROOT_PASSWORD: ${S3_MINIO_SECRET_ACCESS_KEY} + MINIO_ROOT_USER: ${BROWSERUP_S3_MINIO_ACCESS_KEY_ID} + MINIO_ROOT_PASSWORD: ${BROWSERUP_S3_MINIO_SECRET_ACCESS_KEY} healthcheck: test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ] interval: 30s @@ -368,7 +368,7 @@ services: - fluentbit - prometheus ports: - - "${GRAFANA_PORT}:3000" + - "${BROWSERUP_GRAFANA_PORT}:3000" volumes: - ./resources/grafana-datasource.yaml:/etc/grafana/provisioning/datasources/grafana-datasource.yaml - ./resources/grafana-dashboards-provider.yaml:/etc/grafana/provisioning/dashboards/grafana-dashboards-provider.yaml diff --git a/lib/services/aws/aws-resources/clusterServiceStackTemplate.yaml b/lib/services/aws/aws-resources/clusterServiceStackTemplate.yaml index 7905fd50..0b6cef78 100644 --- a/lib/services/aws/aws-resources/clusterServiceStackTemplate.yaml +++ b/lib/services/aws/aws-resources/clusterServiceStackTemplate.yaml @@ -254,47 +254,47 @@ Resources: Value: !Ref AdminEmails - Name: ECS_INSTANCE_ROLE_ARN Value: !Ref EcsInstanceRoleArn - - Name: INFLUX_DB_HOST + - Name: BROWSERUP_INFLUX_DB_HOST Value: !Join ['', ['influxdb.', !Ref PrivateDnsNamespaceName]] - - Name: INFLUX_DB_PORT + - Name: BROWSERUP_INFLUX_DB_PORT Value: 8086 - - Name: INFLUX_DB_NAME + - Name: BROWSERUP_INFLUX_DB_NAME Value: browserup - - Name: INFLUX_DB_PASSWORD + - Name: BROWSERUP_INFLUX_DB_PASSWORD Value: just_testing - - Name: INFLUX_DB_USER + - Name: BROWSERUP_INFLUX_DB_USER Value: root - - Name: IS_CLOUD + - Name: BROWSERUP_IS_CLOUD Value: true - - Name: RABBITMQ_DEFAULT_PASS + - Name: BROWSERUP_RABBITMQ_DEFAULT_PASS Value: just_testing - - Name: RABBITMQ_DEFAULT_USER + - Name: BROWSERUP_RABBITMQ_DEFAULT_USER Value: browserup - - Name: RABBITMQ_QUEUE_PORT + - Name: BROWSERUP_RABBITMQ_QUEUE_PORT Value: 5672 - - Name: RABBITMQ_HOST + - Name: BROWSERUP_RABBITMQ_HOST Value: !Join ['', ['rabbitmq.', !Ref PrivateDnsNamespaceName]] - - Name: ZOOKEEPER_HOST + - Name: BROWSERUP_ZOOKEEPER_HOST Value: !Join ['', ['zookeeper.', !Ref PrivateDnsNamespaceName]] - - Name: ZOOKEEPER_CLIENT_PORT + - Name: BROWSERUP_ZOOKEEPER_CLIENT_PORT Value: 2181 - - Name: S3_MINIO_HOST + - Name: BROWSERUP_S3_MINIO_HOST Value: !Join ['', ['minio.', !Ref PrivateDnsNamespaceName]] - - Name: S3_MINIO_PORT_1 + - Name: BROWSERUP_S3_MINIO_PORT_1 Value: 9000 - - Name: S3_MINIO_PORT_2 + - Name: BROWSERUP_S3_MINIO_PORT_2 Value: 9001 - - Name: S3_MINIO_ACCESS_KEY_ID + - Name: BROWSERUP_S3_MINIO_ACCESS_KEY_ID Value: !Ref S3MinioAccessKeyID - - Name: S3_MINIO_SECRET_ACCESS_KEY + - Name: BROWSERUP_S3_MINIO_SECRET_ACCESS_KEY Value: !Ref S3MinioSecretAccessKeyID - - Name: S3_MINIO_HOST_PORT_1 + - Name: BROWSERUP_S3_MINIO_HOST_PORT_1 Value: 9000 - - Name: S3_MINIO_ARTIFACTS_BUCKET + - Name: BROWSERUP_S3_MINIO_ARTIFACTS_BUCKET Value: artifacts - Name: BROWSERUP_MINIONS_KEY_PAIR_NAME Value: !Ref MinionsKeyName - - Name: WEBCONSOLE_PROTOCOL + - Name: BROWSERUP_WEBCONSOLE_PROTOCOL Value: !Ref WebconsoleProtocol Essential: true LogConfiguration: @@ -325,43 +325,43 @@ Resources: Value: !Ref ClusterName - Name: EC2_INSTANCE_FAMILY Value: c5 - - Name: INFLUX_DB_HOST + - Name: BROWSERUP_INFLUX_DB_HOST Value: !Join ['', ['influxdb.', !Ref PrivateDnsNamespaceName]] - - Name: INFLUX_DB_PORT + - Name: BROWSERUP_INFLUX_DB_PORT Value: 8086 - - Name: INFLUX_DB_NAME + - Name: BROWSERUP_INFLUX_DB_NAME Value: browserup - - Name: INFLUX_DB_PASSWORD + - Name: BROWSERUP_INFLUX_DB_PASSWORD Value: just_testing - - Name: INFLUX_DB_USER + - Name: BROWSERUP_INFLUX_DB_USER Value: root - - Name: IS_CLOUD + - Name: BROWSERUP_IS_CLOUD Value: true - - Name: RABBITMQ_DEFAULT_PASS + - Name: BROWSERUP_RABBITMQ_DEFAULT_PASS Value: just_testing - - Name: RABBITMQ_DEFAULT_USER + - Name: BROWSERUP_RABBITMQ_DEFAULT_USER Value: browserup - - Name: RABBITMQ_QUEUE_PORT + - Name: BROWSERUP_RABBITMQ_QUEUE_PORT Value: 5672 - - Name: RABBITMQ_HOST + - Name: BROWSERUP_RABBITMQ_HOST Value: !Join ['', ['rabbitmq.', !Ref PrivateDnsNamespaceName]] - - Name: ZOOKEEPER_HOST + - Name: BROWSERUP_ZOOKEEPER_HOST Value: !Join ['', ['zookeeper.', !Ref PrivateDnsNamespaceName]] - - Name: ZOOKEEPER_CLIENT_PORT + - Name: BROWSERUP_ZOOKEEPER_CLIENT_PORT Value: 2181 - - Name: S3_MINIO_HOST + - Name: BROWSERUP_S3_MINIO_HOST Value: !Join ['', ['minio.', !Ref PrivateDnsNamespaceName]] - - Name: S3_MINIO_PORT_1 + - Name: BROWSERUP_S3_MINIO_PORT_1 Value: 9000 - - Name: S3_MINIO_PORT_2 + - Name: BROWSERUP_S3_MINIO_PORT_2 Value: 9001 - - Name: S3_MINIO_ACCESS_KEY_ID + - Name: BROWSERUP_S3_MINIO_ACCESS_KEY_ID Value: !Ref S3MinioAccessKeyID - - Name: S3_MINIO_SECRET_ACCESS_KEY + - Name: BROWSERUP_S3_MINIO_SECRET_ACCESS_KEY Value: !Ref S3MinioSecretAccessKeyID - - Name: S3_MINIO_HOST_PORT_1 + - Name: BROWSERUP_S3_MINIO_HOST_PORT_1 Value: 9000 - - Name: S3_MINIO_ARTIFACTS_BUCKET + - Name: BROWSERUP_S3_MINIO_ARTIFACTS_BUCKET Value: artifacts - Name: EXECUTION_ROLE_ARN Value: !Ref TaskDefinitionsRoleArn @@ -373,7 +373,7 @@ Resources: Value: !Ref EcsInstanceRoleArn - Name: BROWSERUP_MINIONS_KEY_PAIR_NAME Value: !Ref MinionsKeyName - - Name: USER_ARTIFACT_CACHE_PATH + - Name: BROWSERUP_USER_ARTIFACT_CACHE_PATH Value: /bu/artifactcache - Name: BROWSERUP_ALLOW_SSH_ACCESS_TO_MINION_FROM_CIDR Value: !Ref AllowSshAccessToMinionFromCidr @@ -407,9 +407,9 @@ Resources: - Image: docker.io/rabbitmq:3-management Name: rabbitmq Environment: - - Name: RABBITMQ_DEFAULT_PASS + - Name: BROWSERUP_RABBITMQ_DEFAULT_PASS Value: just_testing - - Name: RABBITMQ_DEFAULT_USER + - Name: BROWSERUP_RABBITMQ_DEFAULT_USER Value: browserup Essential: true LogConfiguration: @@ -438,7 +438,7 @@ Resources: - Image: docker.io/zookeeper:3.8.1 Name: zookeeper Environment: - - Name: ZOO_MAX_CLIENT_CNXNS + - Name: BROWSERUP_ZOO_MAX_CLIENT_CNXNS Value: 500 Essential: true LogConfiguration: @@ -504,7 +504,7 @@ Resources: Environment: - Name: MYSQL_DATABASE Value: browserup_production - - Name: MYSQL_PASSWORD + - Name: BROWSERUP_MYSQL_PASSWORD Value: just_testing - Name: MYSQL_RANDOM_ROOT_PASSWORD Value: yes @@ -629,7 +629,7 @@ Resources: Environment: - Name: DOCKER_LOGS Value: true - - Name: CLUSTER_PUBLIC_IP + - Name: BROWSERUP_CLUSTER_PUBLIC_IP Value: !Ref ClusterPublicIP - Name: INITIAL_API_TOKEN Value: !Ref InitialApiToken @@ -639,33 +639,33 @@ Resources: Value: !Ref "AWS::Region" - Name: AWS_SECRET_ACCESS_KEY Value: !Ref AwsSecretAccessKey - - Name: MYSQL_HOST + - Name: BROWSERUP_MYSQL_HOST Value: !Join ['', ['mysql.', !Ref PrivateDnsNamespaceName]] - - Name: MYSQL_PASSWORD + - Name: BROWSERUP_MYSQL_PASSWORD Value: just_testing - Name: DATABASE_URL Value: !Join [ "", ["mysql2://browserup:just_testing@mysql.", !Ref PrivateDnsNamespaceName, "/browserup_production"]] - Name: GRID_SERVICE_URL Value: !Join [ "", ["http://grid-java-api.", !Ref PrivateDnsNamespaceName, ":8080/grid"]] - - Name: INFLUX_DB_HOST + - Name: BROWSERUP_INFLUX_DB_HOST Value: !Join [ "", ["influxdb.", !Ref PrivateDnsNamespaceName]] - - Name: INFLUX_DB_PORT + - Name: BROWSERUP_INFLUX_DB_PORT Value: 8086 - - Name: INFLUX_DB_NAME + - Name: BROWSERUP_INFLUX_DB_NAME Value: browserup - - Name: INFLUX_DB_PASSWORD + - Name: BROWSERUP_INFLUX_DB_PASSWORD Value: just_testing - - Name: INFLUX_DB_USER + - Name: BROWSERUP_INFLUX_DB_USER Value: root - Name: INFLUX_SERVICE_URL Value: http://influxdb:8086 - - Name: IS_CLOUD + - Name: BROWSERUP_IS_CLOUD Value: true - Name: RAILS_ENV Value: production - Name: RAILS_LOG_TO_STDOUT Value: true - - Name: RAILS_MASTER_KEY + - Name: BROWSERUP_RAILS_MASTER_KEY Value: 312ad97c276624b8069b61b73aa13a8a - Name: RAILS_SERVE_STATIC_FILES Value: true @@ -673,23 +673,23 @@ Resources: Value: 20 - Name: REDIS_URL Value: redis://redis:6379/1 - - Name: S3_MINIO_HOST + - Name: BROWSERUP_S3_MINIO_HOST Value: !Join ['', ['minio.', !Ref PrivateDnsNamespaceName]] - - Name: S3_MINIO_PORT_1 + - Name: BROWSERUP_S3_MINIO_PORT_1 Value: 9000 - - Name: S3_MINIO_PORT_2 + - Name: BROWSERUP_S3_MINIO_PORT_2 Value: 9001 - - Name: S3_MINIO_ACCESS_KEY_ID + - Name: BROWSERUP_S3_MINIO_ACCESS_KEY_ID Value: !Ref S3MinioAccessKeyID - - Name: S3_MINIO_SECRET_ACCESS_KEY + - Name: BROWSERUP_S3_MINIO_SECRET_ACCESS_KEY Value: !Ref S3MinioSecretAccessKeyID - - Name: S3_MINIO_ARTIFACTS_BUCKET + - Name: BROWSERUP_S3_MINIO_ARTIFACTS_BUCKET Value: artifacts - - Name: WEBCONSOLE_PROTOCOL + - Name: BROWSERUP_WEBCONSOLE_PROTOCOL Value: !Ref WebconsoleProtocol - - Name: PRIVATE_DNS_NAMESPACE_NAME + - Name: BROWSERUP_PRIVATE_DNS_NAMESPACE_NAME Value: !Ref PrivateDnsNamespaceName - - Name: STANDARD_IMAGE_VERSION_TAG_OVERRIDE + - Name: BROWSERUP_STANDARD_IMAGE_VERSION_TAG_OVERRIDE Value: !Ref StandardImageVersionTag Essential: true LogConfiguration: diff --git a/lib/services/aws/aws_cluster_pilot.mjs b/lib/services/aws/aws_cluster_pilot.mjs index 8106347c..d45bc899 100644 --- a/lib/services/aws/aws_cluster_pilot.mjs +++ b/lib/services/aws/aws_cluster_pilot.mjs @@ -88,13 +88,13 @@ export class AwsClusterPilot { const clusterPublicIp = nginxInstance.PublicIpAddress; await this.createServiceStack(clusterName, clusterStackOutputs, clusterPublicIp, clusterParams, secrets); - const webconsoleUrl = `${secrets["WEBCONSOLE_PROTOCOL"]}://${clusterPublicIp}`; + const webconsoleUrl = `${secrets["BROWSERUP_WEBCONSOLE_PROTOCOL"]}://${clusterPublicIp}`; const grafanaClient = new GrafanaClient( webconsoleUrl, - secrets['GRAFANA_PORT'], - secrets['GRAFANA_USERNAME'], - secrets['GRAFANA_PASSWORD'] + secrets['BROWSERUP_GRAFANA_PORT'], + secrets['BROWSERUP_GRAFANA_USERNAME'], + secrets['BROWSERUP_GRAFANA_PASSWORD'] ); await grafanaClient.createZookeeperDashboard(); @@ -337,12 +337,12 @@ export class AwsClusterPilot { if (clusterParams.keyPairName) { sshAccessToClusterFromIp = publicIp; } - let wcPort = secrets["WEBCONSOLE_PROTOCOL"] === 'http' ? '80' : '443'; + let wcPort = secrets["BROWSERUP_WEBCONSOLE_PROTOCOL"] === 'http' ? '80' : '443'; let stackParams = { - "PrivateDnsNamespaceName": secrets['PRIVATE_DNS_NAMESPACE_NAME'], - "S3MinioIngressPort": secrets['S3_MINIO_HOST_PORT_1'], + "PrivateDnsNamespaceName": secrets['BROWSERUP_PRIVATE_DNS_NAMESPACE_NAME'], + "S3MinioIngressPort": secrets['BROWSERUP_S3_MINIO_HOST_PORT_1'], "WcIngressPort": wcPort, - "GrafanaIngressPort": secrets['GRAFANA_PORT'], + "GrafanaIngressPort": secrets['BROWSERUP_GRAFANA_PORT'], "KeyName": clusterParams.keyPairName || '', "VpcAvailabilityZones": await AwsEc2Client.availabilityZones(clusterParams.region), "EcsClusterName": clusterName, @@ -395,7 +395,7 @@ export class AwsClusterPilot { const sshAccessToMinionFromIp = this.getSshAccessToMinionFromIp(clusterParams, publicIp); const stackParams = { "AdminEmails": clusterParams.adminEmails.join(","), - "PrivateDnsNamespaceName": secrets["PRIVATE_DNS_NAMESPACE_NAME"], + "PrivateDnsNamespaceName": secrets["BROWSERUP_PRIVATE_DNS_NAMESPACE_NAME"], "PrivateNamespaceId": clusterStackOutputs.privateNamespaceId, "InstanceProfileArn": clusterStackOutputs.instanceProfileArn, "EcsInstanceRoleArn": clusterStackOutputs.ecsInstanceRoleArn, @@ -409,13 +409,13 @@ export class AwsClusterPilot { "AwsAccessKeyId": process.env.AWS_ACCESS_KEY_ID, "InitialApiToken": clusterParams.apiToken, "MinionsKeyName": clusterParams.minionsKeyPairName || "", - "S3MinioSecretAccessKeyID": secrets["S3_MINIO_SECRET_ACCESS_KEY"], - "S3MinioAccessKeyID": secrets["S3_MINIO_ACCESS_KEY_ID"], - "S3MinioIngressPort": secrets["S3_MINIO_HOST_PORT_1"], + "S3MinioSecretAccessKeyID": secrets["BROWSERUP_S3_MINIO_SECRET_ACCESS_KEY"], + "S3MinioAccessKeyID": secrets["BROWSERUP_S3_MINIO_ACCESS_KEY_ID"], + "S3MinioIngressPort": secrets["BROWSERUP_S3_MINIO_HOST_PORT_1"], "AllowSshAccessToMinionFromCidr": `${sshAccessToMinionFromIp}/32`, - "WebconsoleProtocol": secrets["WEBCONSOLE_PROTOCOL"], - "WcIngressPort": secrets["WEBCONSOLE_PROTOCOL"] === "http" ? "80" : "443", - "GrafanaIngressPort": secrets["GRAFANA_PORT"], + "WebconsoleProtocol": secrets["BROWSERUP_WEBCONSOLE_PROTOCOL"], + "WcIngressPort": secrets["BROWSERUP_WEBCONSOLE_PROTOCOL"] === "http" ? "80" : "443", + "GrafanaIngressPort": secrets["BROWSERUP_GRAFANA_PORT"], "ServicesImageTag": await this.getServicesImageTag(clusterParams), "ClusterPublicIP": clusterPublicIp, "StandardImageVersionTag": clusterParams.standardImageTag || "", diff --git a/lib/services/cluster_secrets_provider.mjs b/lib/services/cluster_secrets_provider.mjs index e3efcac2..2f91781b 100644 --- a/lib/services/cluster_secrets_provider.mjs +++ b/lib/services/cluster_secrets_provider.mjs @@ -16,7 +16,7 @@ export class ClusterSecretsProvider { }, {}); const properties = { ...baseProperties }; - properties["S3_MINIO_SECRET_ACCESS_KEY"] = ClusterSecretsProvider.friendlyToken(); + properties["BROWSERUP_S3_MINIO_SECRET_ACCESS_KEY"] = ClusterSecretsProvider.friendlyToken(); return properties; } diff --git a/lib/services/local_cluster_pilot.mjs b/lib/services/local_cluster_pilot.mjs index 38d84eae..3af67e27 100644 --- a/lib/services/local_cluster_pilot.mjs +++ b/lib/services/local_cluster_pilot.mjs @@ -17,15 +17,15 @@ export class LocalClusterPilot extends ClusterPilot { "zookeeper": LocalClusterParams.ZOOKEEPER_PORT, "rabbitmq": LocalClusterParams.RABBITMQ_PORT, "influxdb": LocalClusterParams.INFLUXDB_PORT, - "mysql": LocalClusterParams.MYSQL_PORT, - "webconsole": LocalClusterParams.WEBCONSOLE_PORT + "mysql": LocalClusterParams.BROWSERUP_MYSQL_PORT, + "webconsole": LocalClusterParams.BROWSERUP_WEBCONSOLE_PORT }; checkLocalPortsAreFree(services); } async createCluster({ clusterParams }) { const secrets = ClusterSecretsProvider.get(); - const webconsoleUrl = `${this.protocol}://localhost:${secrets["WEBCONSOLE_PORT"]}`; + const webconsoleUrl = `${this.protocol}://localhost:${secrets["BROWSERUP_WEBCONSOLE_PORT"]}`; const clusterName = ClusterNameGenerator.generateClusterName(ClusterType.LOCAL); const apiToken = clusterParams.apiToken; const clusterCredentials = new ClusterCredentials({ @@ -65,7 +65,7 @@ export class LocalClusterPilot extends ClusterPilot { } await DockerClient.dockerComposeUp(allServices, composeYmlFile, envs); - log.debug(`Logs will be available soon at: http://localhost:${secrets["GRAFANA_PORT"]}`); + log.debug(`Logs will be available soon at: http://localhost:${secrets["BROWSERUP_GRAFANA_PORT"]}`); if (!process.env.DEBUG_WEBCONSOLE) await WebConsoleClient.waitForRailsReady(webconsoleUrl); return clusterCredentials; } @@ -94,6 +94,6 @@ export class LocalClusterPilot extends ClusterPilot { } get protocol() { - return process.env.WEBCONSOLE_PROTOCOL || "http"; + return process.env.BROWSERUP_WEBCONSOLE_PROTOCOL || "http"; } } diff --git a/replace.rb b/replace.rb new file mode 100644 index 00000000..7875d495 --- /dev/null +++ b/replace.rb @@ -0,0 +1,93 @@ +#!/usr/bin/env ruby + +# Define the hash for replacements +replacements = { + "S3_MINIO_HOST" => "BROWSERUP_S3_MINIO_HOST", + "S3_MINIO_HOST_PORT_1" => "BROWSERUP_S3_MINIO_HOST_PORT_1", + "S3_MINIO_PORT_1" => "BROWSERUP_S3_MINIO_PORT_1", + "S3_MINIO_PORT_2" => "BROWSERUP_S3_MINIO_PORT_2", + "S3_MINIO_ARTIFACTS_BUCKET" => "BROWSERUP_S3_MINIO_ARTIFACTS_BUCKET", + "S3_MINIO_ACCESS_KEY_ID" => "BROWSERUP_S3_MINIO_ACCESS_KEY_ID", + "S3_MINIO_ENDPOINT" => "BROWSERUP_S3_MINIO_ENDPOINT", + "S3_MINIO_SECRET_ACCESS_KEY" => "BROWSERUP_S3_MINIO_SECRET_ACCESS_KEY", + "RABBITMQ_HOST" => "BROWSERUP_RABBITMQ_HOST", + "RABBITMQ_PEER_DISCOVERY_PORT" => "BROWSERUP_RABBITMQ_PEER_DISCOVERY_PORT", + "RABBITMQ_QUEUE_PORT" => "BROWSERUP_RABBITMQ_QUEUE_PORT", + "RABBITMQ_MANAGEMENT_PORT" => "BROWSERUP_RABBITMQ_MANAGEMENT_PORT", + "RABBITMQ_DEFAULT_PASS" => "BROWSERUP_RABBITMQ_DEFAULT_PASS", + "ZOOKEEPER_HOST" => "BROWSERUP_ZOOKEEPER_HOST", + "ZOOKEEPER_CLIENT_PORT" => "BROWSERUP_ZOOKEEPER_CLIENT_PORT", + "ZOO_MAX_CLIENT_CNXNS" => "BROWSERUP_ZOO_MAX_CLIENT_CNXNS", + "REDIS_HOST" => "BROWSERUP_REDIS_HOST", + "REDIS_PORT" => "BROWSERUP_REDIS_PORT", + "MYSQL_HOST" => "BROWSERUP_MYSQL_HOST", + "MYSQL_PORT" => "BROWSERUP_MYSQL_PORT", + "MYSQL_PASSWORD" => "BROWSERUP_MYSQL_PASSWORD", + "MYSQL_USERNAME" => "BROWSERUP_MYSQL_USERNAME", + "WEBCONSOLE_HOST" => "BROWSERUP_WEBCONSOLE_HOST", + "WEBCONSOLE_PORT" => "BROWSERUP_WEBCONSOLE_PORT", + "WEBCONSOLE_PROTOCOL" => "BROWSERUP_WEBCONSOLE_PROTOCOL", + "RAILS_MASTER_KEY" => "BROWSERUP_RAILS_MASTER_KEY", + "LOCKBOX_MASTER_KEY" => "BROWSERUP_LOCKBOX_MASTER_KEY", + "GRID_JAVA_API_HOST" => "BROWSERUP_GRID_JAVA_API_HOST", + "GRID_JAVA_API_PORT" => "BROWSERUP_GRID_JAVA_API_PORT", + "CHRONOGRAF_HOST" => "BROWSERUP_CHRONOGRAF_HOST", + "CHRONOGRAF_PORT" => "BROWSERUP_CHRONOGRAF_PORT", + "CLUSTER_PUBLIC_IP" => "BROWSERUP_CLUSTER_PUBLIC_IP", + "IS_CLOUD" => "BROWSERUP_IS_CLOUD", + "INFLUX_DB_HOST" => "BROWSERUP_INFLUX_DB_HOST", + "INFLUX_DB_PORT" => "BROWSERUP_INFLUX_DB_PORT", + "INFLUX_DB_NAME" => "BROWSERUP_INFLUX_DB_NAME", + "INFLUX_DB_USER" => "BROWSERUP_INFLUX_DB_USER", + "INFLUX_TEST_DB_HOST" => "BROWSERUP_INFLUX_TEST_DB_HOST", + "INFLUX_TEST_DB_PORT" => "BROWSERUP_INFLUX_TEST_DB_PORT", + "INFLUX_DB_PASSWORD" => "BROWSERUP_INFLUX_DB_PASSWORD", + "GRAFANA_PORT" => "BROWSERUP_GRAFANA_PORT", + "GRAFANA_USERNAME" => "BROWSERUP_GRAFANA_USERNAME", + "GRAFANA_PASSWORD" => "BROWSERUP_GRAFANA_PASSWORD", + "PRIVATE_DNS_NAMESPACE_NAME" => "BROWSERUP_PRIVATE_DNS_NAMESPACE_NAME", + "STANDARD_IMAGE_VERSION_TAG_OVERRIDE" => "BROWSERUP_STANDARD_IMAGE_VERSION_TAG_OVERRIDE", + "RABBITMQ_DEFAULT_USER" => "BROWSERUP_RABBITMQ_DEFAULT_USER", + "MINION_VUS" => "BROWSERUP_MINION_VUS", + "MINION_LOG_MAX_SIZE" => "BROWSERUP_MINION_LOG_MAX_SIZE", + "MINION_LOG_MAX_NUMBER" => "BROWSERUP_MINION_LOG_MAX_NUMBER", + "USE_LOCAL_DOCKER_CACHED_IMAGE" => "BROWSERUP_USE_LOCAL_DOCKER_CACHED_IMAGE", + "USER_ARTIFACT_CACHE_PATH" => "BROWSERUP_USER_ARTIFACT_CACHE_PATH" +} + + + +def walk(dir, &block) + $script_path ||= File.expand_path(__FILE__) + + # Walk over all files and directories under the current directory + Dir.glob('**/*') do |name| + file_path = File.expand_path(name) + puts file_path + if file_path.match(/(node|assets|jvm|binary|build|cache)/) || file_path.match(/.(kotlin_module|kapt_metadata|gif|jpg|ico|br|iml|jpeg|gz|png|ttf|tab|bin|jar|dll|exe|class|values|at)$/) + puts "SKIPPING #{file_path}" + next + end + + next if File.directory?(name) || file_path == $script_path + # Read the file content + yield name + # Write the new content back to the file + File.write(name, content) + end + +end + +walk('.') do |name| + content = File.read(name) + # Perform the replacements + replacements.each do |from, to| + # Only replace 'from' if it is not already prefixed with 'BROWSERUP_' + # srxp = "(?