fix for Init Action (#2980)
* should can work * didn't delete configmap for mpdev verify * done Co-authored-by: renmingu <40223865+renmingu@users.noreply.github.com>
This commit is contained in:
parent
122c39db8d
commit
545de31eec
|
|
@ -9,9 +9,19 @@ RUN tar -C /usr/local/gcloud -xf /tmp/google-cloud-sdk.tar.gz
|
|||
RUN /usr/local/gcloud/google-cloud-sdk/install.sh
|
||||
ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin
|
||||
|
||||
# move the old entrypoint, because mpdev tool will call it directly, whatever entrypoint is.
|
||||
# move the old entrypoint
|
||||
RUN mv /bin/deploy.sh /bin/core_deploy.sh
|
||||
ADD deployer/init_action.sh /bin/deploy.sh
|
||||
RUN mv /bin/deploy_with_tests.sh /bin/core_deploy_with_tests.sh
|
||||
|
||||
# RUN awk '{sub(/clean_iam_resources.sh/,"clean_action.sh\n\nclean_iam_resources.sh")}1' /bin/core_deploy_with_tests.sh > /bin/new_deploy_with_tests.sh
|
||||
|
||||
ADD deployer/init_action.sh /bin/init_action.sh
|
||||
RUN chmod 755 /bin/init_action.sh
|
||||
|
||||
ADD deployer/overlay_deploy.sh /bin/deploy.sh
|
||||
RUN chmod 755 /bin/deploy.sh
|
||||
|
||||
ADD deployer/overlay_deploy_with_tests.sh /bin/deploy_with_tests.sh
|
||||
RUN chmod 755 /bin/deploy_with_tests.sh
|
||||
|
||||
ENTRYPOINT ["/bin/bash", "/bin/deploy.sh"]
|
||||
|
|
@ -28,6 +28,12 @@ function set_bucket_and_configmap() {
|
|||
# Detect GCP project
|
||||
GCP_PROJECT_ID=$(curl -H "Metadata-Flavor: Google" -w '\n' "http://metadata.google.internal/computeMetadata/v1/project/project-id")
|
||||
|
||||
# Check whether ConfigMap is already exist
|
||||
if kubectl get configmap ${CONFIG_NAME}; then
|
||||
echo "Already has a configmap map there"
|
||||
return 0
|
||||
fi
|
||||
|
||||
for i in $(seq 1 ${NUM_RETRIES})
|
||||
do
|
||||
bucket_is_set=true
|
||||
|
|
@ -65,5 +71,4 @@ export NAMESPACE
|
|||
|
||||
set_bucket_and_configmap "${NAME}-default" 10
|
||||
|
||||
# Invoke normal deployer routine.
|
||||
/bin/bash /bin/core_deploy.sh
|
||||
echo "init_action done"
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2020 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
# Pre-install Init Action
|
||||
/bin/bash /bin/init_action.sh
|
||||
|
||||
# Invoke normal deployer routine.
|
||||
/bin/bash /bin/core_deploy.sh
|
||||
|
||||
# Return core deployment status
|
||||
code=$?
|
||||
echo "deployment return code: ${code}"
|
||||
exit $code
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2020 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
# Pre-install Init Action
|
||||
/bin/bash /bin/init_action.sh
|
||||
|
||||
# Invoke normal deployer routine.
|
||||
/bin/bash /bin/core_deploy_with_tests.sh
|
||||
|
||||
# Return core deployment status
|
||||
code=$?
|
||||
echo "deployment return code: ${code}"
|
||||
exit $code
|
||||
Loading…
Reference in New Issue