Skip to content

Merge pull request #12 from entando/ENGPM-554 #39

Merge pull request #12 from entando/ENGPM-554

Merge pull request #12 from entando/ENGPM-554 #39

Workflow file for this run

name: Internal Snapshot Publication
on:
push:
tags:
- 'v*'
env:
ENTANDO_OPT_USE_PPL_TAG: "v1.4.1"
ENTANDO_OPT_DATA_REPO: "${{ secrets.ENTANDO_OPT_DATA_REPO }}"
ENTANDO_OPT_DATA_REPO_TOKEN: "${{ secrets.ENTANDO_OPT_DATA_REPO_TOKEN }}"
ENTANDO_OPT_ENVIRONMENT_NAMES: "${{ secrets.ENTANDO_OPT_ENVIRONMENT_NAMES }}"
ENTANDO_OPT_FEATURES: "${{ secrets.ENTANDO_OPT_FEATURES }}"
ENTANDO_OPT_GLOBAL_FEATURES: "${{ secrets.ENTANDO_OPT_GLOBAL_FEATURES }}"
ENTANDO_OPT_LOG_LEVEL: "${{ secrets.ENTANDO_OPT_LOG_LEVEL }}"
ENTANDO_OPT_CUSTOM_ENV: "${{ secrets.ENTANDO_OPT_CUSTOM_ENV }}"
PPL_CONTEXT: ${{ toJson(github) }}
LOCAL_CLONE_DIR: "local-checkout"
jobs:
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# PUBLICATION
publication:
outputs:
POST_PUB_DOCKER_SCAN: ${{ steps.START.outputs.POST_PUB_DOCKER_SCAN }}
POST_DEP_TESTS: ${{ steps.START.outputs.POST_DEP_TESTS }}
env:
ENTANDO_BOT_TOKEN: ${{ secrets.ENTANDO_BOT_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: "PR PIPELINE START"
id: START
run: |
${{ secrets.ENTANDO_OPT_PPL_INSTALL_CMD }}
~/ppl-run status-report
#~ CHECKOUT
- name: "CHECKOUT"
id: CHECKOUT
run: |
~/ppl-run \
.. checkout-branch --id "CHECKOUT FOR PUBLICATION" \
--lcd "$LOCAL_CLONE_DIR" \
--token "$ENTANDO_BOT_TOKEN" \
.. pr-preflight-checks --only flags --lcd "$LOCAL_CLONE_DIR" \
;
~/ppl-run generic GENERATE-BUILD-CACHE-KEY "BUILD_CACHE_KEY" --lcd "$LOCAL_CLONE_DIR" >> $GITHUB_ENV
~/ppl-run generic GENERATE-BUILD-TARGET-DIR "BUILD_TARGET_DIR" --lcd "$LOCAL_CLONE_DIR" >> $GITHUB_ENV
#~ BUILD CACHE
#- name: "Cache Build Dir"
#id: build-cache
#uses: actions/cache@v2
#with:
#path: "${{ env.LOCAL_CLONE_DIR}}/${{ env.BUILD_TARGET_DIR }}/"
#key: "${{ runner.os }}-enp-build-${{ env.BUILD_CACHE_KEY }}"
#~ PUBLISH THE ARTIFACT
- name: "Publish package"
run: |
~/ppl-run generic PUBLISH \
--id "PUBLICATION" \
--lcd "$LOCAL_CLONE_DIR"
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
#~ PUBLISH TO DOCKER
- name: "Publish image"
env:
ENTANDO_OPT_DOCKER_PASSWORD: "${{ secrets.ENTANDO_OPT_DOCKER_PASSWORD }}"
ENTANDO_OPT_DOCKER_ALT_PASSWORD: "${{ secrets.ENTANDO_OPT_DOCKER_ALT_PASSWORD }}"
run: |
~/ppl-run generic PUBLISH-IMAGE --lcd "$LOCAL_CLONE_DIR"
#~ POST SCAN
- name: "Post-scan container"
env:
SNYK_ORG: "${{ secrets.SNYK_ORG }}"
SNYK_TOKEN: "${{ secrets.SNYK_TOKEN }}"
run: |
~/ppl-run generic SCAN-IMAGE --lcd "$LOCAL_CLONE_DIR"