Commit 4edebe6d authored by Chaoting Liu's avatar Chaoting Liu

populate and initialize pacman-keyring during preparation

parent 97dccc2b
......@@ -246,7 +246,7 @@ function build_packages() {
pushd $p
_log command "Building pkg: $p"
_do makepkg --noconfirm --rmdeps --noprogressbar --nosign --syncdeps --cleanbuild --log --config ~/.makepkg.conf
_do makepkg --noconfirm --rmdeps --noprogressbar --sign --syncdeps --cleanbuild --log --config ~/.makepkg.conf
popd
done
......
......@@ -5,12 +5,6 @@ source "$SCRIPT_DIR/lib/ci-library.sh"
# SSH setup
_log command "SSH setup"
# Run ssh-agent (inside the build environment)
_do eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
_do ssh-add <(echo "$SSH_PRIVATE_KEY")
# For Docker builds disable host key checking. Be aware that by adding that
# you are suspectible to man-in-the-middle attacks.
# WARNING: Use this only with the Docker executor, if you use it with shell
......@@ -22,18 +16,36 @@ _do ssh-add <(echo "$SSH_PRIVATE_KEY")
# instead.
_do mkdir -p ~/.ssh
[[ -f /.dockerenv ]] && echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
_do chmod 600 ~/.ssh/id_rsa
_do chmod 700 ~/.ssh
# Run ssh-agent (inside the build environment)
_do eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
_do ssh-add ~/.ssh/id_rsa
# GPG setup
_log command "GPG setup"
# Configure gpg.conf
_do echo "keyserver-options auto-key-retrieve
auto-key-locate local,wkd
pinentry-mode loopback
passphrase $GPG_PASSPHRASE" >> ~/.gnupg/gpg.conf
_do gpg -v --batch --import <(echo "$GPG_PRIVATE_KEY")
# Configure gpg-agent.conf
_do echo "allow-loopback-pinentry" > ~/.gnupg/gpg-agent.conf
_do gpg-connect-agent reloadagent /bye
# Fetch public key and locally sign via pacman-keyring
gpg --recv-keys "$GPGKEY"
sudo pacman-key --init
sudo pacman-key --populate chakra
sudo pacman-key --refresh-keys
sudo pacman-key -r "$GPGKEY"
sudo pacman-key --lsign-key "$GPGKEY"
# prepare the build environment
_log command "Setting up locale.gen..."
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
_do locale-gen
# List locale order
_do locale -a
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment