Skip to content

Commit 7bdaab0

Browse files
committed
add build files
1 parent da6df1b commit 7bdaab0

File tree

5 files changed

+495
-0
lines changed

5 files changed

+495
-0
lines changed

.github/workflows/backport.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Automatic backport action
2+
3+
on:
4+
pull_request_target:
5+
types: ["closed", "labeled"]
6+
7+
permissions:
8+
contents: write # so it can comment
9+
pull-requests: write # so it can create pull requests
10+
11+
jobs:
12+
backport:
13+
name: Backport PR
14+
if: github.event.pull_request.merged == true && !(contains(github.event.pull_request.labels.*.name, 'backport'))
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Backport Action
18+
uses: sorenlouv/[email protected]
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }}
21+
auto_backport_label_prefix: backport-to-
22+
23+
- name: Info log
24+
if: ${{ success() }}
25+
run: cat ~/.backport/backport.info.log
26+
27+
- name: Debug log
28+
if: ${{ failure() }}
29+
run: cat ~/.backport/backport.debug.log

.github/workflows/sp.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: "security-proxy"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
tags:
7+
- '*'
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
if: "!startsWith(github.event.head_commit.message, '[skip ci] ')"
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 10
15+
steps:
16+
- name: "Checking out"
17+
uses: actions/checkout@v5
18+
19+
- name: "Setting up Java"
20+
uses: actions/setup-java@v5
21+
with:
22+
java-version: '11'
23+
distribution: 'adopt'
24+
cache: 'maven'
25+
server-id: geOrchestra-artifactory
26+
server-username: ARTIFACTORY_USERNAME_REF
27+
server-password: ARTIFACTORY_TOKEN_REF
28+
29+
- name: "Installing & checking formatting"
30+
run: mvn install -DskipTests --no-transfer-progress -B -Dfmt.action=validate -Dadditionalparam=-Xdoclint:none
31+
# note "-pl :security-proxy --also-make" builds only the project and its dependencies
32+
33+
- name: "Running tests"
34+
run: mvn verify -Pit --no-transfer-progress -Dfmt.skip=true -Dadditionalparam=-Xdoclint:none
35+
36+
- name: Getting image tag
37+
if: github.repository == 'georchestra/security-proxy' && github.actor != 'dependabot[bot]'
38+
id: version
39+
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT
40+
41+
- name: "Building docker image"
42+
if: github.repository == 'georchestra/security-proxy' && github.actor != 'dependabot[bot]'
43+
run: mvn clean package docker:build -Pdocker,log4j-logstash,sentry-log4j -DdockerImageName=georchestra/security-proxy:${{ steps.version.outputs.VERSION }} -DskipTests --no-transfer-progress
44+
45+
- name: "Logging in docker.io"
46+
uses: azure/docker-login@v2
47+
if: github.repository == 'georchestra/security-proxy' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
48+
with:
49+
username: '${{ secrets.DOCKER_HUB_USERNAME }}'
50+
password: '${{ secrets.DOCKER_HUB_PASSWORD }}'
51+
52+
- name: "Update Docker Hub Description"
53+
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/security-proxy' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
54+
uses: peter-evans/dockerhub-description@v4
55+
with:
56+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
57+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
58+
repository: georchestra/security-proxy
59+
readme-filepath: ./security-proxy/DOCKER_HUB.md
60+
short-description: 'Security-proxy module for the geOrchestra SDI'
61+
62+
- name: "Pushing latest to docker.io"
63+
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/security-proxy' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
64+
run: |
65+
docker tag georchestra/security-proxy:${{ steps.version.outputs.VERSION }} georchestra/security-proxy:latest
66+
docker push georchestra/security-proxy:latest
67+
68+
- name: "Pushing release branch or tag to docker.io"
69+
if: (endsWith(github.ref, '.x') || contains(github.ref, 'refs/tags/')) && github.repository == 'georchestra/security-proxy' && github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
70+
run: |
71+
docker push georchestra/security-proxy:${{ steps.version.outputs.VERSION }}
72+
73+
- name: "Publish war in artifactory"
74+
run: mvn deploy -DskipTests
75+
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
76+
continue-on-error: true
77+
env:
78+
ARTIFACTORY_TOKEN_REF: ${{ secrets.ARTIFACTORY_TOKEN }}
79+
ARTIFACTORY_USERNAME_REF: ${{ secrets.ARTIFACTORY_USERNAME }}
80+
81+
- name: "Remove SNAPSHOT jars from repository"
82+
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request'
83+
run: |
84+
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
**/target/
2+
*/jsbuild/venv/
3+
*/jsbuild/env/
4+
**/.project
5+
**/.classpath
6+
**/.settings
7+
.idea/
8+
*.iml
9+
*~
10+
.attach_pid*
11+
12+
13+
# documentation
14+
venv_mkdocs/
15+
.venv_mkdocs/
16+
docs/technical_guides_to_delete/
17+
18+
19+
# mac
20+
.DS_STORE

0 commit comments

Comments
 (0)