Skip to content

Commit

Permalink
Use latest image-cryogenics-essentials (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
duanemay authored Sep 17, 2024
1 parent 2ffb31b commit 12a97fb
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 28 deletions.
23 changes: 12 additions & 11 deletions ci/tasks/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@ ssh-keyscan github.com >>~/.ssh/known_hosts

SOURCE_DIR=$PWD/source

go version
go install github.com/xchapter7x/versioning@latest

export GOPATH="$HOME/go"
export GOPATH="$(go env GOPATH)"
export PATH="$GOPATH/bin:$PATH"

pushd ${SOURCE_DIR} > /dev/null
if [ -d ".git" ]; then
pushd ${SOURCE_DIR} >/dev/null
if [ -d ".git" ]; then
if ${DEV}; then
ts=$(date +"%Y%m%M%S%N")
DRAFT_VERSION="dev-${ts}"
COMMIT="dev"
VERSION="dev"
else
DRAFT_VERSION=`versioning bump_patch`-`git rev-parse HEAD`
COMMIT=`git rev-parse HEAD`
VERSION=`versioning bump_patch`
DRAFT_VERSION=$(versioning bump_patch)-$(git rev-parse HEAD)
COMMIT=$(git rev-parse HEAD)
VERSION=$(versioning bump_patch)
fi
else
DRAFT_VERSION="v0.0.0"
Expand All @@ -38,7 +39,7 @@ WORKING_DIR=$GOPATH/src/github.com/vmwarepivotallabs/cf-mgmt
mkdir -p ${WORKING_DIR}
cp -R ${SOURCE_DIR}/* ${WORKING_DIR}/.

pushd ${WORKING_DIR} > /dev/null
pushd ${WORKING_DIR} >/dev/null
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${OUTPUT_DIR}/cf-mgmt-linux -ldflags "-X github.com/vmwarepivotallabs/cf-mgmt/configcommands.VERSION=${VERSION} -X github.com/vmwarepivotallabs/cf-mgmt/configcommands.COMMIT=${COMMIT}" cmd/cf-mgmt/main.go
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o ${OUTPUT_DIR}/cf-mgmt-linux-arm64 -ldflags "-X github.com/vmwarepivotallabs/cf-mgmt/configcommands.VERSION=${VERSION} -X github.com/vmwarepivotallabs/cf-mgmt/configcommands.COMMIT=${COMMIT}" cmd/cf-mgmt/main.go
GOOS=darwin GOARCH=amd64 go build -o ${OUTPUT_DIR}/cf-mgmt-osx -ldflags "-X github.com/vmwarepivotallabs/cf-mgmt/configcommands.VERSION=${VERSION} -X github.com/vmwarepivotallabs/cf-mgmt/configcommands.COMMIT=${COMMIT}" cmd/cf-mgmt/main.go
Expand All @@ -55,9 +56,9 @@ pushd ${WORKING_DIR} > /dev/null
popd

if ${DEV}; then
echo ${DRAFT_VERSION} > "${OUTPUT_DIR}/name"
echo ${DRAFT_VERSION} > "${OUTPUT_DIR}/tag"
echo ${DRAFT_VERSION} >"${OUTPUT_DIR}/name"
echo ${DRAFT_VERSION} >"${OUTPUT_DIR}/tag"
else
echo ${VERSION} > "${OUTPUT_DIR}/name"
echo ${VERSION} > "${OUTPUT_DIR}/tag"
echo ${VERSION} >"${OUTPUT_DIR}/name"
echo ${VERSION} >"${OUTPUT_DIR}/tag"
fi
2 changes: 1 addition & 1 deletion ci/tasks/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ platform: linux
image_resource:
source:
repository: harbor-repo.vmware.com/cryogenics/essentials
tag: 0.1.112
tag: latest
type: registry-image
run:
path: source/ci/tasks/build.sh
Expand Down
10 changes: 5 additions & 5 deletions ci/tasks/runIntegrationTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ eval "$(bbl print-env --metadata-file cf-deployment-env/metadata)"

go version
go install code.cloudfoundry.org/uaa-cli@latest
export PATH=$PATH:$(go env GOPATH)/bin
export GOPATH="$(go env GOPATH)"
export PATH="$GOPATH/bin:$PATH"

if [ -z "$SYSTEM_DOMAIN" ]
then
SYSTEM_DOMAIN=$( get_system_domain )
if [ -z "$SYSTEM_DOMAIN" ]; then
SYSTEM_DOMAIN=$(get_system_domain)
fi

uaa-cli target "https://uaa.${SYSTEM_DOMAIN}" -k
Expand All @@ -39,5 +39,5 @@ pushd source > /dev/null
CF_ADMIN_PASSWORD=$(get_from_credhub cf_admin_password) \
ADMIN_CLIENT_SECRET=$(get_from_credhub uaa_admin_client_secret) \
RUN_INTEGRATION_TESTS=true \
go run github.com/onsi/ginkgo/v2/ginkgo ./integration/... --show-node-events -vv --poll-progress-after
go run github.com/onsi/ginkgo/v2/ginkgo ./integration/... --show-node-events -vv --poll-progress-after
popd > /dev/null
16 changes: 8 additions & 8 deletions ci/tasks/runIntegrationTestsAgainstTAS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ ADMIN_CLIENT_SECRET="$( \
--skip-ssl-validation \
--env env/pcf.yml \
credentials \
--product-name cf \
--credential-reference .uaa.admin_client_credentials \
--credential-field password \
--product-name cf \
--credential-reference .uaa.admin_client_credentials \
--credential-field password \
)"

uaac target "uaa.$SYSTEM_DOMAIN" --skip-ssl-validation
Expand All @@ -34,14 +34,14 @@ CF_ADMIN_PASSWORD="$( \
--skip-ssl-validation \
--env env/pcf.yml \
credentials \
--product-name cf \
--credential-reference .uaa.admin_credentials \
--credential-field password \
--product-name cf \
--credential-reference .uaa.admin_credentials \
--credential-field password \
)"

pushd source > /dev/null
pushd source >/dev/null
export ADMIN_CLIENT_SECRET CF_ADMIN_PASSWORD SYSTEM_DOMAIN

RUN_INTEGRATION_TESTS=true \
go run github.com/onsi/ginkgo/v2/ginkgo ./integration/... --show-node-events -vv --poll-progress-after
popd > /dev/null
popd >/dev/null
2 changes: 1 addition & 1 deletion ci/tasks/runIntegrationTestsAgainstTAS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ image_resource:
type: registry-image
source:
repository: harbor-repo.vmware.com/cryogenics/essentials
tag: 0.1.112
tag: latest
inputs:
- name: source
- name: env
Expand Down
2 changes: 1 addition & 1 deletion ci/tasks/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eu -o pipefail

pushd "source" > /dev/null
pushd "source" >/dev/null
go version

echo "Running go vet"
Expand Down
2 changes: 1 addition & 1 deletion ci/tasks/runTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ platform: linux
image_resource:
source:
repository: harbor-repo.vmware.com/cryogenics/essentials
tag: 0.1.112
tag: latest
type: registry-image
run:
path: source/ci/tasks/runTests.sh
Expand Down

0 comments on commit 12a97fb

Please sign in to comment.