Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Trav poc wrong artifacts #7780

Merged
merged 9 commits into from
Aug 21, 2019
Merged
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
50 changes: 0 additions & 50 deletions .cicd/package-builder.sh

This file was deleted.

66 changes: 66 additions & 0 deletions .cicd/package.sh
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
11 changes: 7 additions & 4 deletions .cicd/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,9 @@ steps:
- label: ":centos: CentOS 7.6 - Package Builder"
command:
- "buildkite-agent artifact download build.tar.gz . --step ':centos: CentOS 7.6 - Build' --agent-access-token $$BUILDKITE_AGENT_ACCESS_TOKEN && tar -xzf build.tar.gz"
- "./.cicd/package-builder.sh"
- "./.cicd/package.sh"
env:
IMAGE_TAG: "centos-7.6"
BUILDKITE_AGENT_ACCESS_TOKEN:
agents:
queue: "automation-eos-builder-fleet"
Expand All @@ -256,8 +257,9 @@ steps:
- label: ":ubuntu: Ubuntu 16.04 - Package Builder"
command:
- "buildkite-agent artifact download build.tar.gz . --step ':ubuntu: Ubuntu 16.04 - Build' --agent-access-token $$BUILDKITE_AGENT_ACCESS_TOKEN && tar -xzf build.tar.gz"
- "./.cicd/package-builder.sh"
- "./.cicd/package.sh"
env:
IMAGE_TAG: "ubuntu-16.04"
BUILDKITE_AGENT_ACCESS_TOKEN:
agents:
queue: "automation-eos-builder-fleet"
Expand All @@ -267,8 +269,9 @@ steps:
- label: ":ubuntu: Ubuntu 18.04 - Package Builder"
command:
- "buildkite-agent artifact download build.tar.gz . --step ':ubuntu: Ubuntu 18.04 - Build' --agent-access-token $$BUILDKITE_AGENT_ACCESS_TOKEN && tar -xzf build.tar.gz"
- "./.cicd/package-builder.sh"
- "./.cicd/package.sh"
env:
IMAGE_TAG: "ubuntu-18.04"
BUILDKITE_AGENT_ACCESS_TOKEN:
agents:
queue: "automation-eos-builder-fleet"
Expand All @@ -279,7 +282,7 @@ steps:
command:
- "git clone $BUILDKITE_REPO eos && cd eos && git checkout $BUILDKITE_COMMIT"
- "cd eos && buildkite-agent artifact download build.tar.gz . --step ':darwin: macOS 10.14 - Build' && tar -xzf build.tar.gz"
- "cd eos && ./.cicd/package-builder.sh"
- "cd eos && ./.cicd/package.sh"
plugins:
- chef/anka#v0.5.1:
no-volume: true
Expand Down