Skip to content

Commit

Permalink
Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
craigthackerx committed Dec 14, 2023
1 parent edf1308 commit 1656ad4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions containers/jenkins-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ RUN git clone --depth=1 https://github.com/tfutils/tfenv.git /opt/.tfenv && \
RUN git clone https://github.com/iamhsa/pkenv.git /opt/.pkenv && \
PACKER_LATEST_URL=$(curl -sL https://releases.hashicorp.com/packer/index.json | jq -r '.versions[].builds[].url' | egrep -v 'rc|beta|alpha' | egrep 'linux.*amd64' | tail -1) && \
PACKER_LATEST_VERSION=$(echo "$PACKER_LATEST_URL" | awk -F '/' '{print $6}' | sed 's/packer_//' | sed 's/_linux_amd64.zip//') && \
cd /opt/.pkenv && \
pkenv install ${PACKER_LATEST_VERSION} && \
pkenv use ${PACKER_LATEST_VERSION}

Expand Down
5 changes: 4 additions & 1 deletion containers/jenkins-alpine/packer.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,11 @@ build {
environment_vars = ["PATH=${local.path_var}", "PYENV_ROOT=/opt/.pyenv", "USER=root"]
execute_command = "sudo -Hu root sh -c '{{ .Vars }} {{ .Path }}'"
inline = [
"mkdir -p /opt/tfsec",
"curl -sSL $(curl -sSL https://api.github.com/repos/tfsec/tfsec/releases/latest | jq -r '.assets[] | select(.name | contains(\"tfsec-linux-amd64\")) | .browser_download_url') -o /tmp/tfsec > /dev/null 2>&1",
"chmod +x /tmp/tfsec",
"mv /tmp/tfsec /usr/local/bin"
"mv /tmp/tfsec /opt/tfsec/tfsec",
"ln -fs /opt/tfsec/tfsec /usr/bin/tfsec"
]
}

Expand Down Expand Up @@ -232,6 +234,7 @@ build {
execute_command = "sudo -Hu ${var.normal_user} sh -c '{{ .Vars }} {{ .Path }}'"
inline = [
"git clone https://github.com/iamhsa/pkenv.git /opt/.pkenv",
"cd /opt/.pkenv",
"pkenv install latest",
"pkenv use latest"
]
Expand Down

0 comments on commit 1656ad4

Please sign in to comment.