Skip to content

Commit 2644123

Browse files
committed
ci: add script to add secret to aws secret manager
1 parent cd24a19 commit 2644123

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

.github/deployer/init_script.sh

+50-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ systemctl enable auditd
6464
systemctl start auditd
6565

6666

67+
6768
# Configure auditd
6869
echo '-a always,exit -F arch=b64 -S execve -k command-exec
6970
-a always,exit -F arch=b32 -S execve -k command-exec' >> /etc/audit/audit.rules
@@ -164,13 +165,59 @@ sudo chmod a+x /usr/local/bin/dasel
164165

165166
# Install boto3, yq, and jq
166167
apt-get install python3-pip -y
167-
pip3 install boto3
168+
pip3 install boto3 pwinput
168169
apt-get install jq -y
169170
wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
170171
chmod +x /usr/local/bin/yq
171172

173+
## Install rust
174+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup-init.sh
175+
176+
cat << 'EOF' > cargo.expect
177+
#!/usr/bin/expect
178+
set timeout -1
179+
spawn sh rustup-init.sh
180+
expect "1) Proceed with standard installation (default - just press enter)"
181+
send "\r"
182+
expect {
183+
"2) Customize installation" {
184+
send "\r"
185+
exp_continue
186+
}
187+
"3) Cancel installation" {
188+
send "\r"
189+
exp_continue
190+
}
191+
eof
192+
}
193+
EOF
194+
195+
source "$HOME/.cargo/env"
196+
197+
## Install solana
198+
sudo apt-get install -y pkg-config build-essential libudev-dev libssl-dev
199+
cargo install --git https://github.com/coral-xyz/anchor avm --locked --force
200+
avm install 0.30.1
201+
172202
cd -
173203

204+
# Create sui client config
205+
cat <<EOF > /root/.sui/sui_config/sui.keystore
206+
keystore:
207+
File: /root/.sui/sui_config/sui.keystore
208+
envs:
209+
- alias: testnet
210+
rpc: "https://fullnode.testnet.sui.io:443"
211+
ws: ~
212+
basic_auth: ~
213+
- alias: mainnet
214+
rpc: "https://fullnode.mainnet.sui.io:443"
215+
ws: ~
216+
basic_auth: ~
217+
active_env: mainnet
218+
active_address: "0x539c665cd9899d040c56756df8f7ed34649ab6aeae28da5cb07d3274dc9f9d36"
219+
EOF
220+
174221
# Configure sudo
175222
echo 'deployr ALL=(ALL) NOPASSWD: /opt/deployer/bin/run.sh
176223
deployr ALL=(ALL) NOPASSWD: /opt/deployer/bin/fetch_keys.sh
@@ -188,5 +235,7 @@ alias pull-deploy-script='sudo /opt/deployer/bin/update_git.sh'
188235
alias check-env='sudo /opt/deployer/bin/check-parameter.sh'
189236
alias make='sudo /opt/deployer/bin/deploy.sh'" >> $${DEPLOYR_HOME}/.bashrc
190237

238+
echo "## Aliases
239+
alias add-secrets='/opt/deployer/root/keyutils/add_secret.sh'" >> /root/.bashrc
191240
chmod 400 /tmp/user_data_log.out || true
192241

0 commit comments

Comments
 (0)