Commit 048f13f1 authored by Chaoting Liu's avatar Chaoting Liu
Browse files,

parent cc43db3b
#!/usr/bin/env bash
SCRIPT_DIR=$( dirname $( readlink -e $0 ) )
source "$SCRIPT_DIR/lib/"
_do list_packages
# `gpg --recv-key` requires write access to the current user's home directory!
for server in $(shuf -e \
hkp:// \ \
hkp:// \ ; do
gpg --keyserver "$server" --recv-keys $(get_validpgpkeys) && break || : ;
......@@ -2,14 +2,39 @@
SCRIPT_DIR=$( dirname $( readlink -e $0 ) )
source "$SCRIPT_DIR/lib/"
# Fetch public key and locally sign via pacman-keyring
_do pacman-key --init
_do pacman-key --populate chakra
if pacman-key --refresh-keys; then echo 'failed to refresh keys'; fi
# 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
# you will overwrite your user's SSH config.
#- mkdir -p ~/.ssh
#- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
# In order to properly check the server's host key, assuming you created the
# SSH_SERVER_HOSTKEYS variable previously, uncomment the following two lines
# instead.
_do mkdir -p ~/.ssh
[[ -f /.dockerenv ]] && echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
_do chmod 600 ~/.ssh/id_rsa
_do chmod 700 ~/.ssh
# GPG setup
_log command "GPG setup"
_do gpg -v --batch --import <(echo "$GPG_PRIVATE_KEY")
_do echo "allow-loopback-pinentry" > ~/.gnupg/gpg-agent.conf
_do gpg-connect-agent reloadagent /bye
# 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