https://www.youtube.com/watch?v=O6p7g59Ccj8
cat ~/.ssh/id_rsa.pub | ssh root@DOKKU_DOMAIN dokku ssh-keys:add KEY_NAME
A base app is needed for the review app to be cloned from.
For details see http://dokku.viewdocs.io/dokku/deployment/application-deployment/
dokku apps:create ruby-rails-sample
dokku postgres:create rails-database dokku postgres:link rails-database ruby-rails-sample
cd ruby-rails-sample git remote add dokku dokku@dokku.me:ruby-rails-sample # Add remote git push dokku master # Push master branch to remote
dokku apps:report
dokku ps:rebuild ruby-rails-sample
dokku domains:report
dokku proxy:report
ssh -t dokku@$DOKKU_SERVER -- --force apps:destroy "$APP_NAME"
@see https://github.com/dokku/dokku-mariadb#commands
dokku mariadb:import composer-gitlab-update-gui-database < ./c1cgu.sql
dokku config:export --format shell composer-gitlab-update-gui dokku config:set composer-gitlab-update-gui FLOW_CONTEXT=Production/Dokku
dokku config:set –global DOKKU_PROXY_PORT_MAP=http:81:5000
web: bundle exec puma -C config/puma.rb
https://github.com/heroku/heroku-buildpack-nodejs.git#v131 https://github.com/heroku/heroku-buildpack-php.git#v145
composer.json
: { "require": { "php": "~5.6.0", "ext-gd": "*", "ext-xsl": "*" } }
package.json
: { ... "engines": { "node": "10.12.0", "yarn": "1.12.1", "npm": "6.4.1" }, ... }
stages: - deploy variables: APP_NAME: ruby-rails-sample DOKKU_SERVER: dokku.knallimall.org DOKKU_SSH_PORT: 22 deploy: image: ilyasemenov/gitlab-ci-git-push stage: deploy environment: name: production url: https://$APP_NAME.$DOKKU_SERVER/ only: - master script: - git-push ssh://dokku@$DOKKU_SERVER:$DOKKU_SSH_PORT/$APP_NAME review_app: image: ilyasemenov/gitlab-ci-git-push stage: deploy environment: name: review-$CI_COMMIT_REF_NAME url: https://$CI_COMMIT_REF_NAME.$DOKKU_SERVER/ on_stop: stop_review_app # Destroy app when branch is deleted @see https://docs.gitlab.com/ee/ci/yaml/#environmenton_stop only: - branches except: - master script: - mkdir -p ~/.ssh && echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa - ssh-keyscan -H $DOKKU_SSH_PORT "$DOKKU_SERVER" >> ~/.ssh/known_hosts - ssh -t dokku@$DOKKU_SERVER -- apps:clone --ignore-existing --skip-deploy "$APP_NAME" "$CI_COMMIT_REF_NAME" - git-push ssh://dokku@$DOKKU_SERVER:$DOKKU_SSH_PORT/$CI_COMMIT_REF_NAME stop_review_app: image: ilyasemenov/gitlab-ci-git-push stage: deploy environment: name: review-$CI_COMMIT_REF_NAME action: stop when: manual script: - mkdir -p ~/.ssh && echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa - ssh-keyscan -H $DOKKU_SSH_PORT "$DOKKU_SERVER" >> ~/.ssh/known_hosts - ssh -t dokku@$DOKKU_SERVER -- --force apps:destroy "$CI_COMMIT_REF_NAME"