1
0
mirror of https://github.com/taigrr/yq synced 2025-01-18 04:53:17 -08:00

Compare commits

...

18 Commits
v4 ... 4.0.0

Author SHA1 Message Date
Mike Farah
efb9027540 Merge branch 'v4' 2020-12-20 13:31:23 +11:00
Mike Farah
2577fe5425 Increment version 2020-12-20 13:29:12 +11:00
Shashank Veerapaneni
8846255d1c Update README.md
Fix the wget download command
2020-12-02 19:42:05 +11:00
Mike Farah
fbe53885ae Update README.md 2020-12-01 17:24:14 +11:00
Mike Farah
f42728eef7 updated issue templates 2020-11-25 22:33:50 +11:00
Mike Farah
93136ba840 updated issue templates 2020-11-25 22:32:47 +11:00
Mike Farah
5665dc7b71 updated issue templates 2020-11-25 22:31:55 +11:00
Mike Farah
9302279dd2 updated issue templates 2020-11-25 22:22:16 +11:00
Mike Farah
5972bb2f23 attempt to fix pipeline 2020-11-25 11:17:28 +11:00
Mike Farah
ec43f5e7c3 go mod tidy 2020-11-25 11:06:43 +11:00
Mike Farah
62f262147c Attempt to fix git pipeline 2020-11-20 14:00:24 +11:00
Mike Farah
0259bb44c1 Updated readme 2020-11-20 13:55:18 +11:00
bahetiamit
e07a5b6065 Adding github action on release to publish multi-arch image 2020-11-20 13:48:35 +11:00
Mike Farah
f69a81b79b Updated readme re v4 2020-11-19 22:56:13 +11:00
Mike Farah
ccb718cd0f Moved macports to community, announced v4 2020-10-20 13:58:45 +11:00
Herby Gillot
815edef86a README: add instructions for installing with MacPorts 2020-10-20 13:50:10 +11:00
Mike Farah
cd83d94b6a updating release instructions 2020-10-19 09:01:52 +11:00
Mike Farah
6afc2e9189 3.4.1 2020-10-19 08:40:59 +11:00
12 changed files with 136 additions and 19 deletions

View File

@@ -1,8 +1,8 @@
--- ---
name: Bug report name: Bug report - V3
about: Create a report to help us improve about: Create a report to help us improve
title: '' title: ''
labels: bug labels: bug, v3
assignees: '' assignees: ''
--- ---
@@ -10,11 +10,12 @@ assignees: ''
**Describe the bug** **Describe the bug**
A clear and concise description of what the bug is. A clear and concise description of what the bug is.
version of yq: Version of yq: 3.X.X
operating system: Operating system: mac/linux/windows/....
Installed via: docker/binary release/homebrew/snap/...
**Input Yaml** **Input Yaml**
Concise yaml document(s) (as simple as possible to show the bug) Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)
data1.yml: data1.yml:
```yaml ```yaml
this: should really work this: should really work

49
.github/ISSUE_TEMPLATE/bug_report_v4.md vendored Normal file
View File

@@ -0,0 +1,49 @@
---
name: Bug report - V4
about: Create a report to help us improve
title: ''
labels: bug, v4
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
Version of yq: 4.X.X
Operating system: mac/linux/windows/....
Installed via: docker/binary release/homebrew/snap/...
**Input Yaml**
Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)
data1.yml:
```yaml
this: should really work
```
data2.yml:
```yaml
but: it strangely didn't
```
**Command**
The command you ran:
```
yq eval-all 'select(fileIndex==0) | .a.b.c' data1.yml data2.yml
```
**Actual behavior**
```yaml
cat: meow
```
**Expected behavior**
```yaml
this: should really work
but: it strangely didn't
```
**Additional context**
Add any other context about the problem here.

View File

