Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "BP-BASE-SHELL-STEPS"]
path = BP-BASE-SHELL-STEPS
url = https://github.com/OT-BUILDPIPER-MARKETPLACE/BP-BASE-SHELL-STEPS.git
1 change: 1 addition & 0 deletions BP-BASE-SHELL-STEPS
Submodule BP-BASE-SHELL-STEPS added at 2fc561
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM hashicorp/packer

RUN apk add --no-cache --upgrade bash
RUN apk add jq

ENV SLEEP_DURATION 5s

COPY build.sh .
ADD BP-BASE-SHELL-STEPS /opt/buildpiper/shell-functions/
ENV INSTRUCTION build
ENV PACKER_DIR ""
ENV EXTRA_VARS ""
ENV ACTIVITY_SUB_TASK_CODE PACKER_STEP

ENTRYPOINT [ "./build.sh" ]
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
# BP-PACKER_STEP
# BP-PACKER-STEP

I'll provide the capability to manage the lifecycle of packer code.


## Setup
* Clone the code available at [BP-PACKER-STEP](https://github.com/OT-BUILDPIPER-MARKETPLACE/BP-PACKER-STEP)
* Build the docker image

```
git submodule init
git submodule update
docker build -t registry.buildpiper.in/packer-step:0.1 .
```
20 changes: 20 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

source /opt/buildpiper/shell-functions/functions.sh
source /opt/buildpiper/shell-functions/log-functions.sh
source /opt/buildpiper/shell-functions/str-functions.sh
source /opt/buildpiper/shell-functions/file-functions.sh
source /opt/buildpiper/shell-functions/aws-functions.sh

logInfoMessage "Manage the packer code available at [$WORKSPACE] and have mounted at [${CODEBASE_DIR}/${PACKER_DIR}]"
sleep $SLEEP_DURATION


cd ${WORKSPACE}/${CODEBASE_DIR}/${PACKER_DIR}
logInfoMessage "packer ${INSTRUCTION}"

packer ${INSTRUCTION} ${EXTRA_VARS}

TASK_STATUS=$?

saveTaskStatus ${TASK_STATUS} ${ACTIVITY_SUB_TASK_CODE}