Skip to content
Permalink
Browse files

tests: update AWS CI setup

  • Loading branch information...
lucab committed Dec 21, 2016
1 parent 4e6437a commit 89b857a6c9075e5982414f0c5d3db2b7f4148493
@@ -2,6 +2,7 @@

.cache
.vagrant
*.pem
/.config.args
/Makefile
/acbuild
@@ -26,23 +26,19 @@ DISTRO=$1
test -f cloudinit/${DISTRO}.cloudinit
CLOUDINIT=$PWD/cloudinit/${DISTRO}.cloudinit

if [ "$DISTRO" = "fedora-22" ] ; then
if [ "$DISTRO" = "fedora-24" ] ; then
# https://getfedora.org/en/cloud/download/
# Search on aws --region $REGION or look at
# https://apps.fedoraproject.org/datagrepper/raw?category=fedimg
# Sources: https://github.com/fedora-infra/fedimg/blob/develop/bin/list-the-amis.py

# Fedora-Cloud-Base-22-20160218.x86_64-us-west-1-HVM-standard-0
AMI=ami-e291e082
AWS_USER=fedora
elif [ "$DISTRO" = "fedora-23" ] ; then
# Fedora-Cloud-Base-23-20151030.x86_64-us-west-1-HVM-standard-0
AMI=ami-a6fc90c6
AWS_USER=fedora
elif [ "$DISTRO" = "fedora-24" ] ; then
# Fedora-Cloud-Base-24-20160507.n.0.x86_64-us-west-1-HVM-standard-0
AMI=ami-8b4c35eb
AWS_USER=fedora
elif [ "$DISTRO" = "fedora-25" ] ; then
# Fedora-Cloud-Base-25-20161220.0.x86_64-us-west-1-HVM-standard-0
AMI=ami-c70d5ca7
AWS_USER=fedora
elif [ "$DISTRO" = "fedora-rawhide" ] ; then
# Fedora-Cloud-Base-rawhide-20160129.x86_64-us-west-1-HVM-standard-0
AMI=ami-a18dfac1
@@ -52,22 +48,11 @@ elif [ "$DISTRO" = "ubuntu-1604" ] ; then
# ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20160627
AMI=ami-b20542d2
AWS_USER=ubuntu
elif [ "$DISTRO" = "ubuntu-1510" ] ; then
# https://cloud-images.ubuntu.com/locator/ec2/
# ubuntu/images/hvm-instance/ubuntu-wily-15.10-amd64-server-20160715
AMI=ami-cee8aeae
AWS_USER=ubuntu
elif [ "$DISTRO" = "debian" ] ; then
elif [ "$DISTRO" = "debian-testing" ] ; then
# https://wiki.debian.org/Cloud/AmazonEC2Image/Jessie
# Debian 8.4
AMI=ami-45374b25
# Debian 8.6+1
AMI=ami-db6c39bb
AWS_USER=admin
elif [ "$DISTRO" = "centos" ] ; then
# Needs to subscribe first, see:
# https://wiki.centos.org/Cloud/AWS
# CentOS-7 x86_64 HVM
AMI=ami-af4333cf
AWS_USER=centos
fi

test -n "$AMI"
@@ -122,7 +107,7 @@ do
done


NAME=$DISTRO-rkt-test-$(date +"%d-%m-%Y")
NAME=rkt-ci-jenkins-$(date +"%Y-%m-%d")-$DISTRO
AMI_ID=$(aws --region $REGION ec2 create-image --instance-id $INSTANCE_ID --name $NAME --output text)

echo -e "\nWaiting for the AMI to be avaliable..."
@@ -132,8 +117,6 @@ do
sleep 30
done

aws --region $REGION ec2 modify-image-attribute --image-id $AMI_ID --launch-permission "{\"Add\":[{\"Group\":\"all\"}]}"

echo -e "\nRemoving instance..."

aws --region $REGION ec2 terminate-instances --instance-ids $INSTANCE_ID --output text
@@ -11,5 +11,5 @@ DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y --force-yes -o Dpkg::Opti
DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes build-essential autoconf
DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" squashfs-tools patch gnupg golang dbus libacl1-dev systemd-container libssl-dev libsystemd-dev libpam-systemd
DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" default-jre
DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" git patch bc tar xz-utils openssl
DEBIAN_FRONTEND=noninteractive apt-get build-dep -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" systemd
DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" git

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,25 @@
#!/bin/bash

set -e
set -x

# ---pretend-input-tty (with 3 dashes) is an undocumented feature of parted
parted /dev/xvda ---pretend-input-tty resizepart 1 yes 100%
resize2fs /dev/xvda1

chmod 755 /home/fedora

dnf -y -v update
dnf -y -v groupinstall "Development Tools" "C Development Tools and Libraries"
# systemd-container only available in newer versions of Fedora
dnf -y -v install systemd-container || true
dnf -y -v install java || true
dnf -y -v install iptables || true
dnf -y -v install systemd-devel || true
dnf -y -v install iptables intltool || true
dnf -y -v distro-sync
dnf -y -v install wget squashfs-tools patch glibc-static gnupg golang libacl-devel file openssl-devel bc
dnf -y -v builddep systemd

groupadd rkt || true
gpasswd -a fedora rkt || true
@@ -22,3 +22,13 @@ dnf -y -v install iptables intltool

groupadd rkt || true
gpasswd -a fedora rkt || true

cat << EOF > /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet
USERCTL=yes
PEERDNS=yes
IPV6INIT=no
EOF

0 comments on commit 89b857a

Please sign in to comment.
You can’t perform that action at this time.