Skip to content

Commit

Permalink
added results.tar.gz to speed up.
Browse files Browse the repository at this point in the history
Signed-off-by: sreepuramsudheer <[email protected]>
  • Loading branch information
sreepuramsudheer committed Nov 13, 2024
1 parent 474ef0a commit b2e04d8
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 93 deletions.
120 changes: 60 additions & 60 deletions .expeditor/automate_build.sh
Original file line number Diff line number Diff line change
@@ -1,85 +1,85 @@
#!/bin/bash -e

export ORIGIN=chef
export HAB_ORIGIN=chef
export HAB_LICENSE=accept-no-persist
export OCTOKIT_ACCESS_TOKEN
export CHEF_LICENSE="accept-no-persist"
export CI=true
export HAB_ORIGIN_KEYS=chef
export HAB_STUDIO_SECRET_HAB_FEAT_IGNORE_LOCAL=false
export HAB_FEAT_IGNORE_LOCAL=false
export HAB_STUDIO_HOST_ARCH=x86_64-linux
export HAB_FEAT_OFFLINE_INSTALL=true
# export ORIGIN=chef
# export HAB_ORIGIN=chef
# export HAB_LICENSE=accept-no-persist
# export OCTOKIT_ACCESS_TOKEN
# export CHEF_LICENSE="accept-no-persist"
# export CI=true
# export HAB_ORIGIN_KEYS=chef
# export HAB_STUDIO_SECRET_HAB_FEAT_IGNORE_LOCAL=false
# export HAB_FEAT_IGNORE_LOCAL=false
# export HAB_STUDIO_HOST_ARCH=x86_64-linux
# export HAB_FEAT_OFFLINE_INSTALL=true

curl https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.sh | sudo bash
# curl https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.sh | sudo bash

sudo -E hab pkg install core/ruby
export PATH
PATH="$(hab pkg path core/ruby)/bin:$PATH"
sudo -E "$(hab pkg path core/ruby)"/bin/gem install toml
# sudo -E hab pkg install core/ruby
# export PATH
# PATH="$(hab pkg path core/ruby)/bin:$PATH"
# sudo -E "$(hab pkg path core/ruby)"/bin/gem install toml

export JOB_TEMP_ROOT
JOB_TEMP_ROOT=$(mktemp -d /tmp/job-root-XXXXXX)
export HAB_CACHE_KEY_PATH
HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys"
# export JOB_TEMP_ROOT
# JOB_TEMP_ROOT=$(mktemp -d /tmp/job-root-XXXXXX)
# export HAB_CACHE_KEY_PATH
# HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys"

echo "--- :key: Generating fake origin key"
hab license accept
hab origin key generate
# echo "--- :key: Generating fake origin key"
# hab license accept
# hab origin key generate

for pkg_name in `echo "bookshelf chef-server-ctl oc-id oc_bifrost oc_erchef openresty-noroot"`
do
echo "generating package for $pkg_name"
hab pkg build "src/$pkg_name"
done
# for pkg_name in `echo "bookshelf chef-server-ctl oc-id oc_bifrost oc_erchef openresty-noroot"`
# do
# echo "generating package for $pkg_name"
# hab pkg build "src/$pkg_name"
# done

./.expeditor/replace.sh "nginx" "src"
# ./.expeditor/replace.sh "nginx" "src"

echo "generating package for nginx"
openresty_hart=$(ls -1t results/chef-openresty*.hart | head -1)
HAB_FEAT_OFFLINE_INSTALL=true HAB_FEAT_IGNORE_LOCAL=false HAB_ORIGIN=chef HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys" DO_CHECK=true HAB_BLDR_CHANNEL=dev hab studio run -D "set -e; hab pkg install $openresty_hart; hab pkg build src/nginx"
# echo "generating package for nginx"
# openresty_hart=$(ls -1t results/chef-openresty*.hart | head -1)
# HAB_FEAT_OFFLINE_INSTALL=true HAB_FEAT_IGNORE_LOCAL=false HAB_ORIGIN=chef HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys" DO_CHECK=true HAB_BLDR_CHANNEL=dev hab studio run -D "set -e; hab pkg install $openresty_hart; hab pkg build src/nginx"

git clone https://github.com/chef/automate.git
cd automate
git checkout ssudheer/cs_license_test
# git clone https://github.com/chef/automate.git
# cd automate
# git checkout ssudheer/cs_license_test

