Skip to content

Commit

Permalink
ci: reduce artifacts size (#2403)
Browse files Browse the repository at this point in the history
* ci: reduce artifacts size

* ci: include prom-stack for rpm/deb

* ci: address review comments
  • Loading branch information
rahulguptajss authored Oct 6, 2023
1 parent 63973bb commit 08118de
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ dist-tar:
@rm -rf ${DIST}
@mkdir ${TMP}
@mkdir ${DIST}
@cp -r .git cmd bin conf container docs grafana pkg service cert autosupport go.mod go.sum Makefile README.md LICENSE prom-stack.tmpl harvest.cue ${TMP}
@cp -r bin conf container grafana service cert autosupport README.md LICENSE prom-stack.tmpl ${TMP}
@cp harvest.yml ${TMP}/harvest.yml
@tar --directory /tmp --create --gzip --file ${DIST}/${HARVEST_PACKAGE}.tar.gz ${HARVEST_PACKAGE}
@rm -rf ${TMP}
Expand Down
13 changes: 11 additions & 2 deletions deb/build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,22 @@ else
make build VERSION="$HARVEST_VERSION" RELEASE="$HARVEST_RELEASE"
fi

rm -rf $BUILD/opt/harvest/asup/*

if [ ! $? -eq 0 ]; then
error " build failed"
exit 1
fi

rm -rf $BUILD/opt/harvest/asup
rm -rf $BUILD/opt/harvest/.git
rm -rf $BUILD/opt/harvest/vendor
rm -rf $BUILD/opt/harvest/cmd
rm -rf $BUILD/opt/harvest/package
rm -rf $BUILD/opt/harvest/go.mod
rm -rf $BUILD/opt/harvest/go.sum
rm -rf $BUILD/opt/harvest/harvest.cue
rm -rf $BUILD/opt/harvest/Makefile
rm -rf $BUILD/opt/harvest/.github

# build deb package
PACKAGE_DIR="$SRC/dist/$HARVEST_VERSION-$HARVEST_RELEASE"
PACKAGE_NAME="harvest-${HARVEST_VERSION}-${HARVEST_RELEASE}.${HARVEST_ARCH}.deb"
Expand Down
14 changes: 11 additions & 3 deletions rpm/build-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ cp -r "$SRC/.git" "$BUILD/harvest"
cp -r "$SRC/cmd/" "$BUILD/harvest/"
cp -r "$SRC/conf/" "$BUILD/harvest/"
cp -r "$SRC/container/" "$BUILD/harvest/"
cp -r "$SRC/docs/" "$BUILD/harvest/"
cp -r "$SRC/grafana/" "$BUILD/harvest/"
cp -r "$SRC/pkg/" "$BUILD/harvest/"
cp -r "$SRC/rpm/" "$BUILD/harvest/"
Expand Down Expand Up @@ -52,13 +51,22 @@ else
make build VERSION=$HARVEST_VERSION RELEASE=$HARVEST_RELEASE
fi

rm -rf $BUILD/harvest/asup/*

if [ ! $? -eq 0 ]; then
echo "build failed, aborting"
exit 1
fi

rm -rf $BUILD/harvest/asup
rm -rf $BUILD/harvest/.git
rm -rf $BUILD/harvest/vendor
rm -rf $BUILD/harvest/cmd
rm -rf $BUILD/harvest/package
rm -rf $BUILD/harvest/go.mod
rm -rf $BUILD/harvest/go.sum
rm -rf $BUILD/harvest/harvest.cue
rm -rf $BUILD/harvest/Makefile
rm -rf $BUILD/harvest/.github

# create rpm build package
cd "$BUILD"
rm -rf "rpm"
Expand Down

0 comments on commit 08118de

Please sign in to comment.