Skip to content

Commit

Permalink
ci: Fix release script to succeed with xargs (#5620)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis authored Feb 7, 2024
1 parent 12f1b94 commit 0d63b3c
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
9 changes: 6 additions & 3 deletions hack/release/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ createNewWebsiteDirectory() {

mkdir -p "website/content/en/${RELEASE_MINOR_VERSION}"
cp -r website/content/en/preview/* "website/content/en/${RELEASE_MINOR_VERSION}/"

# Update parameterized variables in the preview documentation to be statically set in the versioned documentation
find "website/content/en/${RELEASE_MINOR_VERSION}/" -type f | xargs perl -i -p -e "s/{{< param \"latest_release_version\" >}}/${RELEASE_VERSION}/g;"
find "website/content/en/${RELEASE_MINOR_VERSION}/" -type f | xargs perl -i -p -e "s/{{< param \"latest_k8s_version\" >}}/$(yq .params.latest_k8s_version website/hugo.yaml)/g;"
find website/content/en/${RELEASE_MINOR_VERSION}/*/*/*.yaml -type f | xargs perl -i -p -e "s/preview/${RELEASE_MINOR_VERSION}/g;"
find "website/content/en/${RELEASE_MINOR_VERSION}/" -type f | xargs perl -i -p -e "s/{{< githubRelRef >}}/\/${RELEASE_VERSION}\//g;"

Expand All @@ -158,11 +161,11 @@ removeOldWebsiteDirectories() {
# preview, docs, and v0.32 are special directories that we always propagate into the set of directory options
# Keep the v0.32 version around while we are supporting v1beta1 migration
# Drop it once we no longer want to maintain the v0.32 version in the docs
last_n_versions=$(find website/content/en/* -type d -name "*" -maxdepth 0 | grep -v "preview\|docs\|v0.32" | sort | tail -n "$n")
last_n_versions=$(find website/content/en/* -maxdepth 0 -type d -name "*" | grep -v "preview\|docs\|v0.32" | sort | tail -n "$n")
last_n_versions+=$(echo -e "\nwebsite/content/en/preview")
last_n_versions+=$(echo -e "\nwebsite/content/en/docs")
last_n_versions+=$(echo -e "\nwebsite/content/en/v0.32")
all=$(find website/content/en/* -type d -name "*" -maxdepth 0)
all=$(find website/content/en/* -maxdepth 0 -type d -name "*")
## symmetric difference
comm -3 <(sort <<< $last_n_versions) <(sort <<< $all) | tr -d '\t' | xargs -r -n 1 rm -r
}
Expand All @@ -176,7 +179,7 @@ editWebsiteConfig() {
# without increasing the size of the set.
# It uses the current version directories (ignoring the docs directory) to generate this list
editWebsiteVersionsMenu() {
VERSIONS=($(find website/content/en/* -type d -name "*" -maxdepth 0 | xargs basename | grep -v "docs\|preview"))
VERSIONS=($(find website/content/en/* -maxdepth 0 -type d -name "*" | xargs -r -n 1 basename | grep -v "docs\|preview"))
VERSIONS+=('preview')

yq -i '.params.versions = []' website/hugo.yaml
Expand Down
4 changes: 2 additions & 2 deletions website/content/en/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ Yes, see the [KubeletConfiguration Section in the NodePool docs]({{<ref "./conce
The difference between the Core and Full variants is that Core is a minimal OS with less components and no graphic user interface (GUI) or desktop experience.
`Windows2019` and `Windows2022` AMI families use the Windows Server Core option for simplicity, but if required, you can specify a custom AMI to run Windows Server Full.

You can specify the [Amazon EKS optimized AMI](https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-windows-ami.html) with Windows Server 2022 Full for Kubernetes {{< param "latest_k8s_version" >}} by configuring an `amiSelector` that references the AMI name.
You can specify the [Amazon EKS optimized AMI](https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-windows-ami.html) with Windows Server 2022 Full for Kubernetes 1.29 by configuring an `amiSelector` that references the AMI name.
```yaml
amiSelectorTerms:
- name: Windows_Server-2022-English-Full-EKS_Optimized-{{< param "latest_k8s_version" >}}*
- name: Windows_Server-2022-English-Full-EKS_Optimized-1.29*
```
### Can I use Karpenter to scale my workload's pods?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ After setting up the tools, set the Karpenter and Kubernetes version:
```bash
export KARPENTER_NAMESPACE=kube-system
export KARPENTER_VERSION=v0.34.0
export K8S_VERSION={{< param "latest_k8s_version" >}}
export K8S_VERSION=1.29
```

Then set the following environment variable:
Expand Down
4 changes: 2 additions & 2 deletions website/content/en/v0.32/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ Yes, see the [KubeletConfiguration Section in the NodePool docs]({{<ref "./conce
The difference between the Core and Full variants is that Core is a minimal OS with less components and no graphic user interface (GUI) or desktop experience.
`Windows2019` and `Windows2022` AMI families use the Windows Server Core option for simplicity, but if required, you can specify a custom AMI to run Windows Server Full.

You can specify the [Amazon EKS optimized AMI](https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-windows-ami.html) with Windows Server 2022 Full for Kubernetes {{< param "latest_k8s_version" >}} by configuring an `amiSelector` that references the AMI name.
You can specify the [Amazon EKS optimized AMI](https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-windows-ami.html) with Windows Server 2022 Full for Kubernetes 1.28 by configuring an `amiSelector` that references the AMI name.
```yaml
amiSelectorTerms:
- name: Windows_Server-2022-English-Full-EKS_Optimized-{{< param "latest_k8s_version" >}}*
- name: Windows_Server-2022-English-Full-EKS_Optimized-1.28*
```
## Deprovisioning
Expand Down
4 changes: 2 additions & 2 deletions website/content/en/v0.33/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ Yes, see the [KubeletConfiguration Section in the NodePool docs]({{<ref "./conce
The difference between the Core and Full variants is that Core is a minimal OS with less components and no graphic user interface (GUI) or desktop experience.
`Windows2019` and `Windows2022` AMI families use the Windows Server Core option for simplicity, but if required, you can specify a custom AMI to run Windows Server Full.

You can specify the [Amazon EKS optimized AMI](https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-windows-ami.html) with Windows Server 2022 Full for Kubernetes {{< param "latest_k8s_version" >}} by configuring an `amiSelector` that references the AMI name.
You can specify the [Amazon EKS optimized AMI](https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-windows-ami.html) with Windows Server 2022 Full for Kubernetes 1.28 by configuring an `amiSelector` that references the AMI name.
```yaml
amiSelectorTerms:
- name: Windows_Server-2022-English-Full-EKS_Optimized-{{< param "latest_k8s_version" >}}*
- name: Windows_Server-2022-English-Full-EKS_Optimized-1.28*
```
### Can I use Karpenter to scale my workload's pods?
Expand Down
4 changes: 2 additions & 2 deletions website/content/en/v0.34/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ Yes, see the [KubeletConfiguration Section in the NodePool docs]({{<ref "./conce
The difference between the Core and Full variants is that Core is a minimal OS with less components and no graphic user interface (GUI) or desktop experience.
`Windows2019` and `Windows2022` AMI families use the Windows Server Core option for simplicity, but if required, you can specify a custom AMI to run Windows Server Full.

You can specify the [Amazon EKS optimized AMI](https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-windows-ami.html) with Windows Server 2022 Full for Kubernetes {{< param "latest_k8s_version" >}} by configuring an `amiSelector` that references the AMI name.
You can specify the [Amazon EKS optimized AMI](https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-windows-ami.html) with Windows Server 2022 Full for Kubernetes 1.29 by configuring an `amiSelector` that references the AMI name.
```yaml
amiSelectorTerms:
- name: Windows_Server-2022-English-Full-EKS_Optimized-{{< param "latest_k8s_version" >}}*
- name: Windows_Server-2022-English-Full-EKS_Optimized-1.29*
```
### Can I use Karpenter to scale my workload's pods?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ After setting up the tools, set the Karpenter and Kubernetes version:
```bash
export KARPENTER_NAMESPACE=kube-system
export KARPENTER_VERSION=v0.34.0
export K8S_VERSION={{< param "latest_k8s_version" >}}
export K8S_VERSION=1.29
```

Then set the following environment variable:
Expand Down

0 comments on commit 0d63b3c

Please sign in to comment.