ci: migration vers une architecture de pipeline basée sur des conteneurs dédiés
This commit is contained in:
+13
-7
@@ -9,30 +9,36 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
name: Build & Run Unit Tests
|
name: Build & Run Unit Tests
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
|
container:
|
||||||
|
image: maven:3.9.6-eclipse-temurin-21
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repository
|
- name: Clone repository
|
||||||
run: |
|
run: |
|
||||||
|
# Install git if not present in the maven image
|
||||||
|
if ! command -v git &> /dev/null; then
|
||||||
|
apt-get update && apt-get install -y git
|
||||||
|
fi
|
||||||
SERVER_URL="${{ github.server_url }}"
|
SERVER_URL="${{ github.server_url }}"
|
||||||
SERVER_NO_PROTO="${SERVER_URL#http://}"
|
SERVER_NO_PROTO="${SERVER_URL#http://}"
|
||||||
SERVER_NO_PROTO="${SERVER_NO_PROTO#https://}"
|
SERVER_NO_PROTO="${SERVER_NO_PROTO#https://}"
|
||||||
git clone --depth 1 "https://oauth2:${{ secrets.GITHUB_TOKEN }}@${SERVER_NO_PROTO}/${{ github.repository }}.git" .
|
git clone --depth 1 "https://oauth2:${{ secrets.GITHUB_TOKEN }}@${SERVER_NO_PROTO}/${{ github.repository }}.git" .
|
||||||
git checkout ${{ github.sha }}
|
git checkout ${{ github.sha }}
|
||||||
|
|
||||||
- name: Run Maven Tests in Docker
|
- name: Run Maven Tests
|
||||||
run: |
|
run: mvn clean test
|
||||||
docker run --rm \
|
|
||||||
-v ${{ github.workspace }}:/as-talange \
|
|
||||||
-w /as-talange \
|
|
||||||
maven:3.9.6-eclipse-temurin-21 \
|
|
||||||
mvn clean test
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
name: Build & Run in Docker Container
|
name: Build & Run in Docker Container
|
||||||
needs: test
|
needs: test
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
|
container:
|
||||||
|
image: docker:latest
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repository
|
- name: Clone repository
|
||||||
run: |
|
run: |
|
||||||
|
apk add --no-cache git
|
||||||
SERVER_URL="${{ github.server_url }}"
|
SERVER_URL="${{ github.server_url }}"
|
||||||
SERVER_NO_PROTO="${SERVER_URL#http://}"
|
SERVER_NO_PROTO="${SERVER_URL#http://}"
|
||||||
SERVER_NO_PROTO="${SERVER_NO_PROTO#https://}"
|
SERVER_NO_PROTO="${SERVER_NO_PROTO#https://}"
|
||||||
|
|||||||
Reference in New Issue
Block a user