What I want to do
local --(git push origin master)--> bitbucket --> wercker --(passしたら)--> heroku
wercker is difficult to use for me
Recently, wercker is really changeable.
Free plan is wonderful! but difficult to use.
Less documents. Lots of articles of last version wercker, so difficult to find valid one in internet.
Now(15/jun/2016), wercker use docker, has workflow, pipeline system.
In build pipeline, run bundle install, set postgres, run rspec, send notification to slack. In deploy pipeline, deploy to heroku, run rake db:migrate, send noti to slack.
box: ruby build: steps: - bundle-install - rails-database-yml: service: postgresql-docker - script: name: echo ruby information code: | echo "ruby version $(ruby --version) running" echo "from location $(which ruby)" echo -p "gem list: $(gem list)" - script: name: rspec code: bundle exec rspec after-steps: # notify to Slack - wantedly/pretty-slack-notify: webhook_url: $SLACK_WEBHOOK_URL_BUILD channel: $SLACK_WEBHOOK_CHANNEL_BUILD deploy: steps: - heroku-deploy: install-toolbelt: true key: $HEROKU_KEY key-name: HEROKU_KEY_PAIR user: $HEROKU_USER app-name: $HEROKU_APP_NAME - script: name: Update database code: heroku run rake db:migrate --app $HEROKU_APP_NAME after-steps: - wantedly/pretty-slack-notify: webhook_url: $SLACK_WEBHOOK_URL_DEPLOY channel: $SLACK_WEBHOOK_CHANNEL_DEPLOY
What I took much time
What I should create
Some articles say, you should create step, but application is valid in my case.
Only build pipeline, where is deploy?
Though deploy pipeline is written in wercker.yml, only build was run in wercker default setting.
wercker has workflow system, workflow is composed by pipelines.
pipeline means build or deploy in wercker.yml.
In default setting of wercker, no deploy was set in workflow. So you should set deploy.
how to set new pipeline
tap Manage Workflow.
You land at setting page of workflow and pipeline.
Here you can add new pipeline.
New pipeline setting page.
Set name, figure pipeline name in wercker, set when to run.
(In next page, set scm noti, you can see result of CI in Github or Bitbucket)
Adding new pipeline, you can add the one to workflow.
Then flow of build to deploy is completed.
Environment Variables are unreadable
Setting variables for whole app, sometimes unreadable.
Setting var in each pipeline is better.
Could not deploy to Heroku
Trust official reference. devcenter.wercker.com
after-step is not included on screen of wercker.(Because after-step....) Not so clean. So I want to set new pipeline of it.