diff --git a/.gitignore b/.gitignore index 07ef744..3d655c3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ build.* *.sw? downloads/ jenkins/*.xml +jenkins-cli.jar diff --git a/Makefile b/Makefile index 71aa12c..2d1d3f4 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,17 @@ BUILD_TARGET_sysmocom-alix = "core-image-minimal-initramfs meta-toolchain-osmo t BUILD_TARGETS="$(BUILD_TARGET_$(CUR_MACHINE))" # Jenkins jobs... -JOB_FILES=merge_diff.xml nightly.xml show_diff.xml test_upgrade_alix.xml test_upgrade_apu2.xml testbranch.xml testing.xml +JOB_FILES=merge_diff.xml nightly.xml show_diff.xml testing.xml test_upgrade_alix.xml test_upgrade_apu2.xml testbranch.xml +JOB_NAME_merge_diff.xml=$(SYSMOCOM_RELEASE)-merge-diff +JOB_NAME_nightly.xml=$(SYSMOCOM_RELEASE)-nightly +JOB_NAME_show_diff.xml=$(SYSMOCOM_RELEASE)-show-diff +JOB_NAME_testing.xml=$(SYSMOCOM_RELEASE)-testing +JOB_NAME_test_upgrade_alix.xml=$(SYSMOCOM_RELEASE)-test-upgrade-alix +JOB_NAME_test_upgrade_apu2.xml=$(SYSMOCOM_RELEASE)-test-upgrade-apu2 +JOB_NAME_testbranch.xml=$(SYSMOCOM_RELEASE)-testbranch +JOB_NAME="$(JOB_NAME_$(job))" +VIEW_FILES=view.xml +ALL_JENKINS_FILES=$(JOB_FILES) $(VIEW_FILES) SED=sed # @@ -174,14 +184,41 @@ endif @echo " User = $(SSH_USER)" >> $(HOME)/.ssh/config # Create jenkin job xmls -create-jenkins-jobs: - $(Q)$(foreach file, $(JOB_FILES), \ +create-jenkins-jobs-xml: + $(Q)$(foreach file, $(ALL_JENKINS_FILES), \ cat jenkins/job_templates/$(file) | \ $(SED) \ -e s,PLACEHOLDER_SYSMOCOM_RELEASE,$(SYSMOCOM_RELEASE),g \ -e s,PLACEHOLDER_POKY_RELEASE,$(POKY_RELEASE),g > jenkins/$(file); \ ) + +create-jenkins-jobs: create-jenkins-jobs-xml jenkins-cli.jar +ifndef JENKINS_HOST + $(error "Please call with make $@ JENKINS_HOST=xyz...") +endif +ifndef JENKINS_USER + $(error "Please call with make $@ JENKINS_USER=xyz...") +endif +ifndef JENKINS_PASS + $(error "Please call with make $@ JENKINS_PASS=xyz...") +endif + $(Q)$(foreach view, $(VIEW_FILES), \ + cat jenkins/$(view) | java -jar jenkins-cli.jar -s http://$(JENKINS_HOST) \ + create-view --username $(JENKINS_USER) --password $(JENKINS_PASS); \ + ) + $(Q)$(foreach job, $(JOB_FILES), \ + cat jenkins/$(job) | java -jar jenkins-cli.jar -s http://$(JENKINS_HOST) \ + create-job --username $(JENKINS_USER) --password $(JENKINS_PASS) $(JOB_NAME); \ + ) + +jenkins-cli.jar: +ifndef JENKINS_HOST + $(error "Please call with make $@ JENKINS_HOST=xyz...") +endif + wget http://$(JENKINS_HOST)/jnlpJars/jenkins-cli.jar + + # Target classification -.PHONY: update setup-all install-ssh-config create-jenkins-jobs +.PHONY: update setup-all install-ssh-config create-jenkins-jobs-xml create-jenkins-jobs .SECONDARY: $(foreach repo, $(REPOS), git/$(repo)) $(foreach machine, $(MACHINES), build.$(machine)) diff --git a/jenkins/job_templates/view.xml b/jenkins/job_templates/view.xml new file mode 100644 index 0000000..13bc850 --- /dev/null +++ b/jenkins/job_templates/view.xml @@ -0,0 +1,29 @@ + + + System Images PLACEHOLDER_SYSMOCOM_RELEASE + false + false + + + + PLACEHOLDER_SYSMOCOM_RELEASE-merge-diff + PLACEHOLDER_SYSMOCOM_RELEASE-nightly + PLACEHOLDER_SYSMOCOM_RELEASE-show-diff + PLACEHOLDER_SYSMOCOM_RELEASE-test-upgrade-alix + PLACEHOLDER_SYSMOCOM_RELEASE-test-upgrade-apu2 + PLACEHOLDER_SYSMOCOM_RELEASE-testbranch + PLACEHOLDER_SYSMOCOM_RELEASE-testing + Yocto-Master + + + + + + + + + + + + false +