Repository navigation
DTT-GHA #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DTT-GHA #100
Changes from 59 commits
b74ec33
da890c6
fa90936
b661ac9
0c5d4f7
76782b8
f756279
5bf49b8
bb2649b
3cd2049
274df58
7ffb9a9
161a0b8
ac7a469
11a5a23
422afd9
f284f5e
f27cb3a
24a63ae
30b1c26
efec60b
78d6649
13431d9
bddd434
265e3a3
32ebcf6
f1ccdf6
5793d75
1ecb618
e6cf161
6d91594
13d78a8
5bef3b7
d0e3e76
487ac3b
3a63857
fe79143
e832d89
6165b9b
a8aa1f1
0841eb2
72fe116
66f3288
fbb20bb
2c484dc
971c034
9cd7f83
c722db2
43e70b3
c4fdbf6
f8b51e2
5768450
eb5e8b0
3a693b5
4550177
6194d79
4468739
dc82544
f3bfce6
c448c06
8531738
cdabd22
1be62a2
8107cec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| name: Test Sonarqube Composer and S3 | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - '**' | ||
| env: | ||
| FOLDER: "dist" | ||
| foldersCache: "vendor/" | ||
| CODE_SOURCE_DEFAULT: "aplazame" | ||
| AWS_REGION: 'eu-central-1' | ||
| AWS_ACCOUNT: '666356151544' | ||
|
|
||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| issues: write | ||
|
|
||
| jobs: | ||
| test-sonarqube: | ||
| name: Test SonarQube Scan | ||
| uses: ./.github/workflows/test-reusable-sonarqube.yml | ||
| secrets: | ||
| SONAR_TOKEN: ${{ secrets.WZ_SONAR_TOKEN }} | ||
|
|
||
| test-composer: | ||
| name: Test Composer Install | ||
| needs: test-sonarqube | ||
| runs-on: ${{ vars.AWS_RG_NAME_PRO }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| php-version: '5.6' | ||
| extensions: mbstring, intl, xml, curl, zip, json | ||
| tools: composer:v2 | ||
|
|
||
| - name: Install AWS CLI | ||
| run: | | ||
| sudo apt-get install unzip zip curl -y | ||
| curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | ||
| unzip awscliv2.zip | ||
| sudo ./aws/install --update | ||
| aws --version | ||
|
|
||
| - name: Configure aws credentials | ||
| uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 #v5.1.1 | ||
| with: | ||
| role-to-assume: ${{ vars.AWS_OIDC_ROLE_TF_PRO }} | ||
| role-session-name: ${{ github.run_id }} | ||
| aws-region: ${{ vars.WZ_OIDC_AWS_REGION }} | ||
|
|
||
| - name: Get cache | ||
| env: | ||
| s3Path: s3://aplazameshared-jenkins-cache/Aplazame-Backend/prestashop/v1-dependencies-${{ github.sha }}.tar.gz | ||
| run: | | ||
| set -e | ||
| aws s3 cp --quiet ${s3Path} cache.tar.gz --profile AplazameSharedServices || exit 0 | ||
| [ -f cache.tar.gz ] && tar -xf cache.tar.gz | ||
| aws s3 cp --quiet ${s3Path} cache.tar.gz --profile AplazameSharedServices | ||
|
|
||
| - name: Composer Install | ||
| run: composer install --prefer-dist | ||
|
|
||
| - name: Upload cache | ||
| env: | ||
| s3Path: s3://aplazameshared-jenkins-cache/Aplazame-Backend/prestashop/v1-dependencies-${{ github.sha }}.tar.gz | ||
| run: | | ||
| set -e | ||
| MATCHES=$(aws s3 ls ${s3Path} --profile AplazameSharedServices| wc -l) | ||
| [ "$MATCHES" = "0" ] && [ ! -f cache.tar.gz ] && tar -czf cache.tar.gz ${foldersCache} && aws s3 cp --quiet cache.tar.gz ${s3Path} --profile AplazameSharedServices | ||
| exit 0 | ||
|
|
||
| - name: Check syntax | ||
| run: make syntax.checker | ||
|
|
||
| - name: Make Styleci happy | ||
| run: make style | ||
|
|
||
| - name: Create Bundle | ||
|
adrianmartin23 marked this conversation as resolved.
|
||
| run: | | ||
| sudo apt update && sudo apt install zip -y | ||
| make zip | ||
|
|
||
| - name: Deploy to S3 | ||
|
adrianmartin23 marked this conversation as resolved.
|
||
| run: | | ||
|
adrianmartin23 marked this conversation as resolved.
|
||
| aws s3 cp --acl public-read aplazame.latest.zip s3://aplazame/modules/prestashop/ --profile Aplazame | ||
|
|
||
| - name: Await Manual Approval | ||
| if: ${{ github.event_name == 'push' }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. y que sea en la rama master
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sigue sin resolverse |
||
| uses: trstringer/manual-approval@v1 | ||
| with: | ||
| secret: ${{ secrets.AP_GH_RELEASE_TOKEN_OLD }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. token incorrecto, usar ${{ github.TOKEN }} |
||
| minimum-approvals: 1 | ||
| approvers: 'AR40873_wzk' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. usuario incorrecto |
||
| timeout-minutes: 10 | ||
| issue-title: "Manual Approval Required for Release (First change Makefile's App Version)" | ||
| issue-body: "Please approve or deny the deploy." | ||
|
|
||
| - name: Create GitHub Release | ||
|
adrianmartin23 marked this conversation as resolved.
|
||
| env: | ||
| GH_TOKEN: ${{ secrets.AP_GH_RELEASE_TOKEN_OLD }} | ||
| run: | | ||
| sudo apt-get install gh -y | ||
| echo "***************Create Release***************" | ||
| APP_VERSION=$(grep "^version" Makefile | awk -F= '{print $2}' | xargs) | ||
| echo "$APP_VERSION" | ||
| gh release create "$APP_VERSION" --notes "Release created by GitHub Actions" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: Test SonarQube Scan | ||
| on: | ||
| workflow_call: | ||
| secrets: | ||
| SONAR_TOKEN: | ||
| description: "Token for SonarQube" | ||
| required: true | ||
|
|
||
|
|
||
| jobs: | ||
| test-sonarqube: | ||
| name: Test SonarQube Scan | ||
| runs-on: ${{ vars.AWS_RG_NAME_PRO }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: SonarQube Scan | ||
| uses: SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 #v7.0.0 | ||
| env: | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
| #SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. eliminar si no va a ser usado |
||
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comando repetido