Skip to content

Commit 35d6fdc

Browse files
raugierCopilotefaure
committed
[tool] chore: add ci for testing-xtm-one (#1)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Eloise Faure <eloise.faure@filigran.io>
1 parent 0198b56 commit 35d6fdc

1 file changed

Lines changed: 92 additions & 0 deletions

File tree

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Deploy testing-xtm-one
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- testing-xtm-one
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build-image:
18+
name: Build testing-xtm-one image
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v6
22+
with:
23+
submodules: recursive
24+
- uses: jirutka/setup-alpine@v1
25+
with:
26+
branch: v3.23
27+
extra-repositories: |
28+
https://dl-cdn.alpinelinux.org/alpine/edge/community/
29+
packages: >
30+
nodejs npm git tini gcc g++ make musl-dev cargo openjdk21-jdk maven postfix postfix-pcre
31+
- name: Setup Node.js
32+
run: |
33+
npm install -g corepack
34+
shell: alpine.sh --root {0}
35+
- name: Build into Alpine
36+
run: |
37+
export JAVA_HOME=/usr/lib/jvm/default-jvm/
38+
cd openaev-front
39+
yarn install
40+
yarn build
41+
cd ../
42+
mvn install -DskipTests -Pdev
43+
shell: alpine.sh {0}
44+
- run: mkdir -p openaev-build/
45+
- run: cp openaev-api/target/openaev-api.jar openaev-build/
46+
- name: Docker meta
47+
id: meta
48+
uses: docker/metadata-action@v6
49+
with:
50+
images: filigran/openaev-platform
51+
tags: |
52+
type=raw,value=testing-xtm-one
53+
54+
- name: Set up Docker Buildx
55+
uses: docker/setup-buildx-action@v4
56+
57+
- name: Login to DockerHub
58+
uses: docker/login-action@v3
59+
with:
60+
username: ${{ secrets.DOCKERHUB_USERNAME }}
61+
password: ${{ secrets.DOCKERHUB_TOKEN }}
62+
63+
- name: Build and push
64+
id: buildpush
65+
uses: docker/build-push-action@v7
66+
with:
67+
context: .
68+
file: ./Dockerfile_ga
69+
push: true
70+
tags: ${{ steps.meta.outputs.tags }}
71+
labels: ${{ steps.meta.outputs.labels }}
72+
cache-from: type=registry,ref=filigran/openaev-platform:buildcache
73+
cache-to: type=registry,ref=filigran/openaev-platform:buildcache,mode=max
74+
75+
deploy:
76+
name: Restart testing-xtm-one instance
77+
needs: build-image
78+
runs-on: ubuntu-latest
79+
steps:
80+
- name: Install AWX cli
81+
run: pip install awxkit
82+
83+
- name: Restart instance via AWX
84+
run: |
85+
awx --conf.host ${{ secrets.AWX_URL }} \
86+
--conf.username ${{ secrets.AWX_USER }} \
87+
--conf.password ${{ secrets.AWX_PASSWORD }} \
88+
job_templates launch 'Rollout restart an instance resources' \
89+
--inventory eu-west-staging \
90+
--extra_vars '{"solution":"openaev", "customer":"testing-xtm-one-oaev"}' \
91+
--wait \
92+
-f human

0 commit comments

Comments
 (0)