Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
docs: update RELEASING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgon committed Apr 25, 2017
1 parent 359e53b commit 282705a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -21,3 +21,5 @@ _site
docs/build/*
!docs/build/.keep
vendor
client.pem
.chef.login
12 changes: 9 additions & 3 deletions Dockerfile
Expand Up @@ -19,13 +19,13 @@ RUN echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
RUN locale-gen
ENV LC_ALL en_US.UTF-8

ENV APP_HOME /app
RUN mkdir "$APP_HOME"

RUN curl -o /tmp/chefdk.deb https://packages.chef.io/files/stable/chefdk/1.3.43/debian/8/chefdk_1.3.43-1_amd64.deb && \
dpkg -i /tmp/chefdk.deb && \
rm -rf /tmp/chefdk.deb

ENV APP_HOME /cookbooks/opsworks_ruby
RUN mkdir -p "$APP_HOME"

RUN gem install bundler
RUN pip install yamllint>=1

Expand All @@ -36,6 +36,12 @@ COPY Berksfile* $APP_HOME/
COPY metadata.rb $APP_HOME/
COPY README.md $APP_HOME/

COPY .chef.login $APP_HOME/
RUN mkdir -p /root/.chef
RUN printf "client_key \"/cookbooks/opsworks_ruby/client.pem\"\n" >> /root/.chef/knife.rb
RUN printf "node_name \"$(cat /cookbooks/opsworks_ruby/.chef.login)\"\n" >> /root/.chef/knife.rb
RUN printf "cookbook_path \"/cookbooks\"\n" >> /root/.chef/knife.rb

RUN npm install
RUN bundle install -j 4
RUN chef exec berks
Expand Down
19 changes: 11 additions & 8 deletions RELEASING.md
Expand Up @@ -9,12 +9,15 @@
1. Bump version in `package.json`
1. Bump version in `metadata.rb`
1. Bump version in `docs/source/config.py`
1. `echo -n "<your chef login>"` > .chef.login
1. Put your chef private key associated with `opsworks_ruby` cookbook as `client.pem`
file into project directory
1. `docker-compose build`
1. `docker-compose run cookbook sh -c "conventional-changelog -s -p angular -i CHANGELOG.md"`
1. Commit all the things with `chore: Version bump`
1. Tag version
1. Push: `git push origin master --tags`
1. `knife cookbook site share opsworks_ruby Applications`
1. `docker-compose run cookbook knife cookbook site share opsworks_ruby Applications`

## Solving problems with knife

Expand All @@ -26,15 +29,15 @@ article. Short version:
```shell
$ knife cookbook site share opsworks_ruby Applications
WARNING: No knife configuration file found
ERROR: Chef::Exceptions::CookbookNotFoundInRepo: Cannot find a cookbook named dokku;
ERROR: Chef::Exceptions::CookbookNotFoundInRepo: Cannot find a cookbook named opsworks_ruby;
did you forget to add metadata to a cookbook? (http://wiki.opscode.com/display/chef/Metadata)
```

Solution:

```shell
% echo client_key \"#{ENV['HOME']}/.chef/client.pem\" >> ~/.chef/knife.rb
% cookbook_path \"#{ENV['HOME']}/Projects/cookbooks\" >> ~/.chef.knife.rb
% echo cookbook_path \"#{ENV['HOME']}/Projects/cookbooks\" >> ~/.chef/knife.rb
```

### ERROR: Errno::EACCES: Permission denied - /var/chef
Expand All @@ -50,19 +53,19 @@ Solution:
% sudo chown -R $USER /var/chef
```

### ERROR: Error uploading cookbook dokku to the Opscode Cookbook Site
### ERROR: Error uploading cookbook opsworks_ruby to the Opscode Cookbook Site

```shell
% knife cookbook site share opsworks_ruby Applications
Generating metadata for dokku from /tmp/chef-opsworks_ruby-build20161021-18021-ypq6jp/opsworks_ruby/metadata.rb
Making tarball dokku.tgz
ERROR: Error uploading cookbook dokku to the Opscode Cookbook Site:
Generating metadata for opsworks_ruby from /tmp/chef-opsworks_ruby-build20161021-18021-ypq6jp/opsworks_ruby/metadata.rb
Making tarball opsworks_ruby.tgz
ERROR: Error uploading cookbook opsworks_ruby to the Opscode Cookbook Site:
undefined method `strip' for nil:NilClass.
Set log level to debug (-l debug) for more information.`
```
Solution:
```shell
% echo node_name \"$USER\" >> ~/.chef/knife.rb
% echo node_name \"<your chef login>\" >> ~/.chef/knife.rb
```
2 changes: 1 addition & 1 deletion docker-compose.yml
Expand Up @@ -5,4 +5,4 @@ services:
cookbook:
build: .
volumes:
- ".:/app"
- ".:/cookbooks/opsworks_ruby"

0 comments on commit 282705a

Please sign in to comment.