...
 
Commits (151)
......@@ -10,6 +10,7 @@ builder-to-testers-map:
debian-8-x86_64:
- debian-8-x86_64
- debian-9-x86_64
- debian-10-x86_64
el-6-x86_64:
- el-6-x86_64
el-7-x86_64:
......
......@@ -25,9 +25,10 @@ sleep 120
gem install $EXPEDITOR_GEM_NAME
pushd components/gems
bundle _1.17.3_ install
tries=12
for (( i=1; i<=$tries; i+=1 )); do
bundle exec rake update
bundle _1.17.3_ exec rake update
new_gem_included && break || sleep 20
if [ $i -eq $tries ]; then
echo "Searching for '${EXPEDITOR_GEM_NAME} (${EXPEDITOR_VERSION})' ${i} times and did not find it"
......
......@@ -8,5 +8,4 @@ We use GitHub issues to track bugs and feature requests. If you need help please
* Chef Community Slack at http://community-slack.chef.io/.
* Chef Mailing List https://discourse.chef.io/
Support issues opened here will be closed and redirected to Slack or Discourse.
This diff is collapsed.
......@@ -4,7 +4,7 @@ LABEL maintainer="Chef Software, Inc. <[email protected]>"
ARG EXPEDITOR_CHANNEL
ARG CHANNEL=stable
ARG EXPEDITOR_VERSION
ARG VERSION=0.15.18
ARG VERSION=0.17.5
ENV DEBIAN_FRONTEND=noninteractive \
PATH=/opt/chef-workstation/bin:/opt/chef-workstation/embedded/bin:/root/.chefdk/gem/ruby/2.6.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
......
0.16.11
\ No newline at end of file
0.17.12
\ No newline at end of file
......@@ -52,8 +52,9 @@ group(:omnibus_package) do
# gems to Rubygems now, so letting this float on latest should always give us the latest
# stable release. May have to re-pin around major version bumping time, or during patch
# fixes.
gem "chef", "= 15.8.23"
gem "chef-bin", "= 15.8.23"
gem "chef", "= 15.8.23", source: "https://packagecloud.io/cinc-project/stable"
gem "chef-bin", "= 15.8.23", source: "https://packagecloud.io/cinc-project/stable"
gem "chef-zero", source: "https://packagecloud.io/ramereth/cinc"
gem "ohai", ">= 15"
gem "cheffish", ">= 14.0.1"
......@@ -61,9 +62,10 @@ group(:omnibus_package) do
gem "chefspec", ">= 9.0.0", "< 10.0"
gem "fauxhai-ng", "~> 7.5"
# inspec #TODO revert this pin when we solve build failures
gem "inspec-bin", "~> 4.18" # the actual inspec CLI binary
gem "inspec", "~> 4.18"
# inspec
# the actual cinc-auditor CLI binary
gem "cinc-auditor-bin", "~> 4.18", source: "https://packagecloud.io/cinc-project/stable"
gem "inspec", "~> 4.18", source: "https://packagecloud.io/cinc-project/stable"
# test-kitchen and plugins
gem "test-kitchen", ">= 2.0"
......@@ -74,6 +76,7 @@ group(:omnibus_package) do
gem "kitchen-google", ">= 2.0.0"
gem "kitchen-hyperv", ">= 0.5.1"
gem "kitchen-inspec", ">= 1.0"
gem "kitchen-openstack", ">= 5.0"
gem "kitchen-vagrant", ">= 1.6"
gem "kitchen-vcenter", ">= 2.0"
......@@ -105,7 +108,7 @@ group(:omnibus_package) do
gem "mixlib-archive", ">= 1.0"
gem "net-ssh", ">= 4.2.0"
gem "listen"
gem "mixlib-install"
gem "mixlib-install", source: "https://packagecloud.io/cinc-project/stable"
gem "nokogiri"
gem "pry-byebug"
gem "pry-remote"
......
This diff is collapsed.
......@@ -24,8 +24,8 @@ task :update do
require "bundler"
Bundler.with_clean_env do
rm_f "Gemfile.lock"
sh "bundle lock --update --add-platform ruby"
sh "bundle lock --update --add-platform x64-mingw32"
sh "bundle lock --update --add-platform x86-mingw32"
sh "bundle _1.17.3_ lock --update --add-platform ruby"
sh "bundle _1.17.3_ lock --update --add-platform x64-mingw32"
sh "bundle _1.17.3_ lock --update --add-platform x86-mingw32"
end
end
......@@ -2,4 +2,7 @@ module github.com/chef/chef-workstation/components/main-chef-wrapper
go 1.13
require github.com/chef/go-libs v0.0.0-20191216182352-aa2fc405b05f
require (
github.com/chef/go-libs v0.2.0
github.com/pkg/errors v0.9.1 // indirect
)
......@@ -8,8 +8,10 @@ github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/chef/go-libs v0.0.0-20191216182352-aa2fc405b05f h1:kBujwkOBM7smuh1xCKHrUTdkZbNC0IH30zzDmTNYp8U=
github.com/chef/go-libs v0.0.0-20191216182352-aa2fc405b05f/go.mod h1:aGHwP5PXYdD0hVq+jodILnSqB/b04EhS/XCoqhE2PrA=
github.com/chef/go-libs v0.1.0 h1:ljwMsGhp0tjnsjn7g9aZSTQgjzjn+vfVZpkzJh0wmOQ=
github.com/chef/go-libs v0.1.0/go.mod h1:aGHwP5PXYdD0hVq+jodILnSqB/b04EhS/XCoqhE2PrA=
github.com/chef/go-libs v0.2.0 h1:9/YU0CFKpN8PvlVJGo8E3XfzPc+AU3lpmm/ziR54FrQ=
github.com/chef/go-libs v0.2.0/go.mod h1:aGHwP5PXYdD0hVq+jodILnSqB/b04EhS/XCoqhE2PrA=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
......@@ -65,6 +67,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
......
......@@ -15,6 +15,25 @@
// limitations under the License.
//
// An abstraction of the Chef Workstation configuration file (config.toml).
//
// Basic usage
//
// This example is loading the Chef Workstation configuration file located by default at
// $HOME/.chef-workstation/config.toml and printing the log level:
// package main
//
// import "github.com/chef/go-libs/config"
//
// func main() {
// cfg, err := config.New()
// if err != nil {
// fmt.Println("unable to read the config", err)
// }
//
// fmt.Println("the log level of my config is: ", cfg.Log.Level)
// }
//
package config
import (
......
//
// Copyright 2020 Chef Software, Inc.
// Author: Salim Afiune <[email protected]>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package config
//go:generate go run github.com/chef/go-libs/distgen global.go config
......@@ -17,33 +17,38 @@
package config
import "fmt"
//
// The intend of this file is to have a single place where we can easily
// visualize the list of all error messages that we present to users.
//
const (
UserConfigTomlNotFoundErr = `
` + DefaultChefWSUserConfigFile + ` file not found. (default: $HOME/.chef-workstation/` + DefaultChefWSUserConfigFile + `)
var (
UserConfigTomlNotFoundErr = fmt.Sprintf(`
%[1]s file not found. (default: $HOME/%[2]s/%[1]s)
setup your local configuration file by following this documentation:
- https://www.chef.sh/docs/reference/config/
`
UserConfigTomlMalformedErr = `
unable to parse ` + DefaultChefWSUserConfigFile + ` file.
`, DefaultChefWSUserConfigFile, WorkstationDir)
UserConfigTomlMalformedErr = fmt.Sprintf(`
unable to parse %s file.
verify the format of the configuration file by following this documentation:
- https://www.chef.sh/docs/reference/config/
`
AppConfigTomlNotFoundErr = `
` + DefaultChefWSAppConfigFile + ` file not found. (default: $HOME/.chef-workstation/` + DefaultChefWSAppConfigFile + `)
`, DefaultChefWSUserConfigFile)
AppConfigTomlNotFoundErr = fmt.Sprintf(`
%[1]s file not found. (default: $HOME/%[2]s/%[1]s)
verify that the %[3]s App is runnig on your local workstation.
`, DefaultChefWSUserConfigFile, WorkstationDir, WorkstationProduct)
verify that the Chef Workstation App is runnig on your local workstation.
`
AppConfigTomlMalformedErr = `
unable to parse ` + DefaultChefWSAppConfigFile + ` file.
AppConfigTomlMalformedErr = fmt.Sprintf(`
unable to parse %s file.
there must be a problem with the Chef Workstation App, verify the format of the configuration by following this documentation:
there must be a problem with the %s App, verify the format of the configuration by following this documentation:
- https://www.chef.sh/docs/reference/config/
`
`, DefaultChefWSAppConfigFile, WorkstationProduct)
)
......@@ -24,7 +24,7 @@ import (
"github.com/pkg/errors"
)
const DefaultChefDirectory = ".chef"
const DefaultChefDirectory = UserConfDir
// finds the user configuration file (default .chef-workstation/config.toml) inside the
// current directory and recursively, plus inside the $HOME directory
......
// Code generated by go generate; DO NOT EDIT.
//
// file generated at: 2020-01-28 22:30:38.4258058 +0000 UTC m=+0.403111301
// using data from: https://raw.github.com/chef/go-libs/master/distgen/glob_dist.json
// and generator: https://github.com/chef/go-libs/distgen
//
package config
const (
ApplyExec = "chef-apply"
AutomateProduct = "Chef Automate"
ClientExec = "chef-client"
ClientProduct = "Chef Infra Client"
CompanyName = "Chef Software"
DirSuffix = "chef"
DocsWebsite = "https://docs.chef.io"
MainWebsite = "https://chef.io"
ServerProduct = "Chef Infra Server"
ShellExec = "chef-shell"
SoloExec = "chef-solo"
SoloProduct = "Chef Infra Solo"
UserConfDir = ".chef"
WorkstationDir = ".chef-workstation"
WorkstationProduct = "Chef Workstation"
ZeroExec = "chef-zero"
)
......@@ -25,7 +25,7 @@ import (
)
const (
DefaultChefWorkstationDirectory = ".chef-workstation"
DefaultChefWorkstationDirectory = WorkstationDir
DefaultChefWSUserConfigFile = "config.toml"
DefaultChefWSAppConfigFile = ".app-managed-config.toml"
)
......
//
// Copyright 2020 Chef Software, Inc.
// Author: Salim Afiune <[email protected]>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package featflag
//go:generate go run github.com/chef/go-libs/distgen global.go featflag
......@@ -15,6 +15,25 @@
// limitations under the License.
//
// An abstraction to manipulate feature flags through environment variables
// and a configuration file. By default it contains global flags that can be
// used in multiple go packages.
//
// Global Feature Flag
//
// This example is using a predefined global feature flag:
// if featflag.ChefFeatAnalyze.Enabled() {
// // the analyze feature is enabled, act upon it
// }
//
// Define A Local Feature Flag
//
// This example is defining a local feature flag:
// chefFeatXYZ := featflag.New("CHEF_FEAT_XYZ", "xyz")
// if chefFeatXYZ.Enabled() {
// // the XYZ feature is enabled, act upon it
// }
//
package featflag
import (
......@@ -25,24 +44,6 @@ import (
"github.com/chef/go-libs/config"
)
// this go library is an abstraction that manipulates feature flags through
// environment variables and a configuration file, by default it contains
// global flags that can be used in multiple go packages.
//
// example 1: use a global feature flag
// ```go
// if featflag.ChefFeatAnalyze.Enabled() {
// // the analyze feature is enabled, act upon it
// }
// ```
//
// example 2: define a local feature flag
// ```go
// chefFeatXYZ := featflag.New("CHEF_FEAT_XYZ", "xyz")
// if chefFeatXYZ.Enabled() {
// // the XYZ feature is enabled, act upon it
// }
// ```
type Feature struct {
// the key associated to the feature flag defined inside the configuration file (config.toml)
//
......
// Code generated by go generate; DO NOT EDIT.
//
// file generated at: 2020-01-28 22:30:41.8092658 +0000 UTC m=+0.108647001
// using data from: https://raw.github.com/chef/go-libs/master/distgen/glob_dist.json
// and generator: https://github.com/chef/go-libs/distgen
//
package featflag
const (
ApplyExec = "chef-apply"
AutomateProduct = "Chef Automate"
ClientExec = "chef-client"
ClientProduct = "Chef Infra Client"
CompanyName = "Chef Software"
DirSuffix = "chef"
DocsWebsite = "https://docs.chef.io"
MainWebsite = "https://chef.io"
ServerProduct = "Chef Infra Server"
ShellExec = "chef-shell"
SoloExec = "chef-solo"
SoloProduct = "Chef Infra Solo"
UserConfDir = ".chef"
WorkstationDir = ".chef-workstation"
WorkstationProduct = "Chef Workstation"
ZeroExec = "chef-zero"
)
language: go
go_import_path: github.com/pkg/errors
go:
- 1.4.x
- 1.5.x
- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x
- 1.10.x
- 1.11.x
- 1.12.x
- 1.13.x
- tip
script:
- go test -v ./...
- make check
PKGS := github.com/pkg/errors
SRCDIRS := $(shell go list -f '{{.Dir}}' $(PKGS))
GO := go
check: test vet gofmt misspell unconvert staticcheck ineffassign unparam
test:
$(GO) test $(PKGS)
vet: | test
$(GO) vet $(PKGS)
staticcheck:
$(GO) get honnef.co/go/tools/cmd/staticcheck
staticcheck -checks all $(PKGS)
misspell:
$(GO) get github.com/client9/misspell/cmd/misspell
misspell \
-locale GB \
-error \
*.md *.go
unconvert:
$(GO) get github.com/mdempsky/unconvert
unconvert -v $(PKGS)
ineffassign:
$(GO) get github.com/gordonklaus/ineffassign
find $(SRCDIRS) -name '*.go' | xargs ineffassign
pedantic: check errcheck
unparam:
$(GO) get mvdan.cc/unparam
unparam ./...
errcheck:
$(GO) get github.com/kisielk/errcheck
errcheck $(PKGS)
gofmt:
@echo Checking code is gofmted
@test -z "$(shell gofmt -s -l -d -e $(SRCDIRS) | tee /dev/stderr)"
......@@ -41,11 +41,18 @@ default:
[Read the package documentation for more information](https://godoc.org/github.com/pkg/errors).
## Roadmap
With the upcoming [Go2 error proposals](https://go.googlesource.com/proposal/+/master/design/go2draft.md) this package is moving into maintenance mode. The roadmap for a 1.0 release is as follows:
- 0.9. Remove pre Go 1.9 and Go 1.10 support, address outstanding pull requests (if possible)
- 1.0. Final release.
## Contributing
We welcome pull requests, bug fixes and issue reports. With that said, the bar for adding new symbols to this package is intentionally set high.
Because of the Go2 errors changes, this package is not accepting proposals for new functionality. With that said, we welcome pull requests, bug fixes and issue reports.
Before proposing a change, please discuss your change by raising an issue.
Before sending a PR, please discuss your change by raising an issue.
## License
......
......@@ -82,7 +82,7 @@
//
// if err, ok := err.(stackTracer); ok {
// for _, f := range err.StackTrace() {
// fmt.Printf("%+s:%d", f)
// fmt.Printf("%+s:%d\n", f, f)
// }
// }
//
......@@ -159,6 +159,9 @@ type withStack struct {
func (w *withStack) Cause() error { return w.error }
// Unwrap provides compatibility for Go 1.13 error chains.
func (w *withStack) Unwrap() error { return w.error }
func (w *withStack) Format(s fmt.State, verb rune) {
switch verb {
case 'v':
......@@ -241,6 +244,9 @@ type withMessage struct {
func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() }
func (w *withMessage) Cause() error { return w.cause }
// Unwrap provides compatibility for Go 1.13 error chains.
func (w *withMessage) Unwrap() error { return w.cause }
func (w *withMessage) Format(s fmt.State, verb rune) {
switch verb {
case 'v':
......
// +build go1.13
package errors
import (
stderrors "errors"
)
// Is reports whether any error in err's chain matches target.
//
// The chain consists of err itself followed by the sequence of errors obtained by
// repeatedly calling Unwrap.
//
// An error is considered to match a target if it is equal to that target or if
// it implements a method Is(error) bool such that Is(target) returns true.
func Is(err, target error) bool { return stderrors.Is(err, target) }
// As finds the first error in err's chain that matches target, and if so, sets
// target to that error value and returns true.
//
// The chain consists of err itself followed by the sequence of errors obtained by
// repeatedly calling Unwrap.
//
// An error matches target if the error's concrete value is assignable to the value
// pointed to by target, or if the error has a method As(interface{}) bool such that
// As(target) returns true. In the latter case, the As method is responsible for
// setting target.
//
// As will panic if target is not a non-nil pointer to either a type that implements
// error, or to any interface type. As returns false if err is nil.
func As(err error, target interface{}) bool { return stderrors.As(err, target) }
// Unwrap returns the result of calling the Unwrap method on err, if err's
// type contains an Unwrap method returning error.
// Otherwise, Unwrap returns nil.
func Unwrap(err error) error {
return stderrors.Unwrap(err)
}
......@@ -5,10 +5,13 @@ import (
"io"
"path"
"runtime"
"strconv"
"strings"
)
// Frame represents a program counter inside a stack frame.
// For historical reasons if Frame is interpreted as a uintptr
// its value represents the program counter + 1.
type Frame uintptr
// pc returns the program counter for this frame;
......@@ -37,6 +40,15 @@ func (f Frame) line() int {
return line
}
// name returns the name of this function, if known.
func (f Frame) name() string {
fn := runtime.FuncForPC(f.pc())
if fn == nil {
return "unknown"
}
return fn.Name()
}
// Format formats the frame according to the fmt.Formatter interface.
//
// %s source file
......@@ -54,22 +66,16 @@ func (f Frame) Format(s fmt.State, verb rune) {
case 's':
switch {
case s.Flag('+'):
pc := f.pc()
fn := runtime.FuncForPC(pc)
if fn == nil {
io.WriteString(s, "unknown")
} else {
file, _ := fn.FileLine(pc)
fmt.Fprintf(s, "%s\n\t%s", fn.Name(), file)
}
io.WriteString(s, f.name())
io.WriteString(s, "\n\t")
io.WriteString(s, f.file())
default:
io.WriteString(s, path.Base(f.file()))
}
case 'd':
fmt.Fprintf(s, "%d", f.line())
io.WriteString(s, strconv.Itoa(f.line()))
case 'n':
name := runtime.FuncForPC(f.pc()).Name()
io.WriteString(s, funcname(name))
io.WriteString(s, funcname(f.name()))
case 'v':
f.Format(s, 's')
io.WriteString(s, ":")
......@@ -77,6 +83,16 @@ func (f Frame) Format(s fmt.State, verb rune) {
}
}
// MarshalText formats a stacktrace Frame as a text string. The output is the
// same as that of fmt.Sprintf("%+v", f), but without newlines or tabs.
func (f Frame) MarshalText() ([]byte, error) {
name := f.name()
if name == "unknown" {
return []byte(name), nil
}
return []byte(fmt.Sprintf("%s %s:%d", name, f.file(), f.line())), nil
}
// StackTrace is stack of Frames from innermost (newest) to outermost (oldest).
type StackTrace []Frame
......@@ -94,16 +110,30 @@ func (st StackTrace) Format(s fmt.State, verb rune) {
switch {
case s.Flag('+'):
for _, f := range st {
fmt.Fprintf(s, "\n%+v", f)
io.WriteString(s, "\n")
f.Format(s, verb)
}
case s.Flag('#'):
fmt.Fprintf(s, "%#v", []Frame(st))
default:
fmt.Fprintf(s, "%v", []Frame(st))
st.formatSlice(s, verb)
}
case 's':
fmt.Fprintf(s, "%s", []Frame(st))
st.formatSlice(s, verb)
}
}
// formatSlice will format this StackTrace into the given buffer as a slice of
// Frame, only valid when called with '%s' or '%v'.
func (st StackTrace) formatSlice(s fmt.State, verb rune) {
io.WriteString(s, "[")
for i, f := range st {
if i > 0 {
io.WriteString(s, " ")
}
f.Format(s, verb)
}
io.WriteString(s, "]")
}
// stack represents a stack of program counters.
......
# github.com/BurntSushi/toml v0.3.1
github.com/BurntSushi/toml
# github.com/chef/go-libs v0.0.0-20191216182352-aa2fc405b05f
# github.com/chef/go-libs v0.2.0
github.com/chef/go-libs/config
github.com/chef/go-libs/featflag
# github.com/pkg/errors v0.8.1
# github.com/pkg/errors v0.9.1
github.com/pkg/errors
This diff is collapsed.
GIT
remote: https://github.com/chef/omnibus-software.git
revision: 96e3a0b8d42d7386943dd292f0fa4d4a99b8f9db
revision: 305188638a1fa028a5674dd24b63fbccc09962c5
branch: master
specs:
omnibus-software (4.0.0)
......@@ -8,10 +8,10 @@ GIT
GIT
remote: https://github.com/chef/omnibus.git
revision: 5baaf7a1d4ee66a9273e127c7e09ce0bb3b33d90
revision: f389917504c20839ff9607df63fb2e59e2c31b52
branch: master
specs:
omnibus (7.0.2)
omnibus (7.0.7)
aws-sdk-s3 (~> 1)
chef-cleanroom (~> 1.0)
chef-sugar (>= 3.3)
......@@ -32,20 +32,20 @@ GEM
artifactory (3.0.12)
awesome_print (1.8.0)
aws-eventstream (1.0.3)
aws-partitions (1.272.0)
aws-sdk-core (3.89.1)
aws-partitions (1.287.0)
aws-sdk-core (3.92.0)
aws-eventstream (~> 1.0, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.29.0)
aws-sdk-kms (1.30.0)
aws-sdk-core (~> 3, >= 3.71.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.60.2)
aws-sdk-s3 (1.61.1)
aws-sdk-core (~> 3, >= 3.83.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.1.0)
aws-sigv4 (1.1.1)
aws-eventstream (~> 1.0, >= 1.0.2)
bcrypt_pbkdf (1.0.1)
bcrypt_pbkdf (1.0.1-x64-mingw32)
......@@ -198,7 +198,7 @@ GEM
tomlrb (~> 1.2)
tty-box (~> 0.3)
tty-prompt (~> 0.18)
license_scout (1.1.3)
license_scout (1.1.7)
ffi-yajl (~> 2.2)
mixlib-shellout (>= 2.2, < 4.0)
toml-rb (>= 1, < 3)
......@@ -215,7 +215,7 @@ GEM
mixlib-cli (2.1.5)
mixlib-config (3.0.6)
tomlrb
mixlib-install (3.11.26)
mixlib-install (3.11.28)
mixlib-shellout
mixlib-versioning
thor
......@@ -290,7 +290,7 @@ GEM
structured_warnings (0.4.0)
syslog-logger (1.6.8)
systemu (2.6.5)
test-kitchen (2.3.4)
test-kitchen (2.4.0)
bcrypt_pbkdf (~> 1.0)
ed25519 (~> 1.2)
license-acceptance (~> 1.0, >= 1.0.11)
......@@ -306,7 +306,7 @@ GEM
thor (0.20.3)
toml-rb (2.0.1)
citrus (~> 3.0, > 3.0)
tomlrb (1.2.9)
tomlrb (1.3.0)
train-core (3.2.20)
addressable (~> 2.5)
inifile (~> 3.0)
......@@ -368,7 +368,7 @@ GEM
logging (>= 1.6.1, < 3.0)
nori (~> 2.0)
rubyntlm (~> 0.6.0, >= 0.6.1)
winrm-elevated (1.2.0)
winrm-elevated (1.2.1)
erubi (~> 1.8)
winrm (~> 2.0)
winrm-fs (~> 1.0)
......
#
# Copyright 2018 Chef Software, Inc.
# Copyright 2020, Cinc Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -14,13 +15,13 @@
# limitations under the License.
#
name "chef-workstation"
friendly_name "Chef Workstation"
maintainer "Chef Software, Inc. <[email protected]>"
homepage "https://chef.sh"
name "cinc-workstation"
friendly_name "Cinc Workstation"
maintainer "Cinc Project <[email protected]>"
homepage "https://cinc.sh"
license "Chef EULA"
license_file "CHEF-EULA.md"
license "Apache-2.0"
license_file "../LICENSE"
conflict "chefdk"
......@@ -31,7 +32,7 @@ conflict "chefdk"
# fails because it can't find c:/opscode/chef-workstation/version-manifest.txt
# when the install dir is configured to c:/chef-workstation.
if windows?
install_dir "#{default_root}/opscode/#{name}"
install_dir "#{default_root}/cinc-project/#{name}"
else
install_dir "#{default_root}/#{name}"
end
......@@ -101,11 +102,14 @@ dependency "chef-analyze"
# removes the go language installed at embedded/go
dependency "go-uninstall"
# Copy Cinc wrapper for various binaries
dependency "cinc-workstation"
exclude "**/.git"
exclude "**/bundler/git"
package :rpm do
signing_passphrase ENV["OMNIBUS_RPM_SIGNING_PASSPHRASE"]
# signing_passphrase ENV["OMNIBUS_RPM_SIGNING_PASSPHRASE"]
compression_level 1
compression_type :xz
end
......@@ -116,15 +120,15 @@ package :deb do
end
package :pkg do
identifier "com.getchef.pkg.chef-workstation"
signing_identity "Chef Software, Inc. (EU3VF8YLX2)"
identifier "com.cinc-project.pkg.cinc-workstation"
# signing_identity "Chef Software, Inc. (EU3VF8YLX2)"
end
package :msi do
fast_msi true
upgrade_code "9870C512-DF2C-43D9-8C28-7ACD60ABBE27"
wix_light_extension "WixUtilExtension"
signing_identity "AF21BA8C9E50AE20DA9907B6E2D4B0CC3306CA03", machine_store: true
# signing_identity "AF21BA8C9E50AE20DA9907B6E2D4B0CC3306CA03", machine_store: true
end
# We don't support appx builds, and they eat a lot of time.
......
# Copyright:: Copyright (c) 2020 Cinc Project
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name "cinc-workstation"
source path: '../../cinc-workstation/cinc-workstation'
license :project_license
build do
copy "#{project_dir}/cinc-wrapper", "#{install_dir}/bin/"
%w(chef-apply chef-client chef-shell chef-solo inspec).each do |bin|
link "#{install_dir}/bin/cinc-wrapper", "#{install_dir}/bin/#{bin}"
end
end
......@@ -70,6 +70,18 @@ build do
env["NOKOGIRI_USE_SYSTEM_LIBRARIES"] = "true"
# Update Gemfile.lock for Cinc dependencies to allow bundle to work properly.
# The gem windows-pr is needed to properly fix the dependency.
cinc_gems =
%w(
chef
chef-bin
chef-zero
inspec
mixlib-install
)
bundle "lock --conservative --update #{cinc_gems.join(" ")} windows-pr"
# install the whole bundle first
bundle "install --jobs 10 --without #{excluded_groups.join(" ")}", env: env
......@@ -77,7 +89,7 @@ build do
appbundle "foodcritic", lockdir: project_dir, gem: "foodcritic", without: %w{development test}, env: env
appbundle "test-kitchen", lockdir: project_dir, gem: "test-kitchen", without: %w{changelog debug docs development}, env: env
appbundle "inspec", lockdir: project_dir, gem: "inspec-bin", without: %w{deploy tools maintenance integration}, env: env
appbundle "inspec", lockdir: project_dir, gem: "cinc-auditor-bin", without: %w{deploy tools maintenance integration}, env: env
appbundle "chef-run", lockdir: project_dir, gem: "chef-apply", without: %w{changelog docs debug}, env: env
appbundle "chef-cli", lockdir: project_dir, gem: "chef-cli", without: %w{changelog docs debug}, env: env
appbundle "berkshelf", lockdir: project_dir, gem: "berkshelf", without: %w{changelog docs debug development}, env: env
......
......@@ -5,7 +5,7 @@
#
PROGNAME=`basename $0`
INSTALLER_DIR=/opt/chef-workstation
INSTALLER_DIR=/opt/cinc-workstation
error_exit()
{
......@@ -25,12 +25,21 @@ else
PREFIX="/usr"
fi
binaries="chef-run berks chef chef-cli chef-analyze chef-apply chef-shell chef-solo chef-vault cookstyle delivery foodcritic inspec kitchen knife ohai push-apply pushy-client pushy-service-manager chef-client"
binaries="chef-run berks chef chef-cli chef-analyze cinc-apply cinc-shell cinc-solo chef-vault cookstyle delivery foodcritic cinc-auditor kitchen knife ohai push-apply pushy-client pushy-service-manager cinc-client"
for binary in $binaries; do
ln -sf "$INSTALLER_DIR/bin/$binary" $PREFIX/bin || error_exit "Cannot link $binary to $PREFIX/bin"
done
wrapper_links="chef-apply chef-client chef-shell chef-solo inspec"
link_target="cinc-wrapper"
for link in $wrapper_links; do
if [ ! -e $PREFIX/bin/$link ]; then
echo "Symlinking $link command to cinc-wrapper for compatibility..."
ln -sf $INSTALLER_DIR/bin/$link_target $PREFIX/bin/$link || error_exit "Cannot link $link_target to $PREFIX/bin/$link"
fi
done
if is_darwin; then
# the app launcher comes from the chef-workstation-app repo, here we are just using
# it to start the app as a service on MacOS systems, it will start at boot
......@@ -58,31 +67,31 @@ if is_darwin; then
# Restart the app if it was running.
echo "Restarting Chef Workstation App..."
$INSTALLER_DIR/bin/$app_launcher load
su "$USER" $INSTALLER_DIR/bin/$app_launcher load
else # linux - postinst does not run for windows.
cwa_app_path="$INSTALLER_DIR/components/chef-workstation-app/chef-workstation-app"
ldd "$cwa_app_path" | grep "not found" >/dev/null 2>&1
# 0 rc means grep found 'not found' text - and we have missing deps.
if [ $? -eq 0 ]; then
echo ""
echo "To run the Chef Workstation App, use your"
echo "To run the Cinc Workstation App, use your"
echo "platform's package manager to install these dependencies:"
echo ""
ldd "$cwa_app_path" | grep "not found" 2>&1
echo "You can then launch the App by running 'chef-workstation-app'."
echo "You can then launch the App by running 'cinc-workstation-app'."
echo "The App will then be available in the system tray."
else
echo ""
echo "The Chef Workstation App is available for you to try."
echo "The Cinc Workstation App is available for you to try."
echo ""
echo "Launch the App by running 'chef-workstation-app'."
echo "Launch the App by running 'cinc-workstation-app'."
echo "The App will then be available in the system tray."
fi
ln -sf $cwa_app_path $PREFIX/bin
fi
echo ""
echo "Thank you for installing Chef Workstation!"
echo "You can find some tips on getting started at https://chef.sh/"
echo "Thank you for installing Cinc Workstation!"
echo "You can find some tips on getting started at https://cinc.sh/"
echo ""
exit 0
......@@ -12,12 +12,21 @@ is_darwin()
cleanup_symlinks() {
# Keep removed symlinks in this list, so that removal of upgraded packages still cleans up
# leftovers from older versions.
workstation_binaries="berks chef chef-cli chef-apply chef-shell chef-solo chef-vault cookstyle dco delivery foodcritic inspec kitchen knife ohai push-apply pushy-client pushy-service-manager chef-client"
workstation_binaries="berks chef chef-cli cinc-apply cinc-shell cinc-solo chef-vault cookstyle dco delivery foodcritic cinc-auditor kitchen knife ohai push-apply pushy-client pushy-service-manager cinc-client"
binaries="chef-run chef-workstation-app $workstation_binaries chef-analyze"
for binary in $binaries; do
rm -f "$PREFIX/bin/$binary"
done
wrapper_links="chef-apply chef-client chef-shell chef-solo inspec"
link_target="cinc-wrapper"
for link in $wrapper_links; do
if [ -L $PREFIX/bin/$link -a "$(readlink $PREFIX/bin/$link)" = "$INSTALLER_DIR/bin/$link_target" ]; then
echo "Removing $link compatibility symlink..."
rm -f $PREFIX/bin/$link
fi
done
}
if is_darwin; then
......
......@@ -13,7 +13,7 @@
<Package InstallerVersion="200" InstallPrivileges="elevated"
Compressed="yes" InstallScope="perMachine" />
<Media Id="1" Cabinet="ChefWorkstation.cab" EmbedCab="yes" CompressionLevel="high" />
<Media Id="1" Cabinet="CincWorkstation.cab" EmbedCab="yes" CompressionLevel="high" />
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeErrorMessage)" />
<!--
......@@ -22,7 +22,7 @@
-->
<% if fastmsi %>
<SetProperty Id="FastUnzip"
Value="FASTZIPDIR=[INSTALLLOCATION];FASTZIPAPPNAME=chef-workstation"
Value="FASTZIPDIR=[INSTALLLOCATION];FASTZIPAPPNAME=cinc-workstation"
Sequence="execute"
Before="FastUnzip" />
......@@ -36,7 +36,7 @@
<Binary Id="CustomActionFastMsiDLL"
SourceFile="CustomActionFastMsi.CA.dll" />
<Property Id="WixQuietExecCmdLine" Value='"[WindowsFolder]\System32\taskkill.exe" /T /F /IM "Chef Workstation App*"' />
<Property Id="WixQuietExecCmdLine" Value='"[WindowsFolder]\System32\taskkill.exe" /T /F /IM "Cinc Workstation App*"' />
<Property Id="WixShellExecTarget" Value="[WSAPPDIR]\Chef Workstation App.exe" />
<CustomAction Id="LaunchApplication"
......@@ -52,7 +52,7 @@
<CustomAction Id="Cleanup"
Directory="INSTALLLOCATION"
ExeCommand="cmd /C &quot;rd /S /Q chef-workstation&quot;"
ExeCommand="cmd /C &quot;rd /S /Q cinc-workstation&quot;"
Execute="deferred"
Impersonate="no"
Return="ignore" />
......@@ -96,14 +96,14 @@
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="WINDOWSVOLUME">
<Directory Id="INSTALLLOCATION" Name="opscode">
<Directory Id="PROJECTLOCATION" Name="chef-workstation">
<Directory Id="PROJECTLOCATION" Name="cinc-workstation">
<Directory Id="PROJECTLOCATIONBIN" Name="bin">
<Component Id="ChefWSPath" Guid="{BC744260-FD5B-4A0F-8EE5-76283072CC09}" >
<Environment Id="Environment"
Name="PATH" Action="set" Part="last" System="yes" Value="[PROJECTLOCATIONBIN]" />
</Component>
<Component Id="ChefWSRegistryEntries" Guid="{67E30C25-5311-4584-9A17-5D47AC28F9CD}">
<RegistryKey Root="HKLM" Key="Software\Chef\Chef Workstation">
<RegistryKey Root="HKLM" Key="Software\Cinc\Cinc Workstation">
<RegistryValue Type="string" Name="InstallDir" Value="[PROJECTLOCATION]" />
<RegistryValue Type="string" Name="BinDir" Value="[PROJECTLOCATIONBIN]" />
</RegistryKey>
......@@ -150,7 +150,7 @@
</Component>
</Directory>
<Directory Id="COMPONENTS" Name="components">
<Directory Id="WSAPPDIR" Name="chef-workstation-app">
<Directory Id="WSAPPDIR" Name="cinc-workstation-app">
</Directory>
</Directory>
<Directory Id="EMBEDDED" Name="embedded" >
......@@ -165,8 +165,8 @@
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<!-- Place shortcuts grouped in a "Chef Workstation" folder in the Start menu -->
<Directory Id="ChefWorkstationFolder" Name="Chef Workstation">
<!-- Place shortcuts grouped in a "Cinc Workstation" folder in the Start menu -->
<Directory Id="CincWorkstationFolder" Name="Cinc Workstation">
<Component Id="PowershellStartMenuShortcut" Guid="{6DD3FFF3-E009-40E7-B1C2-EF606B941CCD}">
<Shortcut Id="PowershellStartMenuShortcutDef"
Name="!(loc.ChefWSPowershellShortcutDefName)"
......@@ -180,7 +180,7 @@
<Shortcut Id="ChefWSAppStartMenuShortcutDef"
Name="!(loc.ChefWSAppShortcutName)"
Description="!(loc.ChefWSAppShortcutDesc)"
Target="[WSAPPDIR]\Chef Workstation App.exe"
Target="[WSAPPDIR]\Cinc Workstation App.exe"
Icon="cws.ico"/>
</Component>
</Directory>
......@@ -192,7 +192,7 @@
<Shortcut Id="ChefAppWSAutostartShortcutDef"
Name="!(loc.ChefWSAppShortcutName)"
Description="!(loc.ChefWSAppShortcutDesc)"
Target="[WSAPPDIR]\Chef Workstation App.exe"
Target="[WSAPPDIR]\Cinc Workstation App.exe"
Icon="cws.ico"/>
</Component>
</Directory>
......@@ -212,11 +212,11 @@
<!-- Set the components defined in our fragment files that will be used for our feature -->
<!-- Renders the following install options
[x] Chef Workstation
[x] Cinc Workstation
[x] Start Menu Shortcut
[x] Desktop Shortcut
[ ] Environment Customizations
[x] Chef Workstation App
[x] Cinc Workstation App
[x] Start at login
-->
<Feature Id="ChefWSFeature" Title="!(loc.FeatureMainName)"
......@@ -259,7 +259,7 @@
<Icon Id="cws.ico" SourceFile="Resources\assets\cws.ico"/>
<Icon Id="cwsps.ico" SourceFile="Resources\assets\cwsps.ico"/>
<Property Id="ARPPRODUCTICON" Value="cws16.ico" />
<Property Id="ARPHELPLINK" Value="https://chef.sh/" />
<Property Id="ARPHELPLINK" Value="https://cinc.sh/" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.LaunchChefWSApp)" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
......
......@@ -4,9 +4,9 @@
# Expeditor takes that version, runs a script to replace it here and pushes a new
# commit / build through.
override "chef-analyze", version: "0.1.71"
override "chef-analyze", version: "0.1.79"
override "delivery-cli", version: "0.0.54"
override "chef-workstation-app", version: "v0.1.66"
override "chef-workstation-app", version: "v0.1.77"
# /DO NOT MODIFY
override :rubygems, version: "3.0.3" # rubygems ships its own bundler which may differ from bundler defined below and then we get double bundler which results in performance issues / CLI warnings. Make sure these versions match before bumping either.
......