Skip to content

Commit

Permalink
update pipleine.
Browse files Browse the repository at this point in the history
  • Loading branch information
wildone committed Aug 11, 2021
1 parent 9a20870 commit 6a39563
Show file tree
Hide file tree
Showing 4 changed files with 230 additions and 10 deletions.
33 changes: 29 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
python-version: [ 3.6 ]

env:
DOCKER_IMAGE: "aemdesign/centos-java-buildpack"
DOCKER_IMAGE: "aemdesign/centos-java-buildpack:jdk11"
SONAR_ORGANISATION: "aemdesign-github"
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_URL: "https://sonarcloud.io"
Expand Down Expand Up @@ -102,11 +102,36 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: docker - mvn clean (cache .m2 in ./build/.m2/repository in repo dir)
- name: Prepare to Package
run: $DOCKER_COMMAND mvn clean -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -B -P all-modules -Dmaven.repo.local=./build/.m2/repository

- name: docker - mvn package
run: $DOCKER_COMMAND mvn package -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -B -P all-modules -Dmaven.repo.local=./build/.m2/repository
- name: Package project and install into local .m2 repository
run: $DOCKER_COMMAND mvn package install -DskipTests=true -Dgpg.skip -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -B -P all-modules -Dmaven.repo.local=./build/.m2/repository

- name: Start the stack
run: docker-compose up -d

- name: Wait for aem using ansible
run: |
docker-compose up automationtestprep
- name: Start automation tests using docker-compose
run: |
docker-compose up automationtest
- name: deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
destination_dir: ${{ env.GIT_BRANCH }}
publish_dir: ./aemdesign-testing/remote-seleniumhub-chrome/generated-docs/html/

- name: Check for success
run: |
docker-compose up testingcheck
- name: Stop the stack
run: docker-compose down

# - name: docker - sonar qube on master
# if: github.ref == 'refs/heads/master'
Expand Down
20 changes: 18 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,31 @@ services:
service: testing
profiles:
- dotest
working_dir: /build/geb-aem-testing/gebaemtesting-testing
working_dir: /build/source/aemdesign-aem-support/aemdesign-testing
volumes:
- "./:/build/geb-aem-testing"
- "../:/build/source"
- "~/.m2:/build/.m2"
depends_on:
- author
- seleniumhub
- testingprep

automationtest:
extends:
file: ./docker/testing/docker-compose.yml
service: automationtest
profiles:
- dotest
working_dir: /build/source/aemdesign-testing
volumes:
- "./:/build/source"
- "~/.m2:/build/.m2"
depends_on:
- author
- seleniumhub
- testingprepshowcase


testingprep:
extends:
file: ./docker/testing/docker-compose.yml
Expand Down
58 changes: 54 additions & 4 deletions docker/testing/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: "2.4"

services:

# this meant to run when there is a aemdesign-parent repo, so when you are developing localy
testing:
image: aemdesign/centos-java-buildpack:jdk11
hostname: testing
Expand All @@ -10,12 +11,12 @@ services:
- MAVEN_COMMAND=bash ./test-spec --host author --port 8080 --url http://seleniumhub:4444 --maven
# docker
- PARENT_PROJECT_WITH_GIT=.
- PARENT_PROJECT_WITH_GIT_NAME=geb-aem-testing
- CURRENT_PROJECT_LOCATION=geb-aem-testing/gebaemtesting-testing
- PARENT_PROJECT_WITH_GIT_NAME=aemdesign-parent
- CURRENT_PROJECT_LOCATION=source/aemdesign-aem-support/aemdesign-testing
command: "bash -c -l 'cd /build/$${CURRENT_PROJECT_LOCATION}; $${MAVEN_COMMAND}'"
working_dir: "/build/geb-aem-testing/gebaemtesting-testing/"
working_dir: /build/source/aemdesign-aem-support/aemdesign-testing"
volumes:
- ./:/build/geb-aem-testing
- ../../../:/build/source
- ~/.m2:/build/.m2
networks:
- default
Expand All @@ -24,6 +25,55 @@ services:
- publish-network
- dispatcher-network

# this meant to run in aemdesign-aem-support repo pipeline,
automationtest:
image: aemdesign/centos-java-buildpack:jdk11
hostname: automationtest
environment:
# maven
- MAVEN_COMMAND=bash ./test-spec --host author --port 8080 --url http://seleniumhub:4444 --maven
# docker
- PARENT_PROJECT_WITH_GIT=.
- PARENT_PROJECT_WITH_GIT_NAME=aemdesign-aem-support
- CURRENT_PROJECT_LOCATION=source/aemdesign-testing
command: "bash -c -l 'cd /build/$${CURRENT_PROJECT_LOCATION}; $${MAVEN_COMMAND}'"
working_dir: /build/source/aemdesign-testing"
volumes:
- ../../:/build/source
- ~/.m2:/build/.m2
networks:
- default
- seleniumgrid
- author-network
- publish-network
- dispatcher-network

# this meant to run in aemdesign-aem-support repo pipeline, will download latest core and install local support packages
automationtestprep:
image: aemdesign/centos-java-buildpack:jdk11
hostname: automationtestprep
working_dir: "/build/source"
environment:
aem_port: 4502
aem_host: author
aem_username: admin
aem_password: admin
command:
- bash
- -l
- -c
- "ls -latr /build/.m2/repository && pwd && ls -l && ansible-galaxy install -r requirements.yml && ansible-playbook testingprep-automationtest.yml --extra-vars debug_hide=true"
volumes:
- ./playbooks:/build/source
- "~/.m2:/build/.m2"
networks:
- seleniumgrid
- author-network
- publish-network
- dispatcher-network
- default


