This repository has been archived by the owner on Feb 25, 2024. It is now read-only.
forked from bloomberg/cobbler-cookbook
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbitbucket-pipelines.yml
77 lines (75 loc) · 3.93 KB
/
bitbucket-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# This is a sample build configuration for testing Chef cookbooks with Rubocop, the FoodCritic, and ChefSpec.
# Only use spaces to indent your .yml configuration.
# -----
image: ruby:2.5
# enable Docker for your repository
options:
docker: true
pipelines:
default:
- step:
caches:
- berkshelf
- bundler
script: # Modify the commands below to test the chef cookbook.
- set +e
- apt-get update && apt-get install -y make gcc libarchive13
- printf 'Setting up working environment\n'
- mkdir -p /chef/foodcritic && mkdir -p /root/.chef
- printf 'cookbook_path ["/chef/cookbook"]\ndata_bag_path "/chef/data_bags"\n' > /root/.chef/knife.rb
- git clone https://github.com/customink-webops/foodcritic-rules.git /chef/foodcritic/customink
- git clone https://github.com/etsy/foodcritic-rules.git /chef/foodcritic/etsy
- git clone https://github.com/sous-chefs/sc-foodcritic-rules.git /chef/foodcritic/sous-chefs
- export BUILD_DIR=$(pwd) ; export BR="${CR_BRANCH:-master}"
- printf 'Checking out the chef-repo code from %s@%s\n' "$CR_SOURCE" "$BR"
- cd /chef && git archive --remote="${CR_SOURCE}" "$BR" | tar -xf -
- ln -s $BUILD_DIR /chef/cookbook && cd /chef/cookbook
- bundle install --without development --path=${BUNDLE_PATH:-/usr/local/bundle}
- UNIT_AND_LINT=1 bundle exec rake lint spec
tags:
release-*:
- step:
caches:
- berkshelf
- bundler
script:
- set +e
- apt-get update && apt-get install -y make gcc libarchive13
- printf 'Setting up working environment\n'
- mkdir -p /chef/foodcritic && mkdir -p /root/.chef
- printf 'cookbook_path ["/chef/cookbook"]\ndata_bag_path "/chef/data_bags"\n' > /root/.chef/knife.rb
- git clone https://github.com/customink-webops/foodcritic-rules.git /chef/foodcritic/customink
- git clone https://github.com/etsy/foodcritic-rules.git /chef/foodcritic/etsy
- git clone https://github.com/sous-chefs/sc-foodcritic-rules.git /chef/foodcritic/sous-chefs
- export BUILD_DIR=$(pwd) ; export BR="${CR_BRANCH:-master}"
- printf 'Checking out the chef-repo code from %s@%s\n' "$CR_SOURCE" "$BR"
- cd /chef && git archive --remote="${CR_SOURCE}" "$BR" | tar -xf -
- ln -s $BUILD_DIR /chef/cookbook && cd /chef/cookbook
- bundle install --without development --path=${BUNDLE_PATH:-/usr/local/bundle}
- UNIT_AND_LINT=1 bundle exec rake lint spec
# TODO: Add upload to Chef server.
custom:
unit-test:
- step:
caches:
- berkshelf
- bundler
script: # Modify the commands below to test the chef cookbook.
- set +e
- apt-get update && apt-get install -y make gcc libarchive13
- printf 'Setting up working environment\n'
- mkdir -p /chef/foodcritic && mkdir -p /root/.chef
- printf 'cookbook_path ["/chef/cookbook"]\ndata_bag_path "/chef/data_bags"\n' > /root/.chef/knife.rb
- git clone https://github.com/customink-webops/foodcritic-rules.git /chef/foodcritic/customink
- git clone https://github.com/etsy/foodcritic-rules.git /chef/foodcritic/etsy
- git clone https://github.com/sous-chefs/sc-foodcritic-rules.git /chef/foodcritic/sous-chefs
- export BUILD_DIR=$(pwd) ; export BR="${CR_BRANCH:-master}"
- printf 'Checking out the chef-repo code from %s@%s\n' "$CR_SOURCE" "$BR"
- cd /chef && git archive --remote="${CR_SOURCE}" "$BR" | tar -xf -
- ln -s $BUILD_DIR /chef/cookbook && cd /chef/cookbook
- bundle install --without development --path=${BUNDLE_PATH:-/usr/local/bundle}
- UNIT_AND_LINT=1 bundle exec rake lint spec
definitions:
caches:
bundler: /usr/local/bundle
berkshelf: /root/.berkshelf