Skip to content

Commit

Permalink
Always move clone and build to CMD so it always triggers (#434)
Browse files Browse the repository at this point in the history
Co-authored-by: James Piechota <[email protected]>
  • Loading branch information
JamesPiechota and James Piechota authored Jun 15, 2023
1 parent e7c3736 commit 4df346a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 29 deletions.
23 changes: 10 additions & 13 deletions release/Dockerfile.rocky
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,16 @@ RUN dnf install -y \
# Set the working directory
WORKDIR /app

# Clone the repository
RUN git clone --recursive https://github.com/ArweaveTeam/arweave.git

# Change directory
WORKDIR /app/arweave

# Define the output directory as a volume
# Define the output directory as a volume
VOLUME /output

# The build steps are executed every time
ARG GIT_TAG
RUN git fetch --all && \
git checkout ${GIT_TAG} && \
./rebar3 as prod tar

CMD cp _build/prod/rel/arweave/arweave-*.tar.gz /output/arweave.tar.gz
CMD set -x && \
git clone --recursive https://github.com/ArweaveTeam/arweave.git && \
cd arweave && \
git fetch --all && \
git pull --force && \
git checkout --force $GIT_TAG && \
./rebar3 as prod tar && \
cp _build/prod/rel/arweave/arweave-*.tar.gz /output/arweave.tar.gz

22 changes: 9 additions & 13 deletions release/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,15 @@ RUN apt-get install -y \
# Set the working directory
WORKDIR /app

# Clone the repository
RUN git clone --recursive https://github.com/ArweaveTeam/arweave.git

# Change directory
WORKDIR /app/arweave

# Define the output directory as a volume
# Define the output directory as a volume
VOLUME /output

# The build steps are executed every time
ARG GIT_TAG
RUN git fetch --all && \
git checkout ${GIT_TAG} && \
./rebar3 as prod tar

CMD cp _build/prod/rel/arweave/arweave-*.tar.gz /output/arweave.tar.gz
CMD set -x && \
git clone --recursive https://github.com/ArweaveTeam/arweave.git && \
cd arweave && \
git fetch --all && \
git pull --force && \
git checkout --force $GIT_TAG && \
./rebar3 as prod tar && \
cp _build/prod/rel/arweave/arweave-*.tar.gz /output/arweave.tar.gz
6 changes: 3 additions & 3 deletions release/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ for i in "${!LINUX_VERSIONS[@]}"; do

if [ ! -z "${BASE_IMAGES[$i]}" ]; then
# Build the Docker image
run_cmd "docker build -f $DOCKERFILE --build-arg BASE_IMAGE=${BASE_IMAGES[$i]} --build-arg GIT_TAG=$GIT_TAG -t $IMAGE_NAME ."
run_cmd "docker build -f $DOCKERFILE --build-arg BASE_IMAGE=${BASE_IMAGES[$i]} -t $IMAGE_NAME ."
else
run_cmd "docker build -f $DOCKERFILE --build-arg GIT_TAG=$GIT_TAG -t $IMAGE_NAME ."
run_cmd "docker build -f $DOCKERFILE -t $IMAGE_NAME ."
fi

echo "Running $IMAGE_NAME..."

# Run the Docker container
run_cmd "docker run --rm -v $(pwd)/output:/output $IMAGE_NAME"
run_cmd "docker run --rm -e GIT_TAG=$GIT_TAG -v $(pwd)/output:/output $IMAGE_NAME"

echo "Renaming output file..."

Expand Down

0 comments on commit 4df346a

Please sign in to comment.