Path: blob/master/buildenv/ansible/roles/openj9-from-sources/tasks/main.yml
13461 views
###############################################################################1# Copyright (c) 2018, 2018 Pavel Samolysov2#3# This program and the accompanying materials are made available under4# the terms of the Eclipse Public License 2.0 which accompanies this5# distribution and is available at https://www.eclipse.org/legal/epl-2.0/6# or the Apache License, Version 2.0 which accompanies this distribution and7# is available at https://www.apache.org/licenses/LICENSE-2.0.8#9# This Source Code may also be made available under the following10# Secondary Licenses when the conditions for such availability set11# forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12# General Public License, version 2 with the GNU Classpath13# Exception [1] and GNU General Public License, version 2 with the14# OpenJDK Assembly Exception [2].15#16# [1] https://www.gnu.org/software/classpath/license.html17# [2] http://openjdk.java.net/legal/assembly-exception.html18#19# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception20###############################################################################21---22- name: Checkout ibmruntimes23delegate_to: "openj9-{{ version }}-build"24git:25repo: "https://github.com/ibmruntimes/openj9-openjdk-{{ version }}"26dest: "/root/openj9-openjdk-{{ version }}"27version: openj928update: yes29force: yes30accept_hostkey: yes31tags:32- build33- name: Set get_source.sh as executable34delegate_to: "openj9-{{ version }}-build"35file:36path: "/root/openj9-openjdk-{{ version }}/get_source.sh"37mode: 075538tags:39- build40- name: Get the sources41delegate_to: "openj9-{{ version }}-build"42shell: "/root/openj9-openjdk-{{ version }}/get_source.sh"43args:44chdir: "/root/openj9-openjdk-{{ version }}"45tags:46- build47- name: Set configure as executable48delegate_to: "openj9-{{ version }}-build"49file:50path: "/root/openj9-openjdk-{{ version }}/configure"51mode: 075552tags:53- build54- name: Configure55delegate_to: "openj9-{{ version }}-build"56shell: "/root/openj9-openjdk-{{ version }}/configure --with-freemarker-jar=/root/freemarker.jar"57args:58chdir: "/root/openj9-openjdk-{{ version }}"59tags:60- build61- compile62- name: Make clean63delegate_to: "openj9-{{ version }}-build"64shell: "make clean"65args:66chdir: "/root/openj9-openjdk-{{ version }}"67when: not build.cleanup68tags:69- build70- compile71- name: Make all72delegate_to: "openj9-{{ version }}-build"73shell: "make all"74args:75chdir: "/root/openj9-openjdk-{{ version }}"76tags:77- build78- compile79- name: Check if j2sdk-image exists80stat:81path: "/root/openj9-openjdk-{{ version }}/build/{{ os }}-{{ platform }}-normal-server-release/images/j2sdk-image"82register: j2sdk83delegate_to: "openj9-{{ version }}-build"84tags:85- build86- name: Create symlink j2sdk to jdk87file:88src: "/root/openj9-openjdk-{{ version }}/build/{{ os }}-{{ platform }}-normal-server-release/images/jdk"89dest: "/root/openj9-openjdk-{{ version }}/build/{{ os }}-{{ platform }}-normal-server-release/images/j2sdk-image"90state: link91when: not j2sdk.stat.exists92delegate_to: "openj9-{{ version }}-build"93tags:94- build95- name: Change the owner of the built JDK96file:97path: "/root/openj9-openjdk-{{ version }}/build/{{ os }}-{{ platform }}-normal-server-release/images/j2sdk-image/"98recurse: yes99owner: "{{ target.user }}"100group: "{{ target.group }}"101delegate_to: "openj9-{{ version }}-build"102tags:103- build104- name: Remove the previous version of the JDK archive105file:106path: "/root/hostdir/openj9-{{ version }}-{{ os }}-{{ platform }}.tar.gz"107state: absent108delegate_to: "openj9-{{ version }}-build"109tags:110- build111- name: Archive the JDK112archive:113path: "/root/openj9-openjdk-{{ version }}/build/{{ os }}-{{ platform }}-normal-server-release/images/j2sdk-image/*"114dest: "/root/hostdir/openj9-{{ version }}-{{ os }}-{{ platform }}.tar.gz"115mode: 0644116owner: "{{ ansible_user.stdout }}"117group: "{{ ansible_group.stdout }}"118delegate_to: "openj9-{{ version }}-build"119tags:120- build121122123