testingprep:
image: aemdesign/ansible-playbook
hostname: testingprep
Expand Down
129 changes: 129 additions & 0 deletions docker/testing/playbooks/testingprep-automationtest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
---
- name: testingprep-showcase
hosts: localhost
become: true
vars:
PORT: "8080"
HOST: "author"
USERNAME: "admin"
PASSWORD: "admin"
PACKAGE_VERISON_CORE: "2.1.320"
PACKAGE_VERISON_SHOWCASE: "2.0.597"
debug_hide: false



pre_tasks:
- name: get packages
shell: |
mvn dependency:copy -D"maven.repo.local=/build/.m2/repository" -D"artifact=design.aem:aemdesign-aem-core-deploy:LATEST:zip" -D"outputDirectory=./packages" -D"mdep.stripVersion=true"
mvn dependency:copy -o -D"maven.repo.local=/build/.m2/repository" -D"artifact=design.aem:aemdesign-aem-support-deploy:LATEST:zip" -D"outputDirectory=./packages" -D"mdep.stripVersion=true"
args:
executable: /bin/bash
environment:
PACKAGE_VERISON_CORE: "{{ PACKAGE_VERISON_CORE }}"
PACKAGE_VERISON_SHOWCASE: "{{ PACKAGE_VERISON_SHOWCASE }}"

tasks:
- name: verify aem is ready
include_role:
name: "aem_design.aem_verify"
vars:
aem_port: "{{ PORT }}"
aem_host: "{{ HOST }}"
aem_username: "{{ USERNAME }}"
aem_password: "{{ PASSWORD }}"
debug_hide: false

- name: install core package
command: "curl -u '{{ USERNAME }}:{{ PASSWORD }}' \
-X POST \
-F 'file=@./packages/aemdesign-aem-core-deploy.zip' \
-F 'name=aemdesign-aem-core-deploy.zip' \
-H User-Agent:curl \
-F force=true \
-F install=true \
'http://{{ HOST }}:{{ PORT }}/crx/packmgr/service.jsp'"

- name: verify aem is ready
include_role:
name: "aem_design.aem_verify"
vars:
aem_port: "{{ PORT }}"
aem_host: "{{ HOST }}"
aem_username: "{{ USERNAME }}"
aem_password: "{{ PASSWORD }}"
debug_hide: false

- name: install showcase package
command: "curl -u '{{ USERNAME }}:{{ PASSWORD }}' \
-X POST \
-F 'file=@./packages/aemdesign-aem-support-deploy.zip' \
-F 'name=aemdesign-aem-support-deploy.zip' \
-H User-Agent:curl \
-F force=true \
-F install=true \
'http://{{ HOST }}:{{ PORT }}/crx/packmgr/service.jsp'"

- name: verify aem is ready
include_role:
name: "aem_design.aem_verify"
vars:
aem_port: "{{ PORT }}"
aem_host: "{{ HOST }}"
aem_username: "{{ USERNAME }}"
aem_password: "{{ PASSWORD }}"
debug_hide: false


# - name: install aem packages
# include_role:
# name: aem_design.aem_package
# vars:
# aem_port: "{{ PORT }}"
# aem_host: "{{ HOST }}"
# aem_username: "{{ USERNAME }}"
# aem_password: "{{ PASSWORD }}"
# maven_repository_url: "{{ item.maven_repository_url | default('') }}"
# debug_hide: "{{ debug_hide }}"
# simple_name: "{{ item.simple_name }}"
# group_name: "{{ item.group_name }}"
# package_version: "{{ item.package_version }}"
# package_name: "{{ item.package_name }}"
# package_url: "{{ item.package_url }}"
# file_name: "{{ item.file_name }}"
# file_url_username: "{{ item.file_url_username | default('') }}"
# file_url_password: "{{ item.file_url_password | default('') }}"
# install_package_ansible: "{{ item.install_package_ansible }}"
# install_package_docker: "{{ item.install_package_docker }}"
# docker_host: "{{ item.docker_host }}"
# loop: [
# {
# debug_hide: "false",
# simple_name: "aemdesign-aem-core-deploy",
# group_name: "aemdesign",
# package_version: "{{ PACKAGE_VERISON_CORE }}",
# package_name: "aemdesign-aem-core-deploy",
# package_url: "",
# url_username: "",
# url_password: "",
# file_name: "aemdesign-aem-support-deploy-{{ PACKAGE_VERISON_CORE }}.zip",
# install_package_ansible: true,
# install_package_docker: false,
# docker_host: "unix://var/run/docker.sock"
# },
# {
# debug_hide: "false",
# simple_name: "aemdesign-aem-support-deploy",
# group_name: "aemdesign",
# package_version: "{{ PACKAGE_VERISON_SHOWCASE }}",
# package_name: "aemdesign-aem-support-deploy",
# package_url: "",
# url_username: "",
# url_password: "",
# file_name: "aemdesign-aem-support-deploy-{{ PACKAGE_VERISON_SHOWCASE }}.zip",
# install_package_ansible: true,
# install_package_docker: false,
# docker_host: "unix://var/run/docker.sock"
# }
# ]

0 comments on commit 6a39563

Please sign in to comment.