@@ -1,17 +1,21 @@
--- ---
name: Feature request name: Feature request - V4
about: Suggest an idea for this project about: Suggest an idea for this project
title: '' title: ''
labels: enhancement labels: enhancement, v4
assignees: '' assignees: ''
--- ---
**Is your feature request related to a problem? Please describe.** **Please describe your feature request.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] A clear and concise description of what the request is and what it would solve.
Ex. I wish I could use yq to [...]
Please note that V3 will no longer have any enhancements.
**Describe the solution you'd like** **Describe the solution you'd like**
If we have data1.yml like: If we have data1.yml like:
(please keep to around 10 lines )
```yaml ```yaml
country: Australia country: Australia
@@ -20,7 +24,7 @@ country: Australia
And we run a command: And we run a command:
```bash ```bash
yq predictWeather data1.yml yq eval 'predictWeatherOf(.country)'
``` ```
it could output it could output

View File

@@ -28,7 +28,4 @@ jobs:
run: | run: |
export PATH=${PATH}:`go env GOPATH`/bin export PATH=${PATH}:`go env GOPATH`/bin
scripts/devtools.sh scripts/devtools.sh
- name: Build
run: |
export PATH=${PATH}:`go env GOPATH`/bin
make local build make local build

48
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: Publish image to Dockerhub
on:
release:
types: [released]
jobs:
build:
env:
IMAGE_NAME: mikefarah/yq
runs-on: ubuntu-latest
steps:
- name: Get latest release tag
uses: oprypin/find-latest-tag@v1
with:
repository: mikefarah/yq # The repository to scan.
releases-only: true # We know that all relevant tags have a GitHub release for them.
id: yq
- name: Clone source code
uses: actions/checkout@v2
with:
ref: ${{ steps.yq.outputs.tag }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }} && docker version
- name: Build and push image
run: |
IMAGE_VERSION="$(git describe --tags --abbrev=0)"
SHORT_SHA1=$(git rev-parse --short HEAD)
PLATFORMS="linux/amd64,linux/ppc64le,linux/arm64"
echo "Building and pushing version ${IMAGE_VERSION} of image ${IMAGE_NAME}"
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
docker buildx build --platform "${PLATFORMS}" -t "${IMAGE_NAME}:${IMAGE_VERSION}" -t "${IMAGE_NAME}:latest" \
--push .

View File

