-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #536 from EyeSeeTea/feature/support-dhis2-40-86942…
…d0mj Support DHIS2 40.0
- Loading branch information
Showing
20 changed files
with
380 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,4 @@ bak/ | |
src/dev | ||
.eslintcache | ||
/server | ||
deploy/auth.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
set -e -u -o pipefail | ||
|
||
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
zipfile=data-management-app.zip | ||
|
||
debug() { | ||
echo "$@" >&2 | ||
} | ||
|
||
build_app() { | ||
test "${SKIP_BUILD:-}" && return 0 | ||
debug "Build App" | ||
yarn build-webapp | ||
} | ||
|
||
deploy_app() { | ||
local url=$1 auth=$2 | ||
test "${SKIP_DEPLOY_APP:-}" && return 0 | ||
|
||
debug "Post App: $zipfile -> $url" | ||
curl -X POST -u "$auth" -v -F file=@"$zipfile" "$url/api/apps" | ||
} | ||
|
||
build_and_deploy() { | ||
local url=$1 auth=$2 host=${3:-} | ||
|
||
build_app | ||
deploy_app "$url" "$auth" | ||
if test "$host"; then | ||
bash "$script_dir/deploy-scripts.sh" "$host" | ||
fi | ||
|
||
echo "Done" | ||
} | ||
|
||
build_and_deploy "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e -u -o pipefail | ||
|
||
# Actions: | ||
# | ||
# - In PRO: Create docker image and push to Harbor. | ||
# - In TEST: Pull docker from Harbor and start. | ||
|
||
# Requirements: Open vendorlink (spintldhis01, stintldhis01) | ||
|
||
cd "$(dirname "$0")" | ||
source "./lib.sh" | ||
|
||
run spintldhis01 bash push-pro-docker.sh | ||
run stintldhis01 bash deploy-test-from-pro.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
# shellcheck disable=SC2029 | ||
set -e -u -o pipefail | ||
|
||
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
|
||
debug() { | ||
echo "$@" >&2 | ||
} | ||
|
||
get_current_branch() { | ||
git rev-parse --abbrev-ref HEAD | ||
} | ||
|
||
deploy_scripts() { | ||
local host=$1 | ||
|
||
local current_branch | ||
current_branch=$(get_current_branch) | ||
debug "Deploy branch: $current_branch -> $host" | ||
|
||
rsync -v "$script_dir/deploy-remote-scripts.sh" "$host:" | ||
ssh "$host" "sudo bash deploy-remote-scripts.sh $current_branch" | ||
} | ||
|
||
deploy_scripts "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
set -e -u -o pipefail | ||
|
||
cd "$(dirname "$0")" | ||
script_dir=$(pwd) | ||
source "./lib.sh" | ||
source "./tasks.sh" | ||
|
||
image_test="docker.eyeseetea.com/samaritans/dhis2-data:40.4.0-sp-ip-test" | ||
|
||
start_from_pro() { | ||
local url=$1 | ||
local image_test_running | ||
|
||
image_test_running=$(d2-docker list | grep RUN | awk '{print $1}' | grep -m1 ip-test) || true | ||
if test "$image_test_running"; then | ||
d2-docker commit "$image_test_running" | ||
d2-docker copy "$image_test_running" "backup/sp-ip-test-$(timestamp)" | ||
d2-docker stop "$image_test_running" | ||
fi | ||
|
||
d2-docker pull "$image_pro" | ||
d2-docker copy "$image_pro" "$image_test" | ||
sudo image=$image_test /usr/local/bin/start-dhis2-test | ||
|
||
wait_for_dhis2_server "$url" | ||
} | ||
|
||
post_clone() { | ||
local url=$1 | ||
|
||
#set_email_password "$url" | ||
change_server_name "$url" "SP Platform - Test" | ||
set_logos "$url" "$script_dir/test-icons" | ||
} | ||
|
||
main() { | ||
local url | ||
url=$(get_url 80) | ||
|
||
start_from_pro "$url" | ||
post_clone "$url" | ||
} | ||
|
||
main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.