-
download Raspbian LITE here: https://www.raspberrypi.org/downloads/raspbian/
-
Insert a SD card into your computer.
-
Locate the device by running
sudo fdisk -l
. It will probably be the only disk about the right size. Note down the device name; let us suppose it is/dev/sdx
. If you are in any doubt, remove the card, runsudo fdisk -l
again and note down what disks are there. Insert the SD card again, runsudo fdisk -l
and it is the new disk. Unmount the partitions by runningsudo umount /dev/sdx*
. It may give an error saying the disk isn't mounted - that's fine. -
Copy the contents of the image file onto the SD card by running
sudo dd bs=1M if=your_image_file_name.img of=/dev/sdx
Of course, you'll need to change the name of the image file above as appropriate. !!Warning There is a significant risk of damage to your filesystem if you use the wrong/dev/sdx
. Make sure you get it right! -
Create an emty file called
ssh
and copy it to the root partition of the os (This enables SSH on first boot) -
OPTIONAL: if you want your pi to automaticaly connect to Wifi, have a look at this. Otherwise, a wired connection is required for first boot.
-
Insert the SD card into a Raspbery Pi and connect the device to power and your network (wired)
-
Find out what IP has been assigned to the Pi (via router or other means)
-
SSH onto the Pi:
ssh [email protected]
(example IP) Username: pi Password: raspberry -
Change password with
passwd
-
Configure with
sudo raspi-config
(network, locale, timezone). See this for more information -
Update
sudo apt-get update
sudo apt update --allow-releaseinfo-change
sudo apt-get upgrade
- Set static IP by edtiting the file
/etc/dhcpcd.conf
. Usenano /etc/dhcpcd.conf
and copy the following text:
interface eth0
static ip_address=192.168.0.201/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1 8.8.8.8
interface wlan0
static ip_address=192.168.0.202/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1 8.8.8.8
- Reboot after with
sudo shutdown -r now
and connect again via ssh (keep in mind the IP has now changed to the one you set)
- install Java 11:
sudo apt-get install openjdk-11-jre openjdk-11-jdk
- verify with
java -version
- Install Jeninks by running these commands:
wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins -y
-
Run
systemctl status jenkins.service
to check if Jenkins server is running -
Open your browser and navigate to http://RASP_IP:8080/ (for example: http://192.168.0.101:8080/) and follow the instructions there. Choose recomended options. When asked to set the Jenkins IP, you should set the outwards facing ip, not the local one (you may need to forward a port or some other configuration in your router) This will enable GitHub to to comunicate with Jenkins.
-
Navigate to Manage Jenkins -> Manage Plugins and install the following:
Blue Ocean
,GitHub Authentication
.
-
Run
sudo python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/develop/scripts/get-platformio.py)"
to install pip and PlatformIO Core -
Use
platformio --version
to check correct instalation -
Install 99-platformio-udev.rules by running
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/master/scripts/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules
-
Run the following commands to add Jenkins to the Dialout group (granting acces to usb ports) and to i2c, to grant access to i2c ports
sudo usermod -a -G plugdev jenkins
sudo usermod -a -G dialout jenkins
sudo usermod -a -G i2c jenkins
- Restart Jenkins with
sudo service jenkins restart
to apply permissions
-
Install git via
sudo apt-get install git
-
Install stm tools (might not b required):
sudo apt-get install gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi
sudo apt-get install openocd
sudo apt-get install libftdi1
- You might need to add Jenkins to the sudoers group, depending on what kind of tests you will be running. Di this with
usermod -a -G sudo jenkins
Then follow this to enable sudo with no password: https://embeddedartistry.com/blog/2017/11/16/jenkins-running-steps-as-sudo (in the Jenkinsfile, put sudo in front of commands that need sudo)
for a list of instructions on how to set up your pipeline see HERE