chore: refactor build and deployment processes
- Add `sudo` to the apk add command in the lint workflow - Add SSH server setup to the Makefile Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
a5f89304fd
commit
222545746b
|
@ -34,7 +34,7 @@ jobs:
|
|||
|
||||
- name: setup sshd server
|
||||
run: |
|
||||
apk add git make curl perl bash build-base zlib-dev ucl-dev
|
||||
apk add git make curl perl bash build-base zlib-dev ucl-dev sudo
|
||||
make ssh-server
|
||||
|
||||
- name: testing
|
||||
|
|
9
Makefile
9
Makefile
|
@ -104,6 +104,15 @@ ssh-server:
|
|||
cat tests/.ssh/test.pub >> /home/drone-scp/.ssh/authorized_keys
|
||||
chmod 600 /home/drone-scp/.ssh/authorized_keys
|
||||
chown -R drone-scp /home/drone-scp/.ssh
|
||||
# add public key to root user
|
||||
mkdir -p /root/.ssh
|
||||
chmod 700 /root/.ssh
|
||||
cat tests/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
|
||||
cat tests/.ssh/test.pub >> /root/.ssh/authorized_keys
|
||||
chmod 600 /root/.ssh/authorized_keys
|
||||
# Append the following entry to run ALL command without a password for a user named drone-scp:
|
||||
cat tests/sudoers >> /etc/sudoers.d/sudoers
|
||||
# install ssh and start server
|
||||
apk add --update openssh openrc
|
||||
rm -rf /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_dsa_key
|
||||
sed -i 's/^#PubkeyAuthentication yes/PubkeyAuthentication yes/g' /etc/ssh/sshd_config
|
||||
|
|
Loading…
Reference in New Issue