Skip to content

Commit

Permalink
fix(stencil): upgrade modules (2024-04-02) (#54)
Browse files Browse the repository at this point in the history
This PR contains the following updates:

| Module | Change |
|--------|--------|
|
[github.com/getoutreach/devbase](https://github.com/getoutreach/devbase)
| `v2.24.0` -> `v2.26.0` |
|
[github.com/getoutreach/stencil-actions](https://github.com/getoutreach/stencil-actions)
| `v0.3.0` -> `v0.4.0` |
|
[github.com/getoutreach/stencil-base](https://github.com/getoutreach/stencil-base)
| `v0.15.0` -> `v0.15.1` |
|
[github.com/getoutreach/stencil-discovery](https://github.com/getoutreach/stencil-discovery)
| `v1.8.1` -> `v1.8.2` |
|
[github.com/getoutreach/stencil-golang](https://github.com/getoutreach/stencil-golang)
| `v1.18.0` -> `v1.21.2` |

---

### Release Notes
<details>
<summary>github.com/getoutreach/devbase</summary>
<a
href="https://github.com/getoutreach/devbase/compare/v2.24.0...v2.26.0">Changes</a>
</details>
<details>
<summary>github.com/getoutreach/stencil-actions</summary>
<a
href="https://github.com/getoutreach/stencil-actions/compare/v0.3.0...v0.4.0">Changes</a>
</details>
<details>
<summary>github.com/getoutreach/stencil-base</summary>
<a
href="https://github.com/getoutreach/stencil-base/compare/v0.15.0...v0.15.1">Changes</a>
</details>
<details>
<summary>github.com/getoutreach/stencil-discovery</summary>
<a
href="https://github.com/getoutreach/stencil-discovery/compare/v1.8.1...v1.8.2">Changes</a>
</details>
<details>
<summary>github.com/getoutreach/stencil-golang</summary>
<a
href="https://github.com/getoutreach/stencil-golang/compare/v1.18.0...v1.21.2">Changes</a>
</details>

---

This PR was generated by
[stencilbot](https://github.com/getoutreach/dtss-tools).
Feedback/Questions? Reach out to us on
[Slack](https://outreach-hq.slack.com/archives/CN9MU7GLW).

<details>
<summary>Metadata</summary>
<b>Stencil Version</b>: <code>v1.38.0</code>
</details>

Co-authored-by: getoutreach-ci-1[bot] <95656460+getoutreach-ci-1[bot]@users.noreply.github.com>
  • Loading branch information
getoutreach-ci-1[bot] authored Apr 2, 2024
1 parent 7729374 commit bcc2b81
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 45 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# syntax, such as anchors, will be fixed automatically.
version: 2.1
orbs:
shared: getoutreach/shared@2.24.0
shared: getoutreach/shared@2.26.0
queue: eddiewebb/[email protected]

parameters:
Expand All @@ -18,6 +18,7 @@ contexts: &contexts
- confluence
- circleci-credentials
- tray-webhooks
- wizcli
## <<Stencil::Block(extraContexts)>>
- docker-registry
- ghaccesstoken
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# you are reducing compatibility guarantees.
## <<Stencil::Block(toolverOverride)>>
## <</Stencil::Block>>
golang 1.22.0
nodejs 18.17.1
protoc 21.5
golang 1.21.5
# Note: Versions in this block do not override the default versions above
# but sometimes you have to declare additional versions of the same tool
# while leaving the 'default' version intact for the infra.
Expand Down
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
// Maps the go module cache on the host to the persistent volume used by devspaces.
// These should be the respective values of `go env GOMODCACHE`.
{
"from": "${env:HOME}/.asdf/installs/golang/1.21.5/packages/pkg/mod",
"to": "/home/dev/.asdf/installs/golang/1.21.5/packages/pkg/mod"
"from": "${env:HOME}/.asdf/installs/golang/1.22.0/packages/pkg/mod",
"to": "/home/dev/.asdf/installs/golang/1.22.0/packages/pkg/mod"
},
{
// Maps the standard library location on the host to the location in the devspace.
// This enables debugging standard library code.
"from": "${env:HOME}/.asdf/installs/golang/1.21.5/go/src",
"to": "/home/dev/.asdf/installs/golang/1.21.5/go/src"
"from": "${env:HOME}/.asdf/installs/golang/1.22.0/go/src",
"to": "/home/dev/.asdf/installs/golang/1.22.0/go/src"
}
]
},
Expand Down
11 changes: 5 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/getoutreach/actions

go 1.21

toolchain go1.21.5
toolchain go1.22.0

require (
github.com/bradleyfalzon/ghinstallation v1.1.1
Expand All @@ -12,7 +12,7 @@ require (
github.com/stretchr/testify v1.8.4
)

require github.com/getoutreach/gobox v1.73.2 // indirect
require github.com/getoutreach/gobox v1.89.0 // indirect

require (
github.com/davecgh/go-spew v1.1.1 // indirect
Expand All @@ -23,10 +23,9 @@ require (
github.com/gorilla/websocket v1.4.2 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/net v0.21.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Expand Down
50 changes: 33 additions & 17 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 60 additions & 10 deletions scripts/devbase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,75 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
libDir="$DIR/../.bootstrap"
lockfile="$DIR/../stencil.lock"
serviceYaml="$DIR/../service.yaml"
gojqVersion="v0.12.14"

# get_absolute_path returns the absolute path of a file
get_absolute_path() {
python="$(command -v python3 || command -v python)"
"$python" -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$1"
}

# get_field_from_yaml reads a field from a yaml file using either go-yq or python-yq
get_field_from_yaml() {
field="$1"
file="$2"
# gojq returns the path to a JIT-downloaded gojq binary.
gojq() {
set -uo pipefail

if [[ "$(yq e '.a' '-' <<<'{"a": "true"}' 2>&1)" == "true" ]]; then
# using golang version
yq e "$field" "$file"
else
# probably using python version
yq -r "$field" <"$file"
local gjDir
gjDir="${XDG_CACHE_HOME:-$HOME/.cache}/devbase/gojq"
local gojq="$gjDir/gojq-${gojqVersion}"
if [[ ! -x $gojq ]]; then
local platform arch
mkdir -p "$gjDir"
platform="$(uname -s | awk '{print tolower($0)}')"
arch="$(uname -m)"
case $arch in
x86_64)
arch=amd64
;;
aarch64)
arch=arm64
;;
esac
local basename="gojq_${gojqVersion}_${platform}_${arch}"
local ext
if [[ $platform == linux ]]; then
ext="tar.gz"
else
ext="zip"
fi
local archive="$basename.$ext"

local gojqURL="https://github.com/itchyny/gojq/releases/download/$gojqVersion/$archive"
if [[ ! -e "$gjDir/$archive" ]]; then
curl --fail --location --silent --output "$gjDir/$archive" "$gojqURL"

fi

if [[ ! -e "$gjDir/$archive" ]]; then
echo "Failed to download gojq ($gojqURL)" >&2
exit 1
fi

if [[ $ext == "zip" ]]; then
# Explanation of flags:
# quiet, junk paths/dont make directories, extract to directory
unzip -q -j -d "$gjDir" "$gjDir/$archive" "$basename/gojq"
else
tar --strip-components=1 --directory="$gjDir" --extract --file="$gjDir/$archive" "$basename/gojq"
fi
mv "$gjDir"/gojq "$gojq"
fi

echo "$gojq"

set +uo pipefail
}

# get_field_from_yaml reads a field from a yaml file via a JIT-downloaded gojq.
get_field_from_yaml() {
local field="$1"
local file="$2"

"$(gojq)" --yaml-input -r "$field" <"$file"
}

# Use the version of devbase from stencil
Expand Down
12 changes: 6 additions & 6 deletions stencil.lock
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
version: v1.37.2
version: v1.38.0
modules:
- name: github.com/getoutreach/devbase
url: https://github.com/getoutreach/devbase
version: v2.24.0
version: v2.26.0
- name: github.com/getoutreach/stencil-actions
url: https://github.com/getoutreach/stencil-actions
version: v0.3.0
version: v0.4.0
- name: github.com/getoutreach/stencil-base
url: https://github.com/getoutreach/stencil-base
version: v0.15.0
version: v0.15.1
- name: github.com/getoutreach/stencil-circleci
url: https://github.com/getoutreach/stencil-circleci
version: v1.12.0
- name: github.com/getoutreach/stencil-discovery
url: https://github.com/getoutreach/stencil-discovery
version: v1.8.1
version: v1.8.2
- name: github.com/getoutreach/stencil-golang
url: https://github.com/getoutreach/stencil-golang
version: v1.18.0
version: v1.21.2
files:
- name: .circleci/config.yml
template: .circleci/config.yml.tpl
Expand Down

0 comments on commit bcc2b81

Please sign in to comment.