@@ -12,6 +12,7 @@ The aim of the project is to be the [jq](https://github.com/stedolan/jq) or sed
### [Download the latest binary](https://github.com/mikefarah/yq/releases/latest) ### [Download the latest binary](https://github.com/mikefarah/yq/releases/latest)
### MacOS: ### MacOS:
Using [Homebrew](https://brew.sh/)
``` ```
brew install yq brew install yq
``` ```
@@ -44,13 +45,12 @@ rm /etc/myfile.tmp
Use wget to download the pre-compiled binaries: Use wget to download the pre-compiled binaries:
```bash ```bash
wget https://github.com/mikefarah/yq/releases/download/{VERSION}/{BINARY} -O /usr/bin/yq &&\ wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -O /usr/bin/yq &&\
chmod +x /usr/bin/yq chmod +x /usr/bin/yq
``` ```
For instance, VERSION=4.0.0 and BINARY=yq_linux_amd64 For instance, VERSION=4.0.0 and BINARY=yq_linux_amd64
### Run with Docker ### Run with Docker
#### Oneshot use: #### Oneshot use:
@@ -88,6 +88,14 @@ choco install yq
``` ```
Supported by @chillum (https://chocolatey.org/packages/yq) Supported by @chillum (https://chocolatey.org/packages/yq)
### Mac:
Using [MacPorts](https://www.macports.org/)
```
sudo port selfupdate
sudo port install yq
```
Supported by @herbygillot (https://ports.macports.org/maintainer/github/herbygillot)
### Alpine Linux ### Alpine Linux
- Enable edge/community repo by adding ```$MIRROR/alpine/edge/community``` to ```/etc/apk/repositories``` - Enable edge/community repo by adding ```$MIRROR/alpine/edge/community``` to ```/etc/apk/repositories```
- Update database index with ```apk update``` - Update database index with ```apk update```
@@ -161,5 +169,12 @@ yq e '.a.b | length' f1.yml f2.yml
## Upgrade from V3 ## Upgrade from V3
If you've been using v3 and want/need to upgrade, checkout the [upgrade guide](https://mikefarah.gitbook.io/yq/v/v4.x/upgrading-from-v3). If you've been using v3 and want/need to upgrade, checkout the [upgrade guide](https://mikefarah.gitbook.io/yq/v/v4.x/upgrading-from-v3).
## V4 is in development!
If you're keen - check out the alpha release [here](https://github.com/mikefarah/yq/releases/), or in docker `mikefarah/yq:4-beta1` and the docs (also in beta) [here](https://mikefarah.gitbook.io/yq/v/v4.x-alpha/).
V4 is quite different from V3 (sorry for the migration), however it will be much more similar to ```jq```, use a similar expression syntax and therefore support much more complex functionality!
For now - new features will be held off from V3 in anticipation of the V4 build. Critical fixes / issues will still be released.
## Known Issues / Missing Features ## Known Issues / Missing Features
- `yq` attempts to preserve comment positions and whitespace as much as possible, but it does not handle all scenarios (see https://github.com/go-yaml/yaml/tree/v3 for details) - `yq` attempts to preserve comment positions and whitespace as much as possible, but it does not handle all scenarios (see https://github.com/go-yaml/yaml/tree/v3 for details)

View File

@@ -11,7 +11,7 @@ var (
GitDescribe string GitDescribe string
// Version is main version number that is being run at the moment. // Version is main version number that is being run at the moment.
Version = "4.0.0-beta1" Version = "4.0.0"
// VersionPrerelease is a pre-release marker for the version. If this is "" (empty string) // VersionPrerelease is a pre-release marker for the version. If this is "" (empty string)
// then it means that it is a final release. Otherwise, this is a pre-release // then it means that it is a final release. Otherwise, this is a pre-release

1
go.sum
View File

@@ -263,6 +263,7 @@ golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

View File

@@ -4,6 +4,7 @@
- tag git with same version number - tag git with same version number
- make sure local build passes - make sure local build passes
- push tag to git - push tag to git
- 3.4.0, v3
- git push --tags - git push --tags
- make local xcompile (builds binaries for all platforms) - make local xcompile (builds binaries for all platforms)
@@ -30,7 +31,7 @@
- docker - docker
- build and push latest and new version tag - build and push latest and new version tag
- docker build . -t mikefarah/yq:latest -t mikefarah/yq:VERSION - docker build . -t mikefarah/yq:latest -t mikefarah/yq:3 -t mikefarah/yq:3.X
- debian package - debian package
- ensure you get all vendor dependencies before packaging - ensure you get all vendor dependencies before packaging

View File

@@ -3,7 +3,7 @@
set -o errexit set -o errexit
set -o pipefail set -o pipefail
./bin/golangci-lint run ./bin/golangci-lint run --timeout=5m
# ./bin/golangci-lint \ # ./bin/golangci-lint \
# --tests \ # --tests \

View File

@@ -2,3 +2,4 @@
find . \( -path ./vendor \) -prune -o -name "*.go" -exec goimports -w {} \; find . \( -path ./vendor \) -prune -o -name "*.go" -exec goimports -w {} \;
go mod tidy go mod tidy
go mod vendor

View File

@@ -1,5 +1,5 @@
name: yq name: yq
version: '4.0.0-beta1' version: '4.0.0'
summary: A lightweight and portable command-line YAML processor summary: A lightweight and portable command-line YAML processor
description: | description: |
The aim of the project is to be the jq or sed of yaml files. The aim of the project is to be the jq or sed of yaml files.