Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
debug error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin-Sun-tts committed Jan 12, 2024
1 parent e0f95bd commit 28d7af3
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 78 deletions.
86 changes: 43 additions & 43 deletions .github/workflows/dev-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,35 @@ on:
workflow_dispatch:

jobs:
# create-cloudgov-services-development-ssb:
# name: create services (development-ssb)
# environment: development-ssb
# runs-on: ubuntu-latest
# steps:
# - name: checkout
# uses: actions/checkout@v2
# - name: create services
# uses: cloud-gov/cg-cli-tools@main
# with:
# command: ./create-cloudgov-services.sh
# cf_org: gsa-datagov
# cf_space: development-ssb
# cf_username: ${{secrets.CF_SERVICE_USER}}
# cf_password: ${{secrets.CF_SERVICE_AUTH}}
create-cloudgov-services-development-ssb:
name: create services (development-ssb)
environment: development-ssb
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: create services
uses: cloud-gov/cg-cli-tools@main
with:
command: ./create-cloudgov-services.sh
cf_org: gsa-datagov
cf_space: development-ssb
cf_username: ${{secrets.CF_SERVICE_USER}}
cf_password: ${{secrets.CF_SERVICE_AUTH}}

deploy-development-ssb:
name: deploy (development-ssb)
environment: development-ssb
runs-on: ubuntu-latest
# needs:
# - create-cloudgov-services-development-ssb
needs:
- create-cloudgov-services-development-ssb
steps:
- name: checkout
uses: actions/checkout@v2
# - name: build dependencies
# run: |
# chmod -R 777 logstash
# PWD=`pwd` make logstash-installation
- name: build dependencies
run: |
chmod -R 777 logstash
PWD=`pwd` make logstash-installation
- name: deploy-logstash
uses: cloud-gov/cg-cli-tools@main
with:
Expand All @@ -45,10 +45,10 @@ jobs:
cf_space: development-ssb
cf_username: ${{secrets.CF_SERVICE_USER}}
cf_password: ${{secrets.CF_SERVICE_AUTH}}
# - name: smoke test logstash
# run: |
# sleep 150 # Logstash is very slow to start up
# [ "401" = "$(curl -w '%{http_code}' --output /dev/null --silent https://logstash-development-datagov.app.cloud.gov)" ]
- name: smoke test logstash
run: |
sleep 150 # Logstash is very slow to start up
[ "401" = "$(curl -w '%{http_code}' --output /dev/null --silent https://logstash-development-datagov.app.cloud.gov)" ]
drain-apps-in-development-ssb:
name: drain apps in development-ssb space
Expand All @@ -69,21 +69,21 @@ jobs:
cf_username: ${{secrets.CF_SERVICE_USER}}
cf_password: ${{secrets.CF_SERVICE_AUTH}}

# drain-apps-in-development:
# name: drain apps in development space
# environment: development
# runs-on: ubuntu-20.04
# # needs:
# # - deploy-development-ssb
# steps:
# - name: checkout
# uses: actions/checkout@v2
# - name: drain-development-space
# uses: cloud-gov/cg-cli-tools@main
# with:
# command: |
# ./create-space-drain.sh development-ssb
# cf_org: gsa-datagov
# cf_space: development
# cf_username: ${{secrets.CF_SERVICE_USER}}
# cf_password: ${{secrets.CF_SERVICE_AUTH}}
drain-apps-in-development:
name: drain apps in development space
environment: development
runs-on: ubuntu-20.04
needs:
- deploy-development-ssb
steps:
- name: checkout
uses: actions/checkout@v2
- name: drain-development-space
uses: cloud-gov/cg-cli-tools@37d58fc10abf00a45926e8886879c81a498f7ea8
with:
command: |
./create-space-drain.sh development-ssb
cf_org: gsa-datagov
cf_space: development
cf_username: ${{secrets.CF_SERVICE_USER}}
cf_password: ${{secrets.CF_SERVICE_AUTH}}
55 changes: 20 additions & 35 deletions create-space-drain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,29 @@ drain_name=${2:-logstack-shipper}
prefix=${3:-logstack}

# # install drain plugin if it isn't installed
# if ! cf plugins | grep -q drain; then
# echo "cf-drain-cli plugin not found. Installing..."
# curl -L -o drain-plugin https://github.com/cloudfoundry/cf-drain-cli/releases/download/v2.0.0/cf-drain-cli-linux --insecure &&
# cf install-plugin -f drain-plugin &&
# rm -f drain-plugin &&
# mkdir -p /root/.cf/ && touch /root/.cf/config.json &&
# echo "cf-drain-cli plugin installed successfully."
# else
# echo "cf-drain-cli plugin already exists."
# fi
if ! cf plugins | grep -q drain; then
echo "cf-drain-cli plugin not found. Installing..."
apt install jq curl -y &&
curl -L -o drain-plugin https://github.com/cloudfoundry/cf-drain-cli/releases/download/v2.0.0/cf-drain-cli-linux --insecure &&
cf install-plugin -f drain-plugin &&
rm -f drain-plugin &&
mkdir -p /root/.cf/ && touch /root/.cf/config.json &&
echo "cf-drain-cli plugin installed successfully."
else
echo "cf-drain-cli plugin already exists."
fi

# If the app already exists, exit early/successfully
# cf app "${prefix}-space-drain" > /dev/null 2>&1 && echo "Drain already exists." && exit 0
cf app "${prefix}-space-drain" > /dev/null 2>&1 && echo "Drain already exists." && exit 0

echo "test... downloading..."
apt install jq curl -y
curl -L -o logstash/drain-plugin https://github.com/cloudfoundry/cf-drain-cli/releases/download/v2.0.0/cf-drain-cli-linux --insecure
echo "test... finish download..."
# echo "test ... linux version"
# cat /etc/lsb-release
pwd
ls -l
uname -a
cd logstash
# ldd drain-plugin
# echo "test...> ls /github/home/.cf"
# ls /github/home/.cf
# echo "test...> ls /github/home/.cf/plugins"
# ls /github/home/.cf/plugins
# echo "test...> ls /github/home/.cf/plugins/temp3349476163/"
# ls /github/home/.cf/plugins/temp3349476163/
echo "test... Installing..."
# chmod 755 drain-plugin
ls -l
cf install-plugin -f drain-plugin
rm -f drain-plugin
mkdir -p /root/.cf/ && touch /root/.cf/config.json &&
echo "test cf-drain-cli plugin installed successfully."
# echo "cf-drain-cli plugin not found. Downloading..."
# apt install jq curl -y
# curl -L -o drain-plugin https://github.com/cloudfoundry/cf-drain-cli/releases/download/v2.0.0/cf-drain-cli-linux --insecure
# echo "Installing cf-drain-cli plugin ..."
# cf install-plugin -f drain-plugin
# rm -f drain-plugin
# mkdir -p /root/.cf/ && touch /root/.cf/config.json &&
# echo "cf-drain-cli plugin installed successfully."


space=$(cf target | grep space: | cut -d : -f 2 | sed s/\ //g)
Expand Down

0 comments on commit 28d7af3

Please sign in to comment.