Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

stash (53) Versions 5.0.0

Installs/Configures Atlassian Stash

Policyfile
Berkshelf
Knife
cookbook 'stash', '~> 5.0.0', :supermarket
cookbook 'stash', '~> 5.0.0'
knife supermarket install stash
knife supermarket download stash
README
Dependencies
Changelog
Quality 33%

chef-stash Build Status

Description

Installs/Configures Atlassian Stash / Atlassian Bitbucket server and Atlassian Stash Backup Client. Provides LWRPs for code deployment via Stash as well as for hook and repository management. Please see [COMPATIBILITY.md](COMPATIBILITY.md) for more information about Stash releases (versions and checksums) that are tested and supported by cookbook versions.

Requirements

Platforms

  • CentOS 6, 7
  • RHEL 6, 7
  • Ubuntu 12.04, 14.04

Chef

  • Version 5.X of cookbook requires Chef 13

Databases

  • HSQLDB (not recommended for production usage)
  • Microsoft SQL Server
  • MySQL
  • Postgres

Cookbooks

Required Opscode Cookbooks

Third-Party Cookbooks

Attributes

These attributes are under the node['stash'] namespace.

Attribute Description Type Default
checksum SHA256 checksum for Stash install String auto-detected (see attributes/default.rb)
home_path home data directory for Stash user String /var/atlassian/application-data/bitbucket (if upgrading from 3.x cookbook it will be /var/atlassian/application-data/stash)
install_path location to install Stash String /opt/atlassian
install_type Stash install type - "standalone" only for now String standalone
url_base URL base for Stash install String http://www.atlassian.com/software/stash/downloads/binary/atlassian-stash
url URL for Stash install String auto-detected (see attributes/default.rb)
user user to run Stash String stash
version Stash version to install String 5.9.0

Stash Backup Attributes (Shared)

These attributes are under the node['stash']['backup'] namespace. Some of these attributes are overridden by stash/stash encrypted data bag (Hosted Chef) or data bag (Chef Solo), if it exists.

Attribute Description Type Default
backup_path Path for backups String /tmp
baseurl Stash base URL String https://#{node['fqdn']}/
password Stash administrative user password String changeit
strategy Stash backup strategy: 'backup_client' or 'backup_diy' String backup_client
user Stash administrative user String admin

Stash Backup Client Attributes

Documentation: Using the Stash Backup Client

These attributes are under the node['stash']['backup_client'] namespace. Some of these attributes are overridden by stash/stash encrypted data bag (Hosted Chef) or data bag (Chef Solo), if it exists.

Attribute Description Type Default
checksum SHA256 checksum for Stash Backup Client install String auto-detected (see attributes/default.rb)
install_path location to install Stash Backup Client String /opt/atlassian/stash-backup-client
url_base URL base for Stash Backup Client install String http://downloads.atlassian.com/software/stash/downloads/stash-backup-distribution
version Stash Backup Client version to install String 3.3.4

Stash DIY Backup Attributes

Documentation: Using Stash DIY Backup

These attributes are under the node['stash']['backup_diy'] namespace. Some of these attributes are overridden by stash/stash encrypted data bag (Hosted Chef) or data bag (Chef Solo), if it exists.

