Skip to content

Commit a081387

Browse files
committed
replace texplate with ytt
as texplate is archived and has not been updated since 2018. and currently has some golang lib issues. darccio/mergo#240
1 parent dd66140 commit a081387

File tree

4 files changed

+28
-18
lines changed

4 files changed

+28
-18
lines changed

ci/dockerfiles/deployment/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,17 @@ RUN curl -s https://api.github.com/repos/cloudfoundry/credhub-cli/releases/lates
7878
mv credhub-* /usr/local/bin/credhub && \
7979
chmod +x /usr/local/bin/credhub
8080

81-
RUN go install github.com/pivotal-cf/texplate@latest
82-
8381
# Install yq
8482
RUN wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && \
8583
chmod +x /usr/bin/yq
8684

85+
# Install ytt
86+
RUN curl -s https://api.github.com/repos/carvel-dev/ytt/releases/latest | \
87+
jq -r '.assets[] | .browser_download_url | select(contains("linux-amd64"))' | \
88+
xargs wget && \
89+
mv ytt-* /usr/local/bin/ytt && \
90+
chmod +x /usr/local/bin/ytt
91+
8792
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
8893
unzip awscliv2.zip && ./aws/install
8994

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
2-
target: {{ env "TARGET" }}
3-
client: {{ env "CLIENT" }}
4-
client_secret: {{ env "CLIENT_SECRET" }}
5-
ca_cert: {{ toJson (env "CA_CERT") }}
6-
jumpbox_url: {{ env "JUMPBOX_URL" }}:22
7-
jumpbox_ssh_key: {{ toJson (env "JUMPBOX_SSH_KEY") }}
2+
#@ load("@ytt:data", "data")
3+
target: #@ data.values.TARGET
4+
client: #@ data.values.CLIENT
5+
client_secret: #@ data.values.CLIENT_SECRET
6+
ca_cert: #@ data.values.CA_CERT
7+
jumpbox_url: #@ data.values.JUMPBOX_URL + ":22"
8+
jumpbox_ssh_key: #@ data.values.JUMPBOX_SSH_KEY

ci/tasks/create-bosh-deployment-source-file/task

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ function main() {
77
source_file="${ROOT}/source-file/bosh-source.json"
88

99
pushd "${ROOT}/bbl-states/${BBL_STATE_DIR}" > /dev/null
10-
export TARGET="$(bbl director-address)"
11-
export CLIENT="$(bbl director-username)"
12-
export CLIENT_SECRET="$(bbl director-password)"
13-
export CA_CERT="$(bbl director-ca-cert)"
14-
export JUMPBOX_URL="$(bbl jumpbox-address)"
15-
export JUMPBOX_SSH_KEY="$(bbl ssh-key)"
10+
export YTT_TARGET="$(bbl director-address)"
11+
export YTT_CLIENT="$(bbl director-username)"
12+
export YTT_CLIENT_SECRET="$(bbl director-password)"
13+
export YTT_CA_CERT="$(bbl director-ca-cert)"
14+
export YTT_JUMPBOX_URL="$(bbl jumpbox-address)"
15+
export YTT_JUMPBOX_SSH_KEY="$(bbl ssh-key)"
1616
popd > /dev/null
1717

18-
texplate execute "${ROOT}/bbl-ci/ci/tasks/create-bosh-deployment-source-file/source-template.yml" -o json > "${source_file}"
18+
ytt -f "${ROOT}/bbl-ci/ci/tasks/create-bosh-deployment-source-file/source-template.yml" --data-values-env YTT > "${source_file}"
1919
}
2020

2121
main

dockerfiles/cf-deployment-concourse-tasks-bbl-dev/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM cloudfoundry/cf-deployment-concourse-tasks
2-
MAINTAINER https://github.com/cloudfoundry/bosh-bootloader
2+
LABEL maintainer="https://github.com/cloudfoundry/bosh-bootloader"
33

44
# Create directory for GOPATH
55
RUN mkdir -p /go/bin
@@ -26,8 +26,12 @@ RUN echo "deb https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /et
2626
apt-get update && \
2727
apt-get -qqy install google-cloud-cli
2828

29-
# needed in the task 'create-bosh-source-file'
30-
RUN go install github.com/pivotal-cf/texplate@latest
29+
# Install ytt
30+
RUN curl -s https://api.github.com/repos/carvel-dev/ytt/releases/latest | \
31+
jq -r '.assets[] | .browser_download_url | select(contains("linux-amd64"))' | \
32+
xargs wget && \
33+
mv ytt-* /usr/local/bin/ytt && \
34+
chmod +x /usr/local/bin/ytt
3135

3236
# add bbl from latest commit
3337
ADD bbl /usr/local/bin/

0 commit comments

Comments
 (0)