Skip to content

Commit

Permalink
872 update repo url in deployment script (#876)
Browse files Browse the repository at this point in the history
* ci: update devnet repo url

* ci: add git clone authentication
  • Loading branch information
DeepakBomjan authored Aug 9, 2024
1 parent 6bd2b05 commit 27bd93a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/deployer/init_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ exec 1>/tmp/user_data_log.out 2>&1
# Below variable is resolved during the rendering of the Terraform template file.
SSH_PUBKEY="SSH_PUBKEY_HERE"
CIPHER_TEXT="CIPHER_TEXT_HERE"
GITHUB_ACCESS_TOKEN="GITHUB_TOKEN_HERE"
CI_USER="CI_USER_HERE"
DEPLOY_SCRIPT_BRANCH="DEPLOY_SCRIPT_BRANCH_HERE" # Deployment repo: https://github.com/icon-project/ibc-devops.git
KMS_ID="KMS_ID_HERE"
DEPLOYR_HOME="/home/deployr"
Expand Down Expand Up @@ -38,7 +40,7 @@ sysctl -p
#Update OS Packages
apt-get update
apt-get upgrade -y

apt-get install expect -y

cat << 'EOF' >> /etc/profile
# Setup ENV and command history loging
Expand Down Expand Up @@ -74,7 +76,8 @@ mkdir -p /opt/deployer/{bin,root}
mkdir -p /opt/deployer/root/{keystore,keyutils}

# Clone repo
cd /opt/deployer/root/ && git clone https://github.com/icon-project/devnet.git ibc-devops
cd /opt/deployer/root/
./clone.sh "$CI_USER" "$GITHUB_ACCESS_TOKEN"
cd ibc-devops
git checkout $${DEPLOY_SCRIPT_BRANCH}
cd ..
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/run-deployer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
TF_VAR_subnet_id: "${{ secrets.SUBNET_ID }}"
TF_VAR_vpc_security_group_ids: "${{ secrets.SECURITY_GROUP_ID }}"
kms_id: "${{ secrets.LISBON_KMS_ID }}"
ci_user: "${{ secrets.CI_USER }}"
repo_token: "${{ secrets.DEVNET_REPO_ACCESS }}"
deployr_ssh_pub_key: "${{ github.event.inputs.deployr_ssh_pub_key }}"
deploy_script_branch: "${{ github.event.inputs.deploy_script_branch }}"

Expand All @@ -70,6 +72,8 @@ jobs:
sed -i "s|CIPHER_TEXT_HERE|$cipher_text|g" init_script.sh
sed -i "s|DEPLOY_SCRIPT_BRANCH_HERE|$deploy_script_branch|g" init_script.sh
sed -i "s|KMS_ID_HERE|$kms_id|g" init_script.sh
sed -i "s|GITHUB_TOKEN_HERE|$repo_token|g" init_script.sh
sed -i "s|CI_USER_HERE|$ci_user|g" init_script.sh
terraform init
terraform validate
terraform plan
Expand Down

0 comments on commit 27bd93a

Please sign in to comment.