diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 13ea5ad..0000000 --- a/.travis.yml +++ /dev/null @@ -1,85 +0,0 @@ -sudo: false - -language: php - -services: - - mysql - -cache: - directories: - - "$HOME/.composer/cache/files" - -before_install: - - composer self-update - - phpenv config-add tests/travis.php.ini - -env: - global: - - COMPOSER_VALIDATE_FLAGS="--strict" - -matrix: - include: - # With ENVIRONMENT variables - - php: 7.2 - install: - # Install dependencies - - travis_retry composer update $COMPOSER_FLAGS - - composer info -i - # Create database for build test - - bin/adminconsole doctrine:database:create - env: - - APP_ENV=test - - APP_SECRET=a448d1dfcaa563fce56c2fd9981f662b - - MAILER_URL=null://localhost - - SULU_ADMIN_EMAIL= - - DATABASE_URL=mysql://root:@127.0.0.1/sulu_test - - COMPOSER_FLAGS="--no-interaction" - - # Without ENVIRONMENT variables - - php: 7.4 - install: - - composer create-project sulu/skeleton ../test-create-project-dir --repository="{\"type\":\"path\",\"url\":\"./\"}" --stability=dev -n - - cd ../test-create-project-dir - - echo 'DATABASE_URL=mysql://root:@127.0.0.1:3306/sulu' >> .env.local - - echo 'DATABASE_URL=mysql://root:@127.0.0.1:3306/sulu_test' >> .env.test.local - env: - - NPM_BUILD=true - - COMPOSER_VALIDATE_FLAGS="--strict --no-check-publish" - -script: - - pwd - - | - if [[ $NPM_BUILD = true ]]; then - nvm install 12 - cd assets/admin - npm install - npm run build - fi - - if [[ $NPM_BUILD = true ]]; then cd ../..; fi - - composer validate $COMPOSER_VALIDATE_FLAGS - # Test Build - - bin/adminconsole sulu:build dev --no-interaction - # Test container build in different environments - - bin/adminconsole cache:clear --env dev - - bin/websiteconsole cache:clear --env dev - - bin/adminconsole cache:clear --env test - - bin/websiteconsole cache:clear --env test - - bin/adminconsole cache:clear --env stage - - bin/websiteconsole cache:clear --env stage - - bin/adminconsole cache:clear --env prod - - bin/websiteconsole cache:clear --env prod - # Test container lint in different environments - - bin/adminconsole lint:container --env dev - - bin/websiteconsole lint:container --env dev - - bin/adminconsole lint:container --env test - - bin/websiteconsole lint:container --env test - - bin/adminconsole lint:container --env stage - - bin/websiteconsole lint:container --env stage - - bin/adminconsole lint:container --env prod - - bin/websiteconsole lint:container --env prod - # Lint - - bin/adminconsole doctrine:ensure-production-settings --env prod - - bin/adminconsole doctrine:schema:validate - - bin/phpunit - - bin/adminconsole lint:twig templates - - bin/adminconsole lint:yaml config diff --git a/README.md b/README.md index 5c5e6b6..0a00b77 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,20 @@ This repository demonstrates how to deploy a Sulu application to a Kubernetes cluster using the [sulu/helm-charts](https://github.com/sulu/helm-charts). -The default branch of the repository contains a clean Sulu application based on the [sulu/skeleton](https://github.com/sulu/skeleton). +The default branch of the repository contains a clean Sulu application based on the [sulu/skeleton](https://github.com/sulu/skeleton). The changes for adding the deployment are shown in the [pull request #1](https://github.com/sulu/k8s-example-deployment/pull/1). ### 1. Build your container ``` -docker build . -t eu.gcr.io/sulu-io/sulu-cluster:1.0.0 +docker build . --target project -t eu.gcr.io/sulu-io/sulu-cluster:1.0.0 docker push eu.gcr.io/sulu-io/sulu-cluster:1.0.0 ``` ### 2. Create Cluster ``` -gcloud beta container --project "sulu-io" clusters create "my-first-cluster-1" --zone "europe-west3-c" --no-enable-basic-auth --cluster-version "1.15.12-gke.2" --release-channel "stable" --machine-type "g1-small" --image-type "COS" --disk-type "pd-standard" --disk-size "32" --metadata disable-legacy-endpoints=true --scopes "https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append" --num-nodes "3" --no-enable-stackdriver-kubernetes --enable-ip-alias --network "projects/sulu-io/global/networks/default" --subnetwork "projects/sulu-io/regions/europe-west3/subnetworks/default" --default-max-pods-per-node "110" --no-enable-master-authorized-networks --addons HorizontalPodAutoscaling,HttpLoadBalancing --enable-autoupgrade --enable-autorepair --max-surge-upgrade 1 --max-unavailable-upgrade 0 +gcloud beta container --project "sulu-io" clusters create "my-first-cluster-1" --zone "europe-west3-c" --no-enable-basic-auth --cluster-version "1.19.9-gke.1900" --release-channel "regular" --machine-type "g1-small" --image-type "COS" --disk-type "pd-standard" --disk-size "32" --metadata disable-legacy-endpoints=true --scopes "https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append" --num-nodes "3" --no-enable-stackdriver-kubernetes --enable-ip-alias --network "projects/sulu-io/global/networks/default" --subnetwork "projects/sulu-io/regions/europe-west3/subnetworks/default" --default-max-pods-per-node "110" --no-enable-master-authorized-networks --addons HorizontalPodAutoscaling,HttpLoadBalancing --enable-autoupgrade --enable-autorepair --max-surge-upgrade 1 --max-unavailable-upgrade 0 ``` ### 3. Connect to cluster @@ -39,12 +39,12 @@ Configure the redis password and the google cloud credentials in the secrets fil ``` cd deploy helm dep build -helm install sulu-cluster . -f secrets.yaml +helm install sulu-cluster . -f secrets.yaml --set=sulu.app.image.tag=1.0.0 ``` ### 7. Upgrade App ``` cd deploy -helm upgrade sulu-cluster . -f secrets.yaml +helm upgrade sulu-cluster . -f secrets.yaml --set=sulu.app.image.tag=1.0.1 ```