@@ -6,6 +6,8 @@ exec 1>/tmp/user_data_log.out 2>&1
6
6
# Below variable is resolved during the rendering of the Terraform template file.
7
7
SSH_PUBKEY=" SSH_PUBKEY_HERE"
8
8
CIPHER_TEXT=" CIPHER_TEXT_HERE"
9
+ export GITHUB_ACCESS_TOKEN=" GITHUB_TOKEN_HERE"
10
+ export CI_USER=" CI_USER_HERE"
9
11
DEPLOY_SCRIPT_BRANCH=" DEPLOY_SCRIPT_BRANCH_HERE" # Deployment repo: https://github.com/izyak/icon-ibc.git
10
12
KMS_ID=" KMS_ID_HERE"
11
13
DEPLOYR_HOME=" /home/deployr"
@@ -37,7 +39,7 @@ sysctl -p
37
39
# Update OS Packages
38
40
apt-get update
39
41
apt-get upgrade -y
40
-
42
+ apt-get install expect -y
41
43
42
44
cat << 'EOF ' >> /etc/profile
43
45
# Setup ENV and command history loging
@@ -73,11 +75,39 @@ mkdir -p /opt/deployer/{bin,root}
73
75
mkdir -p /opt/deployer/root/{keystore,keyutils}
74
76
75
77
# Clone repo
76
- cd /opt/deployer/root/ && git clone https://github.com/izyak/icon-ibc.git
77
- cd icon-ibc
78
+ cat << 'EOF ' > clone.expect
79
+ #!/usr/bin/expect -f
80
+
81
+ # Set the GitHub credentials from arguments
82
+ set timeout -1
83
+ set username [lindex $argv 0]
84
+ set token [lindex $argv 1]
85
+ set repo_url "https://github.com/icon-project/devnet.git"
86
+ set target_dir "/opt/deployer/root/ibc-devops"
87
+
88
+ # Clone the repository
89
+ spawn git clone $repo_url $target_dir
90
+ expect "Username for 'https://github.com':"
91
+ send "$username\r"
92
+ expect "Password for 'https://$username@github.com':"
93
+ send "$token\r"
94
+ expect eof
95
+ EOF
96
+
97
+ chmod +x clone.expect
98
+ git config --global credential.helper " cache --timeout=604800"
99
+ ./clone.expect " $CI_USER " " $GITHUB_ACCESS_TOKEN "
100
+ CI_USER_ESCAPED=" $$ {CI_USER//@/%40}"
101
+ echo -e " [credential]\n\thelper = store" >> ~ /.gitconfig
102
+ echo " https://$$ {CI_USER_ESCAPED}.com:$$ {GITHUB_ACCESS_TOKEN}@gihub.com" > ~ /.git-credentials
103
+
104
+ cd /opt/deployer/root/ibc-devops
78
105
git checkout $$ {DEPLOY_SCRIPT_BRANCH}
79
106
cd ..
80
- cp -r icon-ibc/deployer/* /opt/deployer
107
+ mv /ibc-devops /opt/deployer/root
108
+ cd /opt/deployer/root/
109
+ cp -r ibc-devops/Deployments/relayer/deployer/* /opt/deployer
110
+
81
111
82
112
# Create user & configure ssh access
83
113
useradd -m -d $$ {DEPLOYR_HOME} -s /bin/bash deployr
@@ -107,7 +137,7 @@ go install github.com/icon-project/goloop/cmd/goloop@latest
107
137
# Install archway
108
138
wget -q https://github.com/archway-network/archway/releases/download/v$$ {ARCHWAY_VERS}/archway_$$ {ARCHWAY_VERS}_linux_amd64.zip
109
139
unzip archway_$$ {ARCHWAY_VERS}_linux_amd64.zip
110
- sudo archwayd /usr/local/bin
140
+ sudo cp archwayd /usr/local/bin
111
141
112
142
# Install injectived
113
143
wget -q https://github.com/InjectiveLabs/injective-chain-releases/releases/download/v$$ {INJECTIVE_VERS}/linux-amd64.zip
@@ -122,6 +152,15 @@ wget -q https://github.com/neutron-org/neutron/releases/download/v$${NEUTRON_VER
122
152
sudo cp neutrond-linux-amd64 /usr/local/bin/neutrond
123
153
sudo chmod +x /usr/local/bin/neutrond
124
154
155
+ # Install sui
156
+ wget -q https://github.com/MystenLabs/sui/releases/download/$$ {SUI_VERS}/sui-$$ {SUI_VERS}-ubuntu-x86_64.tgz
157
+ sudo tar xf sui-$$ {SUI_VERS}-ubuntu-x86_64.tgz -C /usr/local/bin
158
+ sudo chmod +x /usr/local/bin/sui
159
+
160
+ # Install Dasel
161
+ sudo wget -qO /usr/local/bin/dasel https://github.com/TomWright/dasel/releases/latest/download/dasel_linux_amd64
162
+ sudo chmod a+x /usr/local/bin/dasel
163
+
125
164
# Install boto3, yq, and jq
126
165
apt-get install python3-pip -y
127
166
pip3 install boto3
0 commit comments