-
Notifications
You must be signed in to change notification settings - Fork 7
Continuous Integration for Firmware
Matt Bartos edited this page Dec 22, 2019
·
18 revisions
- Create a new EC2 instance running the latest version of ubuntu with greater than 10 GB allocated to the root directory (I will use 20 GB).
- Open inbound ports 8080, 8086, and 50000
- Log in to the server via ssh
- Install docker: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04
- Follow the instructions for installing jenkins using docker: https://jenkins.io/doc/book/installing/
- These instructions are reproduced here:
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce
sudo docker run \
-u root \
--rm \
-d \
-p 8080:8080 \
-p 50000:50000 \
-v jenkins-data:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
jenkinsci/blueocean
- Run the post-installation setup wizard: https://jenkins.io/doc/book/installing/#setup-wizard
- In general, this step will entail visiting
http://your_jenkins_instance:8080and following the step-by-step instructions.
- In general, this step will entail visiting
- Under
Manage Jenkins -> Manage Plugins -> Updates, make sure that all plugins are up to date. - Under
Manage Jenkins -> Manage Plugins -> Available, install theBuild Timestampplugin.
- Under
Manage Jenkins -> Configure System -> Global propertiesadd the environment variable:- Environment Variable
- Name: PYTHONWARNINGS
- Value: ignore
- Environment Variable
- Under
Manage Jenkins -> Configure System -> Build-timeout Plugin > BuildStep Action- Enable BuildStep Action.
- Under
Manage Jenkins -> Configure System -> Build timestamp- Enable
BUILD_TIMESTAMP - Set the build timestamp pattern to:
yyyy-MM-dd'T'HH:mm:ss'Z'
- Enable
- Under
New ItemaddGitHub Organizationwith item nameopen-storm.- On the following screen, use the default configuration.
- Use the
Scan Organizationoption to detect all repositories with a JenkinsFile.
- Navigate to
Manage Jenkins -> Manage Nodesand add a new node. - Specify the node type as
Permanent Agent. - Make sure that the new node is named
klab. - Add
klabto Labels. - Set the
Remote root directorytoC:\Jenkins\ - Under
Launch Method, selectLaunch agent by connecting it to the master - On the agent machine (i.e. the local windows machine you are using to build the psoc project), navigate to
http://your_jenkins_instance:8080/computer/klab/and click the orange button labeledLaunch agent from browserto download the java app. Ensure you have the latest version of java, and then run the downloaded app.
- Under
Nodes -> klab -> Configure, set the following environment variables:- Environment Variable
- Name: CYPRJMGR
- Value:
"C:\Program Files (x86)\Cypress\PSoC Creator\%PSOC_VER%\PSoC Creator\bin\cyprjmgr.exe"
- Environment Variable
- Name: GIT
- Value:
"C:\Program Files\Git\cmd\git.exe"
- Environment Variable
- Name: PSOC_VER
- Value: 4.1
- Environment Variable
- Name: PYTHONUNBUFFERED
- Value: 1
- Environment Variable
- Name: PYTHONWARNINGS
- Value: ignore
- Environment Variable
Jenkins will not have access to the infuxdb logs by default. To give jenkins permission to access the logs, use the following command at the host level:
sudo docker exec -it <jenkins-container-name> adduser jenkins ping
Dockerfile may need to be edited: https://stackoverflow.com/questions/52244826/jenkins-in-a-docker-container-how-do-i-install-custom-python-libraries
See this guide for influxdb setup: https://blog.laputa.io/try-influxdb-and-grafana-by-docker-6b4d50c6a446
See this guide for setting up agent: https://stackoverflow.com/questions/40340097/there-is-no-launch-agent-via-java-web-start-option-in-my-jenkins-when-i-adding