RESOLVED_RESULTS_DIR=$(realpath results/)
export DO_CHECK=true
# RESOLVED_RESULTS_DIR=$(realpath results/)
# export DO_CHECK=true

cp ../results/*.hart $HAB_CACHE_KEY_PATH/* results
# cp ../results/*.hart $HAB_CACHE_KEY_PATH/* results

#cp ../results/*.hart ../results/chef*.pub ../results/chef*.key results
../.expeditor/replace.sh
bookshelf_hart=$(ls -1t results/chef-bookshelf*.hart | head -1)
chef_server_ctl_hart=$(ls -1t results/chef-chef-server-ctl*.hart | head -1)
nginx=$(ls -1t results/chef-chef-server-nginx*.hart | head -1)
oc_id=$(ls -1t results/chef-oc_id*.hart | head -1)
bifrost_hart=$(ls -1t results/chef-oc_bifrost*.hart | head -1)
erchef_hart=$(ls -1t results/chef-oc_erchef*.hart | head -1)
# #cp ../results/*.hart ../results/chef*.pub ../results/chef*.key results
# ../.expeditor/replace.sh
# bookshelf_hart=$(ls -1t results/chef-bookshelf*.hart | head -1)
# chef_server_ctl_hart=$(ls -1t results/chef-chef-server-ctl*.hart | head -1)
# nginx=$(ls -1t results/chef-chef-server-nginx*.hart | head -1)
# oc_id=$(ls -1t results/chef-oc_id*.hart | head -1)
# bifrost_hart=$(ls -1t results/chef-oc_bifrost*.hart | head -1)
# erchef_hart=$(ls -1t results/chef-oc_erchef*.hart | head -1)


HAB_FEAT_OFFLINE_INSTALL=true HAB_FEAT_IGNORE_LOCAL=false HAB_ORIGIN=chef HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys" DO_CHECK=true HAB_BLDR_CHANNEL=dev hab studio run -D "set -e; hab pkg install $bookshelf_hart; hab pkg build components/automate-cs-bookshelf"
# HAB_FEAT_OFFLINE_INSTALL=true HAB_FEAT_IGNORE_LOCAL=false HAB_ORIGIN=chef HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys" DO_CHECK=true HAB_BLDR_CHANNEL=dev hab studio run -D "set -e; hab pkg install $bookshelf_hart; hab pkg build components/automate-cs-bookshelf"

HAB_FEAT_OFFLINE_INSTALL=true HAB_FEAT_IGNORE_LOCAL=false HAB_ORIGIN=chef HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys" DO_CHECK=true HAB_BLDR_CHANNEL=dev hab studio run -D "set -e; hab pkg install $bifrost_hart; hab pkg build components/automate-cs-oc-bifrost"
# HAB_FEAT_OFFLINE_INSTALL=true HAB_FEAT_IGNORE_LOCAL=false HAB_ORIGIN=chef HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys" DO_CHECK=true HAB_BLDR_CHANNEL=dev hab studio run -D "set -e; hab pkg install $bifrost_hart; hab pkg build components/automate-cs-oc-bifrost"

HAB_FEAT_OFFLINE_INSTALL=true HAB_FEAT_IGNORE_LOCAL=false HAB_ORIGIN=chef HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys" DO_CHECK=true HAB_BLDR_CHANNEL=dev hab studio run -D "set -e; hab pkg install $erchef_hart; hab pkg build components/automate-cs-oc-erchef"
# HAB_FEAT_OFFLINE_INSTALL=true HAB_FEAT_IGNORE_LOCAL=false HAB_ORIGIN=chef HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys" DO_CHECK=true HAB_BLDR_CHANNEL=dev hab studio run -D "set -e; hab pkg install $erchef_hart; hab pkg build components/automate-cs-oc-erchef"

HAB_FEAT_OFFLINE_INSTALL=true HAB_FEAT_IGNORE_LOCAL=false HAB_ORIGIN=chef HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys" DO_CHECK=true HAB_BLDR_CHANNEL=dev hab studio run -D "set -e; hab pkg install $oc_id; hab pkg build components/automate-cs-ocid"
# HAB_FEAT_OFFLINE_INSTALL=true HAB_FEAT_IGNORE_LOCAL=false HAB_ORIGIN=chef HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys" DO_CHECK=true HAB_BLDR_CHANNEL=dev hab studio run -D "set -e; hab pkg install $oc_id; hab pkg build components/automate-cs-ocid"

HAB_FEAT_OFFLINE_INSTALL=true HAB_FEAT_IGNORE_LOCAL=false HAB_ORIGIN=chef HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys" DO_CHECK=true HAB_BLDR_CHANNEL=dev hab studio run -D "set -e; hab pkg install $nginx; hab pkg build components/automate-cs-nginx"
# HAB_FEAT_OFFLINE_INSTALL=true HAB_FEAT_IGNORE_LOCAL=false HAB_ORIGIN=chef HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys" DO_CHECK=true HAB_BLDR_CHANNEL=dev hab studio run -D "set -e; hab pkg install $nginx; hab pkg build components/automate-cs-nginx"

.expeditor/create-manifest.rb
mv manifest.json results/build.json
# .expeditor/create-manifest.rb
# mv manifest.json results/build.json

HAB_PKG_CHANNEL=unstable NO_PIN_HAB=true .expeditor/create-manifest.rb
mv manifest.json results/build-habdev.json
# HAB_PKG_CHANNEL=unstable NO_PIN_HAB=true .expeditor/create-manifest.rb
# mv manifest.json results/build-habdev.json

echo "after build" `ls -l results`
# echo "after build" `ls -l results`

# we require chef-server hart files also for for next steps.
# ls results/*.hart | grep -v automate | xargs rm
# # we require chef-server hart files also for for next steps.
# # ls results/*.hart | grep -v automate | xargs rm

tar -cvf results.tar results
gzip results.tar
# tar -cvf results.tar results
# gzip results.tar
buildkite-agent artifact upload results.tar.gz
66 changes: 33 additions & 33 deletions .expeditor/verify.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,40 @@ expeditor:

steps:

# - label: automate_build
# command:
# - .expeditor/automate_build.sh
# env:
# ALLOW_LOCAL_PACKAGES: true
# HAB_STUDIO_SUP: false
# HAB_NONINTERACTIVE: true
# GOPROXY: "https://proxy.golang.org,direct"
# expeditor:
# secrets:
# HAB_STUDIO_SECRET_GITHUB_TOKEN:
# account: github/chef
# field: token
# OPENSEARCH_ROOT_CA_PEM:
# path: secret/a2/a2ha/opensearch
# field: root-ca.pem
# OPENSEARCH_ADMIN_PEM:
# path: secret/a2/a2ha/opensearch
# field: admin.pem
# OPENSEARCH_ADMIN_KEY_PEM:
# path: secret/a2/a2ha/opensearch
# field: admin-key.pem
# OPENSEARCH_NODE1_PEM:
# path: secret/a2/a2ha/opensearch
# field: node1.pem
# OPENSEARCH_NODE1_KEY_PEM:
# path: secret/a2/a2ha/opensearch
# field: node1-key.pem
# executor:
# linux:
# privileged: true
- label: automate_build
command:
- .expeditor/automate_build.sh
env:
ALLOW_LOCAL_PACKAGES: true
HAB_STUDIO_SUP: false
HAB_NONINTERACTIVE: true
GOPROXY: "https://proxy.golang.org,direct"
expeditor:
secrets:
HAB_STUDIO_SECRET_GITHUB_TOKEN:
account: github/chef
field: token
OPENSEARCH_ROOT_CA_PEM:
path: secret/a2/a2ha/opensearch
field: root-ca.pem
OPENSEARCH_ADMIN_PEM:
path: secret/a2/a2ha/opensearch
field: admin.pem
OPENSEARCH_ADMIN_KEY_PEM:
path: secret/a2/a2ha/opensearch
field: admin-key.pem
OPENSEARCH_NODE1_PEM:
path: secret/a2/a2ha/opensearch
field: node1.pem
OPENSEARCH_NODE1_KEY_PEM:
path: secret/a2/a2ha/opensearch
field: node1-key.pem
executor:
linux:
privileged: true

# # waiting for the automate build to finish before running the chef server tests
# - wait
# waiting for the automate build to finish before running the chef server tests
- wait


- label: "chef server"
Expand Down
Binary file added xaa
Binary file not shown.
Binary file added xab
Binary file not shown.
Binary file added xac
Binary file not shown.

0 comments on commit b2e04d8

Please sign in to comment.