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 7458095 commit 03a7ba9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion containers/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ RUN git clone https://github.com/iamhsa/pkenv.git /home/${NORMAL_USER}/.pkenv &&
RUN chown -R ${NORMAL_USER}:${NORMAL_USER} /opt && \
chown -R ${NORMAL_USER}:${NORMAL_USER} /home/${NORMAL_USER}

RUN curl -L $(curl -s -L https://api.github.com/repos/tfsec/tfsec/releases/latest | jq -r '.assets[] | select(.name | contains("tfsec-linux-amd64")) | .browser_download_url') -o /tmp/tfsec && \
RUN curl -s -L $(curl -s -L https://api.github.com/repos/tfsec/tfsec/releases/latest | jq -r '.assets[] | select(.name | contains("tfsec-linux-amd64")) | .browser_download_url') -o /tmp/tfsec && \
chmod +x /tmp/tfsec && \
mv /tmp/tfsec /usr/local/bin

Expand Down
7 changes: 3 additions & 4 deletions containers/alpine/packer.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,15 @@ build {
}

provisioner "shell" {
environment_vars = ["PATH=${local.path_var}", "PYENV_ROOT=/home/${var.normal_user}/.pyenv"]
execute_command = "sh -c '{{ .Vars }} {{ .Path }}'"
environment_vars = ["PATH=${local.path_var}", "PYENV_ROOT=/home/${var.normal_user}/.pyenv", "USER=root"]
execute_command = "sudo -Hu root sh -c '{{ .Vars }} {{ .Path }}'"
inline = [
"curl -L $(curl -s -L https://api.github.com/repos/tfsec/tfsec/releases/latest | jq -r '.assets[] | select(.name | contains(\"tfsec-linux-amd64\")) | .browser_download_url') -o /tmp/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"
]
}


provisioner "shell" {
environment_vars = ["PATH=${local.path_var}"]
execute_command = "sh -c '{{ .Vars }} {{ .Path }}'"
Expand Down
3 changes: 2 additions & 1 deletion containers/jenkins-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ RUN git clone https://github.com/iamhsa/pkenv.git /home/${NORMAL_USER}/.pkenv &&
RUN chown -R ${NORMAL_USER}:${NORMAL_USER} /opt && \
chown -R ${NORMAL_USER}:${NORMAL_USER} /home/${NORMAL_USER}

RUN curl -L $(curl -s -L https://api.github.com/repos/tfsec/tfsec/releases/latest | jq -r '.assets[] | select(.name | contains("tfsec-linux-amd64")) | .browser_download_url') -o /tmp/tfsec && \
RUN 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


USER ${NORMAL_USER}
WORKDIR /home/${NORMAL_USER}

Expand Down
20 changes: 10 additions & 10 deletions containers/jenkins-alpine/packer.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ locals {
]

pip_packages = [
"pip-system-certs",
"pipenv",
"virtualenv" ,
"terraform-compliance",
"black",
"ansible",
"checkov",
"pywinrm",
"azure-cli"
"pip-system-certs",
"pipenv",
"virtualenv",
"terraform-compliance",
"black",
"ansible",
"checkov",
"pywinrm",
"azure-cli"
]

jenkins_plugins = [
Expand Down Expand Up @@ -227,7 +227,7 @@ build {
environment_vars = ["PATH=${local.path_var}", "PYENV_ROOT=/home/${var.normal_user}/.pyenv", "USER=root"]
execute_command = "sudo -Hu root sh -c '{{ .Vars }} {{ .Path }}'"
inline = [
"curl -L $(curl -s -L https://api.github.com/repos/tfsec/tfsec/releases/latest | jq -r '.assets[] | select(.name | contains(\"tfsec-linux-amd64\")) | .browser_download_url') -o /tmp/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"
]
Expand Down

0 comments on commit 03a7ba9

Please sign in to comment.