Attribute Description Type Default
backup_archive_type The way how to backup the stash home String tar
backup_home_type The way how to backup the stash home String rsync
exclude_repos List of repo IDs which should be excluded from the backup List []
gpg_recipient GPG recipient name (only if ['backup_archive_type]' is 'tar-gpg') String ""
install_path location to place Stash DIY Backup scripts String /opt/atlassian/stash-diy-backup
hipchat_room HipChat room where notifications should be sent String ""
hipchat_token Authorization token for the HipChat server String ""
hipchat_url URL to the HipChat server for sending notifications String 'https://api.hipchat.com'
repo_url Git repository URL where Stash DIY Backup scripts are stored String https://bitbucket.org/atlassianlabs/atlassian-stash-diy-backup.git
revision Git revision (or a branch, or a tag) wich should be checked out String master
temp_path A temporary path where backup essentials should be placed before packing to the archive String /tmp/stash-backup-temp
verbose Should the script output be verbose or not Boolean true

Stash Backup Cron Attributes

These attributes are under the node['stash']['backup']['cron'] namespace. All of these attributes are overridden by stash/stash encrypted data bag (Hosted Chef) or data bag (Chef Solo), if it exists.

Attribute Description Type Default
enable Configure cron job to backup Stash periodically Boolean false
day Day of month String *
hour Hour of day String 0
minute Minute of hour String 0
month Month of year String *
weekday Day of week String *

Stash Database Attributes

The default database will be changing to postgresql when cookbook 4.x is released.

All of these node['stash']['database'] attributes are overridden by stash/stash encrypted data bag (Hosted Chef) or data bag (Chef Solo), if it exists

Attribute Description Type Default
host FQDN or "127.0.0.1" (127.0.0.1 automatically installs ['database']['type'] server) String 127.0.0.1
name Stash database name String stash
password Stash database user password String changeit
port Stash database port String 5432
testInterval Stash database pool idle test interval in minutes Fixnum 2
type Stash database type - "hsqldb" (not recommended), "mysql", "postgresql", or "sqlserver" String postgresql
user Stash database user String stash
query_string jdbc query string to append to the end of a JDBC url String empty

Stash JVM Attributes

These attributes are under the node['stash']['jvm'] namespace.

Attribute Description Type Default
minimum_memory JVM minimum memory String 512m
maximum_memory JVM maximum memory String 768m
maximum_permgen JVM maximum PermGen memory String 384m
java_opts additional JAVA_OPTS to be passed to Stash JVM during startup String ""
support_args additional JAVA_OPTS recommended by Atlassian support for Stash JVM during startup String ""

Stash Property Attributes

The usage of node['stash']['plugin'] for properties is deprecated in 3.x of the cookbook and may change or be removed in 4.x

All of these node['stash']['properties'] attributes are overridden by stash/stash encrypted data bag (Hosted Chef) or data bag (Chef Solo), if it exists.

Attribute Description Type Default
key A key/value pair to be inserted into stash-config.properties as key=value Hash {}

Stash SSH Attributes

These attributes are under the node['stash']['ssh'] namespace.

Attribute Description Type Default
hostname Stash SSH hostname String node['fqdn']
port Stash SSH port Fixnum 7999
uri Stash SSH URI String ssh://git@#{node['stash']['ssh']['hostname']}:#{node['stash']['ssh']['port']}

Stash Tomcat Attributes

These attributes are under the node['stash']['tomcat'] namespace.

Attribute Description Type Default
port Tomcat HTTP port Fixnum 7990

Recipes

  • recipe[stash] Installs Atlassian Stash with built-in Tomcat and Apache 2 proxy
  • recipe[stash::apache2] Installs/configures Apache 2 proxy for Stash (ports 80/443)
  • recipe[stash::backup_client] Installs/configures Atlassian Stash Backup Client
  • recipe[stash::backup_client_cron] Installs/configures Atlassian Stash Backup Client cron.d
  • recipe[stash::configuration] Configures Stash's settings
  • recipe[stash::database] Installs/configures MySQL/Postgres server, database, and user for Stash
  • recipe[stash::linux_standalone] Installs/configures Stash via Linux standalone archive
  • recipe[stash::service_init] Installs/configures Stash init service
  • recipe[stash::tomcat_configuration] Configures Stash's built-in Tomcat

LWRPs

  • stash_deploy - wrapper Git resource for using a stash_deploy_key, project, and repository for code deployment
  • stash_deploy_key - creates SSH private key file and SSH wrapper for code deployment
  • hook - Wrapper to enable/disable/configure a stash hook (requires the user account password to be in chef-vault)
  • repo - Wrapper to create/delete a stash repository (requires the user account password to be in chef-vault)

Usage

Stash Server Data Bag

For security purposes it is recommended to use data bag for storing secrets
like passwords and database credentials.

You can override any attributes from the ['stash'] namespace using the
stash/stash data bag. It could be either encrypted or not
encrypted by your choice.

Example:
json
{
"id": "stash",
"stash": {
"database": {
"type": "postgresql",
"host": "127.0.0.1",
"name": "stash",
"user": "stash",
"password": "stash_db_password",
}
}
}

(Note - "stash" nesting level is required!)

These credentials will be used for your stash installation instead of
appropriate attribute values.

Data bag's and item's names are optional and can be changed by overriding
attributes ['stash']['data_bag_name'] and ['stash']['data_bag_item']

Stash Server Default Installation

  • Optionally use (un)encrypted data bag or set attributes
    • knife data bag create stash
    • knife data bag edit stash stash --secret-file=path/to/secret
  • Add recipe[stash] to your node's run list.

Stash Backup Client Installation

  • Optionally use (un)encrypted data bag or set attributes
    • knife data bag create stash
    • knife data bag edit stash stash --secret-file=path/to/secret
  • Add recipe[stash]['backup_client'] to your node's run list.

Stash Backup Client Cron Installation

  • Optionally use (un)encrypted data bag or set attributes
    • knife data bag create stash
    • knife data bag edit stash stash --secret-file=path/to/secret
  • Add recipe[stash]['backup_client_cron'] to your node's run list.

Code Deployment From Stash

  • Ensure your node has Git installed
  • Create a stash_deploy_key with the SSH private key contents (using \n for newlines) of a Stash user with permissions to your repository.

For example:

stash_deploy_key "deployment_user" do
  key "-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIB..."
end
  • In this example, now you can either directly use the ssh_wrapper available at #{node['stash']['install_path']}/deployment_user_ssh_wrapper.sh or use the stash_deploy LWRP.

Such as:

stash_deploy "/opt/shibboleth-idp/conf" do
  deploy_key "deployment_user"
  project "SHIBIDP"
  repository "configuration"
end

Testing and Development

Here's how you can quickly get testing or developing against the cookbook thanks to Vagrant and Berkshelf.

vagrant plugin install vagrant-berkshelf
vagrant plugin install vagrant-cachier
vagrant plugin install vagrant-omnibus
git clone git://github.com/bflad/chef-stash.git
cd chef-stash
vagrant up BOX # BOX being centos5, centos6, debian7, fedora18, fedora19, fedora20, freebsd9, ubuntu1204, ubuntu1210, ubuntu1304, or ubuntu1310

You need to add the following hosts entries:

  • 192.168.50.10 stash-centos-6
  • 192.168.50.10 stash-ubuntu-1204
  • (etc.)

The running Stash server is accessible from the host machine:

CentOS 6 Box:
* Web UI: https://stash-centos-6/
* Stash SSH: ssh://git@stash-centos-6:7999/

Ubuntu 12.04 Box:
* Web UI: https://stash-ubuntu-1204/
* Stash SSH: ssh://git@stash-ubuntu-1204:7999/

You can then SSH into the running VM using the vagrant ssh BOX command.

The VM can easily be stopped and deleted with the vagrant destroy command. Please see the official Vagrant documentation for a more in depth explanation of available commands.

Test Kitchen

Please see documentation in: [TESTING.md](TESTING.md)

Contributing

Please use standard Github issues/pull requests and if possible, in combination with testing on the Vagrant boxes.

License and Contributors

Please see license information in: [LICENSE](LICENSE)

  • Brian Flad (bflad417@gmail.com)
  • Kevin Moser (@moserke)
  • Ramon Makkelie (@ramonskie)
  • Martin (@martianus)
  • Mikhail Zholobov (@legal90)
  • Claudio Rivabene (@crivabene)
  • Patrick Connolly (@patcon)
  • Benjamin Neff (@SuperTux88)
  • Anna Tikhonova (@atikhono)
  • Alex Karasik (@akarasik)
  • Andrei Skopenko (@scopenco)
  • Kate Lynn (@katbyte)
  • Lincoln Lee (@linc01n)

Change Log

5.0.0 (2018-04-01)

Full Changelog

Fixed bugs:

  • Incompatibility with Bitbucket 5 #181
  • Compatability.md is severely out of date. #164

Closed issues:

  • is this file /templates/default/web_app.conf.erb used any longer #178
  • Changes to version attribute not reflected in url or checksum. #167

Merged pull requests:

4.5.2 (2017-06-14)

Full Changelog

Implemented enhancements:

Closed issues:

  • Allow SSL from the application to the database #159

Merged pull requests:

4.5.1 (2016-06-10)

Full Changelog

Fixed bugs:

  • Code search is not working in 4.6.0 #156

Merged pull requests:

  • Prepare for 4.5.1 cookbook release #163 (linc01n)
  • Update bitbucket to 4.6.2 #162 (linc01n)
  • Run start-bitbucket.sh with the full path in Bitbucket init script #158 (atikhono)
  • Bitbucket 4.6 needs set-bitbucket-home.sh and set-bitbucket-user.sh #157 (atikhono)

4.5.0 (2016-05-14)

Full Changelog

Closed issues:

  • Support Bitbucket 4.6 #153

Merged pull requests:

  • Prepare for 4.5.0 cookbook release #155 (linc01n)
  • Update bitbucket to 4.6.0 and backup client to 3.2.0 #154 (linc01n)

4.4.0 (2016-04-25)

Full Changelog

Implemented enhancements:

Merged pull requests:

4.3.0 (2016-03-22)

Full Changelog

Fixed bugs:

  • Cannot use bitbucket backup client as the config namespace is wrong #143

Merged pull requests:

  • Prepare for 4.3.0 cookbook release #147 (linc01n)
  • Update bitbucket to 4.4.1 and backup client to 3.0.0 #146 (linc01n)
  • Go to the directory contains backup.properties #145 (linc01n)
  • Rename properties for bitbucket backup client #144 (linc01n)

4.2.0 (2016-02-14)

Full Changelog

Implemented enhancements:

Closed issues:

  • Support for Stash DIY backup - maybe? #63
  • Discussion: change default database to PostgreSQL? #49

Merged pull requests:

4.1.0 (2016-01-20)

Full Changelog

Merged pull requests:

  • Prepare for 4.1.0 cookbook release #133 (linc01n)
  • Upgrade bitbucket to 4.3.0 and backup client to 2.0.2 #132 (linc01n)

4.0.1 (2016-01-01)

Full Changelog

Merged pull requests:

4.0.0 (2015-12-06)

Full Changelog

Implemented enhancements:

  • Move pid file to /var/run #100
  • Need to upgrade the conf/web.xml for 3.10.0 #97
  • Upgrade database/mysql/postgresql dependencies as necessary #58

Fixed bugs:

  • Cannot install mysql-client 5.6 on Ubuntu 12.04 #111

Closed issues:

  • make create directory recursive #117
  • Need any new co-maintainers? #106
  • Update test-kitchen tests #96

Merged pull requests:

3.16.1 (2015-06-20)

Full Changelog

Fixed bugs:

  • umask warning when restarting (in vagrant ubuntu1404) #92

Merged pull requests:

  • Prepare for 3.16.1 cookbook release #94 (linc01n)
  • Set umask to 0027 for more secure file creation #93 (linc01n)

3.16.0 (2015-06-19)

Full Changelog

Fixed bugs:

  • Stash Crashes Due to java.lang.OutOfMemoryError PermGen Space Error #84

Closed issues:

  • Vagrant failed for Ubuntu 1404 install #86

Merged pull requests:

  • Prepare for 3.16.0 cookbook release #91 (linc01n)
  • Do a apt-get update before running package install #90 (linc01n)
  • Use proper setenv.sh format for v3.8+. #89 (patcon)
  • Fix minor rubocop style errors #88 (patcon)
  • Add support of Stash versions 3.8.1, 3.9.1, 3.9.2, 3.10.0 #87 (legal90)

3.15.0 (2015-04-22)

Full Changelog

Merged pull requests:

  • Prepare for 3.15.0 cookbook release #83 (linc01n)
  • Upgrade stash to 3.8.0 and backup client to 1.8.2 #82 (linc01n)
  • Speedup travis build #81 (linc01n)

3.14.4 (2015-03-17)

Full Changelog

Fixed bugs:

  • service stash start|restart|stop|status not working on CentOS 7 #67

Merged pull requests:

3.14.3 (2015-03-13)

Full Changelog

Merged pull requests:

3.14.2 (2015-02-12)

Full Changelog

Merged pull requests:

3.14.1 (2015-02-11)

Full Changelog

Fixed bugs:

  • Missing mysql-chef_gem cookbook #69

Merged pull requests:

3.14.0 (2015-01-24)

Full Changelog

Fixed bugs:

  • cookbook is broker because of no versionlock in metadata #55

Merged pull requests:

  • Prepare 3.14.0 release, begin documenting 4.0.0 changes #60 (bflad)
  • Split metadata supports/depends, lock mysql ~> 5.0, fixes #55 #59 (bflad)
  • Documentation surrounding properties versus now deprecated plugins #57 (bflad)
  • the ability to set all property values instead of only the plugins #46 (ramonskie)

3.13.0 (2015-01-23)

Full Changelog

Closed issues:

  • Support Stash 3.6.0 #47
  • all http auth not working when using apache (eg git clone) #42
  • 3.12.0 is not yet release to supermarket #40

Merged pull requests:

  • Prepare for 3.13.0 cookbook release #54 (bflad)
  • Rubocop fixes and ignores #53 (bflad)
  • Default to Stash 3.6.0, Stash Backup Client 1.6.0, resolves #47 #52 (bflad)
  • Convert Test Kitchen and Vagrant to Atlas boxes #51 (bflad)
  • Add Stash version default checksums for 3.1.7, 3.2.7, 3.3.3, 3.3.5, 3.4.1, 3.4.3, 3.4.5, 3.5.0, 3.5.1, and 3.6.0 #48 (bflad)
  • Fixed HTTP authentication #45 (legal90)
  • Fixes for the Stash library #44 (legal90)
  • Fix for "sh: 'rsync' no such file or directory" on RHEL-like systems #43 (legal90)
  • Upgrade Stash to 3.4.0 #41 (linc01n)

3.12.1 (2014-10-21)

Full Changelog

3.12.0 (2014-10-21)

Full Changelog

Merged pull requests:

  • Default to Stash 3.3.1 and git package for CentOS/RHEL 7 #39 (bflad)

3.11.0 (2014-10-06)

Full Changelog

Closed issues:

  • stash 3.2 directories changed #35

Merged pull requests:

  • Upgrade to Stash 3.3.0 #37 (linc01n)
  • Add unset of basic auth header in web app config #36 (ghost)

3.10.1 (2014-07-10)

Full Changelog

Merged pull requests:

3.10.0 (2014-06-26)

Full Changelog

Merged pull requests:

3.9.1 (2014-06-24)

Full Changelog

Merged pull requests:

3.9.0 (2014-05-21)

Full Changelog

3.8.3 (2014-05-21)

Full Changelog

Merged pull requests:

3.8.2 (2014-05-07)

Full Changelog

Merged pull requests:

3.8.1 (2014-04-22)

Full Changelog

Merged pull requests:

  • Update stash to 2.12.1 and backup to 1.2.1 #26 (linc01n)

3.8.0 (2014-03-26)

Full Changelog

Merged pull requests:

3.7.0 (2014-02-28)

Full Changelog

Closed issues:

  • first-time setup with database does not work #16

Merged pull requests:

3.6.0 (2014-01-03)

Full Changelog

Merged pull requests:

3.5.0 (2013-12-08)

Full Changelog

3.4.0 (2013-12-08)

Full Changelog

Merged pull requests:

3.3.0 (2013-11-24)

Full Changelog

3.2.0 (2013-11-18)

Full Changelog

3.1.2 (2013-11-18)

Full Changelog

Closed issues:

  • Random hibernate exceptions giving me the 500 page #19
  • stash.tar.gz unzip fails #17
  • Cannot find a resource matching java_ark[jdk] #15

3.1.1 (2013-11-04)

Full Changelog

Closed issues:

  • Apache2 Gets Installed Regardless #14
  • Hash diff function broken #13

3.1.0 (2013-11-03)

Full Changelog

3.0.1 (2013-10-19)

Full Changelog

3.0.0 (2013-10-12)

Full Changelog

Closed issues:

  • isn't it better to use ark for downloading stash? #9

2.21.0 (2013-10-08)

Full Changelog

Merged pull requests:

  • - Added extra settings for plugin in the stash-config.properties file #12 (xeon22)

2.20.0 (2013-10-04)

Full Changelog

Merged pull requests:

  • - Added versions and checksums for latest versions #11 (xeon22)

2.19.0 (2013-08-21)

Full Changelog

2.18.0 (2013-08-21)

Full Changelog

2.17.0 (2013-08-12)

Full Changelog

2.16.0 (2013-08-08)

Full Changelog

2.15.0 (2013-07-24)

Full Changelog

2.14.0 (2013-06-18)

Full Changelog

2.13.0 (2013-05-30)

Full Changelog

2.12.0 (2013-05-10)

Full Changelog

2.11.0 (2013-05-07)

Full Changelog

Closed issues:

  • Add LWRP for stash hooks and repositories #4

2.10.1 (2013-05-06)

Full Changelog

2.10.0 (2013-05-06)

Full Changelog

Merged pull requests:

2.9.0 (2013-05-06)

Full Changelog

2.8.0 (2013-04-22)

Full Changelog

2.7.0 (2013-04-20)

Full Changelog

2.6.1 (2013-04-08)

Full Changelog

2.6.0 (2013-03-28)

Full Changelog

2.5.0 (2013-03-19)

Full Changelog

2.4.0 (2013-02-08)

Full Changelog

2.3.1 (2013-02-07)

Full Changelog

2.3.0 (2013-02-07)

Full Changelog

2.1.8 (2013-01-16)

Full Changelog

2.1.7 (2013-01-16)

Full Changelog

2.1.6 (2012-12-23)

Full Changelog

2.1.5 (2012-12-19)

Full Changelog

2.1.4 (2012-12-19)

Full Changelog

2.1.3 (2012-12-19)

Full Changelog

2.1.2 (2012-12-19)

Full Changelog

2.1.1 (2012-12-19)

Full Changelog

2.1.0 (2012-12-18)

Full Changelog

2.0.2 (2012-11-16)

Full Changelog

2.0.1 (2012-11-06)

Full Changelog

2.0.0 (2012-11-05)

Full Changelog

Closed issues:

  • Add Minitests #1

1.0.3 (2012-11-02)

Full Changelog

1.0.2 (2012-11-02)

Full Changelog

1.0.1 (2012-10-26)

Full Changelog

1.0.0 (2012-10-11)

Full Changelog

Closed issues:

  • Upgrade recipe does not extract over installation #3

0.2.16 (2012-09-24)

Full Changelog

0.2.15 (2012-09-24)

Full Changelog

0.2.14 (2012-09-24)

Full Changelog

0.2.13 (2012-09-24)

Full Changelog

Closed issues:

  • TravisCI Integration #2

0.2.12 (2012-09-21)

Full Changelog

0.2.11 (2012-09-20)

Full Changelog

0.2.10 (2012-09-19)

Full Changelog

0.2.9 (2012-09-19)

Full Changelog

0.2.8 (2012-09-19)

Full Changelog

0.2.7 (2012-09-19)

Full Changelog

0.2.6 (2012-09-19)

Full Changelog

0.2.5 (2012-09-19)

Full Changelog

0.2.4 (2012-09-19)

Full Changelog

0.2.3 (2012-09-19)

Full Changelog

0.2.2 (2012-09-19)

Full Changelog

0.2.1 (2012-09-19)

* This Change Log was automatically generated by github_changelog_generator

Collaborator Number Metric
            

5.0.0 failed this metric

Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

5.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

5.0.0 passed this metric

No Binaries Metric
            

5.0.0 passed this metric

Testing File Metric
            

5.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

5.0.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number