This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7780 from EOSIO/trav-poc-wrong-artifacts
Trav poc wrong artifacts
- Loading branch information
Showing
3 changed files
with
73 additions
and
54 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/usr/bin/env bash | ||
set -eo pipefail | ||
. ./.cicd/helpers/general.sh | ||
|
||
mkdir -p $BUILD_DIR | ||
|
||
if [[ $(uname) == 'Darwin' ]]; then | ||
|
||
bash -c "cd build/packages && chmod 755 ./*.sh && ./generate_package.sh brew" | ||
|
||
ARTIFACT='*.rb;*.tar.gz' | ||
cd build/packages | ||
[[ -d x86_64 ]] && cd 'x86_64' # backwards-compatibility with release/1.6.x | ||
buildkite-agent artifact upload "./$ARTIFACT" --agent-access-token $BUILDKITE_AGENT_ACCESS_TOKEN | ||
for A in $(echo $ARTIFACT | tr ';' ' '); do | ||
if [[ $(ls $A | grep -c '') == 0 ]]; then | ||
echo "+++ :no_entry: ERROR: Expected artifact \"$A\" not found!" | ||
pwd | ||
ls -la | ||
exit 1 | ||
fi | ||
done | ||
|
||
else # Linux | ||
|
||
ARGS=${ARGS:-"--rm --init -v $(pwd):$MOUNTED_DIR"} | ||
|
||
. $HELPERS_DIR/docker-hash.sh | ||
|
||
PRE_COMMANDS="cd $MOUNTED_DIR/build/packages && chmod 755 ./*.sh" | ||
|
||
if [[ "$IMAGE_TAG" =~ "ubuntu" ]]; then | ||
ARTIFACT='*.deb' | ||
PACKAGE_TYPE='deb' | ||
PACKAGE_COMMANDS="./generate_package.sh $PACKAGE_TYPE" | ||
elif [[ "$IMAGE_TAG" =~ "centos" ]]; then | ||
ARTIFACT='*.rpm' | ||
PACKAGE_TYPE='rpm' | ||
PACKAGE_COMMANDS="mkdir -p ~/rpmbuild/BUILD && mkdir -p ~/rpmbuild/BUILDROOT && mkdir -p ~/rpmbuild/RPMS && mkdir -p ~/rpmbuild/SOURCES && mkdir -p ~/rpmbuild/SPECS && mkdir -p ~/rpmbuild/SRPMS && yum install -y rpm-build && ./generate_package.sh $PACKAGE_TYPE" | ||
fi | ||
|
||
COMMANDS="$PRE_COMMANDS && $PACKAGE_COMMANDS" | ||
|
||
# Load BUILDKITE Environment Variables for use in docker run | ||
if [[ -f $BUILDKITE_ENV_FILE ]]; then | ||
evars="" | ||
while read -r var; do | ||
evars="$evars --env ${var%%=*}" | ||
done < "$BUILDKITE_ENV_FILE" | ||
fi | ||
|
||
eval docker run $ARGS $evars $FULL_TAG bash -c \"$COMMANDS\" | ||
|
||
cd build/packages | ||
[[ -d x86_64 ]] && cd 'x86_64' # backwards-compatibility with release/1.6.x | ||
buildkite-agent artifact upload "./$ARTIFACT" --agent-access-token $BUILDKITE_AGENT_ACCESS_TOKEN | ||
for A in $(echo $ARTIFACT | tr ';' ' '); do | ||
if [[ $(ls $A | grep -c '') == 0 ]]; then | ||
echo "+++ :no_entry: ERROR: Expected artifact \"$A\" not found!" | ||
pwd | ||
ls -la | ||
exit 1 | ||
fi | ||
done | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters