Skip to content

Commit

Permalink
Define devenv in pom file
Browse files Browse the repository at this point in the history
  • Loading branch information
pavetok committed Feb 23, 2024
1 parent 8ce4301 commit 55943c9
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 32 deletions.
10 changes: 5 additions & 5 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>deps-context</id>
<id>deps-jars</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy-dependencies</goal>
Expand All @@ -78,7 +78,7 @@
</configuration>
</execution>
<execution>
<id>lib-context</id>
<id>libs-jars</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy-dependencies</goal>
Expand All @@ -90,7 +90,7 @@
</configuration>
</execution>
<execution>
<id>app-context</id>
<id>app-jar</id>
<phase>pre-integration-test</phase>
<goals>
<goal>copy</goal>
Expand Down Expand Up @@ -128,9 +128,9 @@
<argument>--file</argument>
<argument>${project.basedir}/Dockerfile</argument>
<argument>--tag</argument>
<argument>app/${project.artifactId}:godel</argument>
<argument>app/${artifactId}:${devenv}</argument>
<argument>--label</argument>
<argument>image.key=app/${project.artifactId}/godel</argument>
<argument>image.key=app/${artifactId}/${devenv}</argument>
<argument>--build-arg</argument>
<argument>JAVA_RELEASE=${maven.compiler.release}</argument>
</arguments>
Expand Down
12 changes: 0 additions & 12 deletions baker/ansible/inventory/group_vars/all/envs.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
---
devenv: turing
dev:
church:
jdk:
release: 21
kotlin:
version: 2.0.0-Beta4
turing:
jdk:
release: 21
godel:
jdk:
release: 17

opsenv: durkheim
ops:
Expand Down
2 changes: 1 addition & 1 deletion baker/ansible/sources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
pmd:check
compiler:compile
spotbugs:check
--define maven.compiler.release={{ dev[devenv].jdk.release }}
--define devenv={{ devenv }}
chdir: "{{ project.dir }}"
strip_empty_ends: false
changed_when: false
Expand Down
4 changes: 3 additions & 1 deletion baker/ansible/stacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
- ansible.builtin.import_tasks: # noqa: name[missing]
file: tasks/gear/build.yaml
tags: [build]
when: hostvars.gear.stack_status is changed
when: >-
hostvars.gear.stack_status is changed and
repo_mode != 'rw'
- name: Building & Checking
hosts: product
Expand Down
7 changes: 2 additions & 5 deletions baker/ansible/tasks/app/build-and-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@
}}
--also-make
clean
{{ maven_phase|mandatory }}
--define maven.compiler.release={{ dev[devenv].jdk.release }}
{% if dev[devenv].kotlin is defined %}
--define kotlin.version={{ dev[devenv].kotlin.version }}
{% endif %}
{{ maven_phase | mandatory }}
--define devenv={{ devenv }}
chdir: "{{ project.dir }}"
strip_empty_ends: false
changed_when: true
Expand Down
8 changes: 7 additions & 1 deletion baker/ansible/tasks/gear/build.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
---
- ansible.builtin.import_role: # noqa: name[missing]
name: image
tasks_from: clean
vars:
image_keys:
- "{{ gear.image }}/{{ devenv }}"

- ansible.builtin.import_role: # noqa: name[missing]
name: image
tasks_from: build
vars:
image_home: "{{ project.dir }}/stack/gear"
image_key: "{{ gear.image }}/{{ devenv }}"
image_tag: "{{ gear.image }}:{{ devenv }}"
when: repo_mode != 'rw'
7 changes: 7 additions & 0 deletions baker/ansible/tasks/product/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
---
- ansible.builtin.import_role: # noqa: name[missing]
name: image
tasks_from: clean
vars:
image_keys:
- "{{ product.image }}/{{ opsenv }}"

- name: Remove artifacts
ansible.builtin.file:
path: "{{ stack_dir }}/target"
Expand Down
6 changes: 3 additions & 3 deletions baker/ansible/tasks/product/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@
--batch-mode
--threads 2
--projects test/e2e
{% if is_docker_gear.rc == 0 %}
{% if hostvars.gear.is_docker_gear.rc == 0 %}
--activate-profiles docker
{% endif %}
--also-make
clean
test
--define devenv={{ devenv }}
--define skipUnits=true
--define props={{ opsenv }}
{% if reminder is defined %}
--define testing.sharding.reminder={{ reminder }}
{% endif %}
{% if modulus is defined %}
--define testing.sharding.modulus={{ modulus }}
{% endif %}
--define maven.compiler.release={{ dev[devenv].jdk.release }}
--define skipUnits=true
chdir: "{{ project.dir }}"
strip_empty_ends: false
changed_when: true
12 changes: 12 additions & 0 deletions baker/ansible/tasks/product/clean.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- name: Remove artifacts
ansible.builtin.file:
path: "{{ stack_dir }}/target"
state: absent

- ansible.builtin.import_role: # noqa: name[missing]
name: image
tasks_from: clean
vars:
image_keys:
- "{{ product.image }}/{{ opsenv }}"
49 changes: 45 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,55 @@
<spring.version>6.1.3</spring.version>
<kotlin.version>1.9.22</kotlin.version>
<jacoco.version>0.8.11</jacoco.version>
<!--unit tests & integration tests-->
<skipTests>false</skipTests>
<!--unit tests only-->
<skipUnits>${skipTests}</skipUnits>
<devenv>godel</devenv>
<skipTests>false</skipTests> <!--unit tests & integration tests-->
<skipUnits>${skipTests}</skipUnits> <!--unit tests only-->
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<profiles>
<profile>
<id>experimental</id>
<activation>
<property>
<name>devenv</name>
<value>church</value>
</property>
</activation>
<properties>
<maven.compiler.release>22</maven.compiler.release>
<kotlin.version>2.0.0-Beta4</kotlin.version>
</properties>
</profile>
<profile>
<id>stable</id>
<activation>
<property>
<name>devenv</name>
<value>turing</value>
</property>
</activation>
<properties>
<maven.compiler.release>21</maven.compiler.release>
<kotlin.version>1.9.22</kotlin.version>
</properties>
</profile>
<profile>
<id>deprecated</id>
<activation>
<property>
<name>devenv</name>
<value>godel</value>
</property>
</activation>
<properties>
<maven.compiler.release>17</maven.compiler.release>
<kotlin.version>1.8.22</kotlin.version>
</properties>
</profile>
</profiles>

<build>
<testResources>
<testResource>
Expand Down

0 comments on commit 55943c9

Please sign in to comment.