diff --git a/.github/workflows/actions-test.yml b/.github/workflows/actions-test.yml deleted file mode 100644 index e54264279..000000000 --- a/.github/workflows/actions-test.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: actions-test - -on: [repository_dispatch] - - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: Run a one-line script - run: echo '${{ toJson(github.event) }}' - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..a878566cf --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,119 @@ +name: "Yorc GH Actions Build" + +on: [push, pull_request] + + +defaults: + run: + shell: bash + +jobs: + + security: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run Snyk to check for vulnerabilities + uses: snyk/actions/golang@master + continue-on-error: true # To make sure that SARIF upload gets called + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + with: + args: --sarif-file-output=snyk.sarif + - name: Upload result to GitHub Code Scanning + uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: snyk.sarif + - name: Run Snyk to check for vulnerabilities and send it to Snyk.io + uses: snyk/actions/golang@master + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + with: + command: monitor + + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + # Disabling shallow clone is recommended for improving relevancy of reporting (for sonar) + fetch-depth: 0 + - name: Setup go + uses: actions/setup-go@v1 + with: + go-version: "1" + - name: Test + run: | + go version + go env + echo "YORC_VERSION=$(grep "yorc_version" versions.yaml | awk '{print $2}')" >> $GITHUB_ENV + make tools + TESTARGS='-coverprofile coverage-sonar.out -coverpkg=./...' make json-test + - name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@master + # Do this only on push commit do not need to be re-analyzed on PR + if: github.event_name == 'push' + with: + args: > + -Dsonar.projectVersion=${{ env.YORC_VERSION }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup jfrog CLI + uses: jfrog/setup-jfrog-cli@v1 + env: + JF_ARTIFACTORY_1: ${{ secrets.JF_ARTIFACTORY_SERVER_1 }} + + - name: Ping Artifactory with jfrog CLI + run: | + # Ping the server + jfrog rt ping + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install sphinx dependencies + run: | + pip install --user --upgrade sphinx==1.8.1 semantic-version requests urllib3[secure]==1.23 Pygments>=2.7.1 + pip install -r doc/requirements.txt + sudo apt-get install -y jq \ + latexmk \ + texlive-binaries \ + texlive-fonts-recommended \ + texlive-latex-base \ + texlive-latex-extra \ + texlive-latex-recommended + + - name: Setup go + uses: actions/setup-go@v1 + with: + go-version: "1" + + - name: Make distribution + run: | + set -euo pipefail + make tools + SKIP_TESTS=1 make dist + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Make Docker container + run: | + ./docker_build.sh + + - name: Deploy artifacts to Artifactory + run: | + ./build/deploy_artifactory.sh diff --git a/.github/workflows/cleanup_artifactory.yml b/.github/workflows/cleanup_artifactory.yml new file mode 100644 index 000000000..c5faa98f2 --- /dev/null +++ b/.github/workflows/cleanup_artifactory.yml @@ -0,0 +1,39 @@ +name: Artifactory Cleanup +on: + workflow_dispatch: + inputs: + from_date: + description: '' + required: false + default: '30 days ago' + schedule: + - cron: '0 12 7,14,21,28 * *' + +defaults: + run: + shell: bash + +jobs: + cleanup: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup jfrog CLI + uses: jfrog/setup-jfrog-cli@v1 + env: + JF_ARTIFACTORY_1: ${{ secrets.JF_ARTIFACTORY_SERVER_1 }} + + - name: Ping Artifactory with jfrog CLI + run: | + # Ping the server + jfrog rt ping + + - name: Run Cleanup + run: | + ./build/gh-action-cleanup-artifactory.sh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FROM_DATE: ${{ github.event.inputs.from_date || '30 days ago' }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..910b2ac47 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,110 @@ +name: Release +on: + workflow_dispatch: + inputs: + release_version: + description: 'version to be released' + required: true + default: '' + + +defaults: + run: + shell: bash + +jobs: + release: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + # Disabling shallow clone to access git history (specially tags for comparing) + fetch-depth: 0 + token: ${{ secrets.YSTIA_BOT_TOKEN }} + - name: Configure Git user + run: | + git config user.email "ystiabot@users.noreply.github.com" + git config user.name "@YstiaBot" + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: pip install semantic_version + + - name: Tag and push a release + id: release + run: | + ./build/release.sh -v "${{ github.event.inputs.release_version }}" + read -r major minor patch prerelease build <<< $(python -c "import semantic_version; v = semantic_version.Version('${{ github.event.inputs.release_version }}'); print(v.major, v.minor, v.patch, '.'.join(v.prerelease), '.'.join(v.build));") + if [[ -z "${prerelease}" ]] ; then + echo "PRERELEASE=false" >> $GITHUB_ENV + else + echo "PRERELEASE=true" >> $GITHUB_ENV + fi + tagName="v${{ github.event.inputs.release_version }}" + echo "TAG_NAME=${tagName}" >> $GITHUB_ENV + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout tag + uses: actions/checkout@v2 + with: + ref: ${{ env.TAG_NAME }} + token: ${{ secrets.YSTIA_BOT_TOKEN }} + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install sphinx dependencies + run: | + pip install --user --upgrade sphinx==1.8.1 semantic-version requests urllib3[secure]==1.23 Pygments>=2.7.1 + pip install -r doc/requirements.txt + sudo apt-get install -y jq \ + latexmk \ + texlive-binaries \ + texlive-fonts-recommended \ + texlive-latex-base \ + texlive-latex-extra \ + texlive-latex-recommended + + - name: Setup go + uses: actions/setup-go@v1 + with: + go-version: "1" + + - name: Generate distribution and changelog + run: | + set -euo pipefail + make tools + SKIP_TESTS=1 make dist + # Generate changelog + awk '{f=1} f{ if (/^## / && i++>=1) exit; else print $0}' CHANGELOG.md | tee CHANGELOG-for-version.md + + + - name: Create or Update Github Release draft + id: update_release + uses: loicalbertin/action-gh-release@080e2e752ac77817dcfd2e8809873bdc24817584 + with: + tag_name: ${{ env.TAG_NAME }} + body_path: CHANGELOG-for-version.md + name: ${{ env.TAG_NAME }} + prerelease: ${{ env.PRERELEASE }} + draft: true + files: | + dist/yorc-*.tgz + dist/yorc-server*-distrib.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish Github Release + uses: eregon/publish-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_id: ${{ steps.update_release.outputs.id }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6b1e3fd36..000000000 --- a/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -language: go -go: - - stable - -dist: xenial -sudo: required - -services: - - docker - -env: - global: - # Make GO111MODULE=on globally for codecov - - GO111MODULE=on - # Docker hub key (DOCKER_HUB_USER) - - secure: j6S26JA04B+6bwr6detZauFu/UVPwmPhWvEcbVfNhvnNX3YKma8D2X9hvE6jDUOKeapiE/UsCHVgg8GFyPGu4M0ixUXUmu7HPNHFQ2x4a0tDgTyu0p9im5fPeJv4qbV+ORuE4Kvg54ZaZec3iBN94MegPVISpme86pMKdJui0cMEy/YPMUd1sh13h95WkESAshJd0n5AHO4xwD0NJjCK2waoA6ygvcwXhIpfTc9HsNgs6S8WVpRAfjkTj7+VGjoXTqov5g9d6SxBYvcJI/iBa0KgY7LhBRiC6AsE2WowVZeGDpnvL1nFsA2DQKcCC6Tv4VlP7jcyZMWcnELn8n6ucsHzT52bEhGu60KtZc5eohqW/1Ejb0riHvEJQMy875keBwIjuzERgxRaKEVGPQ3nZFu/rjEjHZSm0qi9+usb/vBcdKeu9fgjBeEDIkL5bE632P379VLI1bzzQS+dt+sPw1gqqDP+FJ1nED5r3g4zSPh4WqXAz4ohrX8CCqbxpy+Wjirer/yc7S+Bqx/iI2gKjdb6kwy1xePobFJyAMlOyHrwh5Tb6K23wJqVMoHL5mqG0Ent/3iXmvRS6PxsxwNPscyATUbazyGwXMj4oMWzcfs7yf0ADy/nbZLYUPVfHuysRZ6LAjptn+V8bdJ9A0rQmFUFDcP6VmMidxRlTcHR8yA= - # Docker hub key (DOCKER_HUB_PASS) - - secure: "ZNF+PdDD1D3RJN6/ENFt9jZL+QQp1s9sdOMyQBRPPmc/oBOh0j6ELBpvQTgR7JnhzlUyYvfAk1IXPTJPEwoQ++WmAumdGUu6mEqemN//CggpYNtDRc3vnQfRrfWK5M9pVtODSwtMLT0WENkMURCUPBmlGcISjdXrHAAsLiiJxDalM6rBiPDnDX/yawvfJh2mNVkqi+zwJWGdEZibcNdU8Bdz5vU5eJJFxlR+ZYRm2ccLE/sgvArofovcv32MSy9DnvI15Q8kolTS8+3k6eOTvckijgJizYOhRyAZQRrLeF3taYw5GtTRwjs2UFAkxgbx/NrgSHEe/e+31k5Q4sUFJJr3iIilMC+VCVpIDnFbDXJJR8VTXLG3Xjb4NZycGU5wo2PUGXedR+vR+NUVw2E2LH6L1aJBse4lHba1yRh+255jaiebg5iocOnsiMfRtboLKDy0uNoXaAsI/wGNSlxGncXS9euHYPTXp595TKUPyfEUwF5NVvihHAUJOagr4c/bbLe6EHbmY7XFJHdqX/jxul13RQjpEHmVC6ZlpPlRqWIZVrfG1B4SF/m6NVVLc+8dz1xPb2FWmkjiijtElQhAqbzImW1GPf1QiX3jlHWDxE3DdUdy4kbh10zyh66gqWRnfkS3pVJaB2wLHlfZc7GU+eFgs78b3yk9KZivPOaTAtU=" - # ARTIFACTORY_API_KEY - - secure: "Zt5jCb10K4mnjqL0Bx5pR+qvexrLDz3nIk/IaOjL+QfHQI5w3uXv9qc+ultgsYpdT4ORmN235kJia294UTa+N/F/aJwCS4y+gBlssDkABz0D2/dSSK9iMjdUxyv2lg4NT6yUzefYI+nWziJqhVDg3tgcxy61ENn2c+AWHeEYrRyfgbuvehuyl56ZKggJe1WJkaHSRd1UVc/7i/pPo2nomaaWF8jjDxcqlIiV1onqVzb5p/79psuFZyHKH9Xr59lNsLDPEunyXQu0U8Y3ivV4gCL2+GyiZz7INpPemu5IQtA2luViepJcyRWAZOitL+vTScJgeV4k/OKZWHtNAspH4aiRFc3xVV0xe8itoHvnRN4IMJtEAqD4ODZ1XEyGovUkozoLLTfM20fXfLujLT+g9EjtmSWFap5CdvELs2foPYyiKjx2tB35Km/Pg9DgTMn5lsjMNPOm9N6QhHYCrMm095CceYHFZsfqIfONLJSd5RssnNrScsqGbS5BqKuqza8ffH6BvdoBwJauJwGvSBakaOpEtkCs+Sl4RVCtajTPMG/KgatCUk0HJELIUJyj83LpTUA8K85WcTh8dYb/0K2Lo5TU4Hd9pa8u3KbHtf3CVEmxIaece7rDiwuzQK0DTB4E599u5FJiG7tPaMG+Hvll98cn1czcqlYSU6jgn/nTeC8=" - -install: - - make tools - - pip install --user --upgrade sphinx==1.8.1 semantic-version requests urllib3[secure]==1.23 - -script: - # Test and compute coverage - - TESTARGS="-coverprofile coverage-sonar.out -coverpkg=./..." make json-test - - ./build/travis-sonar.sh - # Generate distribution - - SKIP_TESTS=1 make dist - - "./docker_build.sh" - - echo "Deploying artifacts" - - bash "./build/deploy_artifactory.sh" - -before_deploy: - - "bash ./build/pre_bintray_release.sh" - -deploy: - - provider: bintray - file: "build/bintray_release.json" - user: "loicalbertin" - key: - secure: "qC48VD6cU2jxx1Px+jsu3s3D7Qz9dAMSrNwLEoV4h+qG0TYR/2qLuHQIWj4amO4aLXjDQKxg8YcUb5Z63a8AKDoaXH5kiWoYt3+zNj0Sv5C9kv+/DqA4T/G63mOZXxbDkD/3WYxslZhnB4R4/qMhK+yyZNRp7BmuO1IDj320fTyZqBd4ZoHM29ihOHIr/+GRENXY+VSHFvyiZ7JMOiUwWVyR/8miBaNLblQqU5vTy0HdJmuJD4jlNaS68pnvuhSnIGuVHuYbdo9BOHemw1XYCt7T3te8C1CkMk9eGhuBlhxlFDZeKInqioaquoD7dcz7kw1tvfD5kM/XrZ4fw+E2yOP3ZY9bIkHzh9kFh+mknT3VHQ7K8BWT5OPHLoFmTtdld9q96PRVvBQMiBssckBqnxD/MFiym/498L4nN7R6E4yydkHeH9RWkPn7LMjfGJl/GbkThGXg4aViNbs0a9XpVGl+TcKKY7zZdh+Wj/OvEHZZbpmm44EcnMcyE04AMyhgVqEipB61FhIMDXWwlQRJX0wF+YKMJo0BfDjU2YEeNYL87bhslQQf4z46ZHL9EAAaqq74r5KI6ivvLK8hYpYRSkS0l3DOmNunbnfw38MxHNTZUMer7pD8quRhdHCBiSwPbj/FIKeY4/Ujt66evkASqEkKR20y1MYmE3N1VI0DusE=" - skip_cleanup: true - on: - tags: true - -addons: - apt: - packages: - - jq - - latexmk - - texlive-binaries - - texlive-fonts-recommended - - texlive-latex-base - - texlive-latex-extra - - texlive-latex-recommended - - sonarcloud: - organization: "ystia" - -cache: - directories: - - '$HOME/.sonar/cache' diff --git a/CHANGELOG.md b/CHANGELOG.md index b18520a44..ad89d3a71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,26 @@ ## UNRELEASED +### ENHANCEMENTS + +* Add the ability to define OpenStack Compute Instance user_data ([GH-735](https://github.com/ystia/yorc/issues/735)) + +### BUG FIXES + +* Workflow with asynchronous action never stops after another step failure ([GH-733](https://github.com/ystia/yorc/issues/733)) + +## 4.2.0-milestone.1 (May 06, 2021) + +### ENHANCEMENTS + +* Support Alien4Cloud 3.2.0 ([GH-723](https://github.com/ystia/yorc/issues/723)) + +### BUG FIXES + +* Can't bootstrap Yorc as BinTray is now unavailable ([GH-727](https://github.com/ystia/yorc/issues/727)) + +## 4.1.0 (April 11, 2021) + ### DEPENDENCIES * The orchestrator requires now at least Ansible 2.10.0 (upgrade from 2.7.9 introduced in [GH-648](https://github.com/ystia/yorc/issues/648)) @@ -20,6 +40,7 @@ ### ENHANCEMENTS +* Alllow shards and replicas configuration for Elastic storage ([GH-722](https://github.com/ystia/yorc/issues/722)) * Add a new synchronous purge API endpoint ([GH-707](https://github.com/ystia/yorc/issues/707)) * Should be able to specify the type of volume when creating an openstack instance ([GH-703](https://github.com/ystia/yorc/issues/703)) * Support ssh connection retries ([GH-688](https://github.com/ystia/yorc/issues/688)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e008829c..a4da98ca7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -96,3 +96,17 @@ If you are having trouble getting into the mood of idiomatic Go, we recommend reading through [Effective Go](https://golang.org/doc/effective_go.html). The [Go Blog](https://blog.golang.org) is also a great resource. Drinking the kool-aid is a lot easier than going thirsty. + +## Release Yorc + +Releases are now handled by a [GitHub Action Workflow](https://github.com/ystia/yorc/actions/workflows/release.yml). +Contributors with `members` role on this project can trigger this workflow. it requires as an input the release version +in semver format (leading 'v' should be omitted). + +This workflow will: + +1. call the `build/release.sh` script +2. checkout the generated tag +3. generate the distribution and a changelog for this version +4. create a GH Release and upload assets +5. publish the GH Release diff --git a/README.md b/README.md index 517e359cb..1d5386548 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Ystia Orchestrator -[](https://bintray.com/ystia/yorc-engine/distributions/4.0.0/link) [](https://travis-ci.org/ystia/yorc) [](http://yorc.readthedocs.io/en/latest/?badge=latest) [](https://goreportcard.com/report/github.com/ystia/yorc) [](https://github.com/ystia/yorc/blob/develop/LICENSE) [](http://makeapullrequest.com) [](https://hub.docker.com/r/ystia/yorc) [](https://gitter.im/ystia/yorc?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[](https://github.com/ystia/yorc/releases/tag/v4.2.0-milestone.1) [](https://github.com/ystia/yorc/actions) [](http://yorc.readthedocs.io/en/latest/?badge=latest) [](https://goreportcard.com/report/github.com/ystia/yorc) [](https://github.com/ystia/yorc/blob/develop/LICENSE) [](http://makeapullrequest.com) [](https://hub.docker.com/r/ystia/yorc) [](https://gitter.im/ystia/yorc?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
@@ -24,9 +24,9 @@ Yorc is now the official orchestrator for Alien4Cloud and Alien4Cloud distributi
## How to download the Ystia Orchestrator
-Yorc releases can be downloaded from our [BinTray account](https://bintray.com/ystia/yorc-engine/distributions).
+Yorc releases can be downloaded from our [GitHub Release](https://github.com/ystia/yorc/releases).
-Grab the [latest release here](https://bintray.com/ystia/yorc-engine/distributions/_latestVersion).
+Grab the [latest release here](https://github.com/ystia/yorc/releases/latest).
Docker images could be found on [Docker Hub](https://hub.docker.com/r/ystia/yorc).
diff --git a/SECURITY.md b/SECURITY.md
index 03bf4c004..1184de535 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -6,8 +6,9 @@ This section describes which versions of Yorc are currently being supported with
| Version | Supported |
| ------- | ------------------ |
+| 4.1.x | :white_check_mark: |
| 4.0.x | :white_check_mark: |
-| 3.2.x | :white_check_mark: |
+| 3.2.x | :x: |
| < 3.2 | :x: |
## Vulnerabilities in Yorc
diff --git a/build/bintray_release.json.tpl b/build/bintray_release.json.tpl
deleted file mode 100644
index 6f8db016a..000000000
--- a/build/bintray_release.json.tpl
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "package": {
- "name": "distributions",
- "repo": "yorc-engine",
- "subject": "ystia",
- "desc": "Ystia Orchestrator distributions and documentations",
- "website_url": "https://ystia.github.io/",
- "issue_tracker_url": "https://github.com/ystia/yorc/issues",
- "vcs_url": "https://github.com/ystia/yorc",
- "github_use_tag_release_notes": false,
- "github_release_notes_file": "CHANGELOG.md",
- "licenses": ["Apache-2.0"],
- "labels": [],
- "public_download_numbers": true,
- "public_stats": false,
- "attributes": []
- },
-
- "version": {
- "name": "${VERSION_NAME}",
- "desc": "Ystia Orchestrator distributions and documentations ${VERSION_NAME}",
- "released": "${RELEASE_DATE}",
- "vcs_tag": "${TAG_NAME}",
- "attributes": [],
- "gpgSign": false
- },
-
- "files":
- [
- {"includePattern": "dist/(yorc-.*\\.tgz)", "uploadPattern": "${VERSION_NAME}/$1"},
- {"includePattern": "dist/(yorc-server-.*-distrib\\.zip)", "uploadPattern": "${VERSION_NAME}/$1"},
- {"includePattern": "pkg/(docker-ystia-yorc-.*\\.tgz)", "uploadPattern": "${VERSION_NAME}/$1"}
- ],
- "publish": true
-}
-
diff --git a/build/deploy_artifactory.sh b/build/deploy_artifactory.sh
index d368d40ab..7826dc157 100755
--- a/build/deploy_artifactory.sh
+++ b/build/deploy_artifactory.sh
@@ -13,43 +13,36 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+set -euo pipefail
scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
rootDir=$(readlink -f "${scriptDir}/..")
-if [[ "${TRAVIS}" != "true" ]] ; then
+if [[ "${GITHUB_ACTIONS}" != "true" ]] ; then
echo "This script is designed to publish CI build artifacts"
exit 0
fi
-if [[ "${DISABLE_ARTIFACTORY}" == "true" ]] ; then
+if [[ "${DISABLE_ARTIFACTORY:=false}" == "true" ]] ; then
echo "Skipping Artifactory publication"
exit 0
fi
-if [[ "${TRAVIS_PULL_REQUEST}" != "false" ]] && [[ -z "${ARTIFACTORY_API_KEY}" ]] ; then
- echo "Building an external pull request, artifactory publication is disabled"
- exit 0
-fi
-
-if [[ -n "${TRAVIS_TAG}" ]] ; then
- deploy_path="yorc-engine-product-ystia-dist/ystia/yorc/dist/${TRAVIS_TAG}/{1}"
-elif [[ "${TRAVIS_PULL_REQUEST}" != "false" ]]; then
- deploy_path="yorc-bin-dev-local/ystia/yorc/dist/PR-${TRAVIS_PULL_REQUEST}/{1}"
+ref="${GITHUB_REF#refs/*/}"
+if [[ "${GITHUB_REF}" == refs/tags/* ]] ; then
+ deploy_path="yorc-engine-product-ystia-dist/ystia/yorc/dist/${ref}/{1}"
+elif [[ "${GITHUB_REF}" == refs/pull/* ]] ; then
+ # For PRs ref is different
+ ref=$(echo "${GITHUB_REF}" | awk -F / '{print $3;}')
+ deploy_path="yorc-bin-dev-local/ystia/yorc/dist/PR-${ref}/{1}"
else
- deploy_path="yorc-bin-dev-local/ystia/yorc/dist/${TRAVIS_BRANCH}/{1}"
+ deploy_path="yorc-bin-dev-local/ystia/yorc/dist/${ref}/{1}"
fi
-curl -fL https://getcli.jfrog.io | sh
-
-build_name="yorc-travis-ci"
-
-# Disabling interactive mode as config ask for a question about client certificates we do not use
-./jfrog rt c --interactive=false --apikey="${ARTIFACTORY_API_KEY}" --user=travis --url=https://ystia.jfrog.io/ystia ystia
+cd "${rootDir}"
-./jfrog rt u --build-name="${build_name}" --build-number="${TRAVIS_BUILD_NUMBER}" --props="artifactory.licenses=Apache-2.0" --regexp "dist/(yorc-.*.tgz)" "${deploy_path}"
-./jfrog rt u --build-name="${build_name}" --build-number="${TRAVIS_BUILD_NUMBER}" --props="artifactory.licenses=Apache-2.0" --regexp "dist/(yorc-server.*-distrib.zip)" "${deploy_path}"
-# Do not publish environment variables as it may expose some secrets
-#./jfrog rt bce "${build_name}" "${TRAVIS_BUILD_NUMBER}"
-./jfrog rt bag "${build_name}" "${TRAVIS_BUILD_NUMBER}" "${rootDir}"
-./jfrog rt bp "${build_name}" "${TRAVIS_BUILD_NUMBER}"
+jfrog rt u --target-props="artifactory.licenses=Apache-2.0" --regexp "dist/(yorc-.*.tgz)" "${deploy_path}"
+jfrog rt u --target-props="artifactory.licenses=Apache-2.0" --regexp "dist/(yorc-server.*-distrib.zip)" "${deploy_path}"
+jfrog rt bce
+jfrog rt bag
+jfrog rt bp
diff --git a/build/gh-action-cleanup-artifactory.sh b/build/gh-action-cleanup-artifactory.sh
new file mode 100755
index 000000000..ca59e9411
--- /dev/null
+++ b/build/gh-action-cleanup-artifactory.sh
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+# Copyright 2019 Bull S.A.S. Atos Technologies - Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois, France.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+set -euo pipefail
+
+comp_date=$(date --date="${FROM_DATE:=14 days ago}" +"%Y-%m-%dT%H:%M:%S.000Z")
+
+local_bin_dist_path="yorc-bin-dev-local/ystia/yorc/dist"
+local_docker_path="yorc-docker-dev-local/ystia/yorc"
+
+bin_paths=$(jfrog rt s "${local_bin_dist_path}/*/yorc-*.tgz" --limit 0 | jq -r ".[]| [.modified, .path] | @tsv" | sed -e "s@\(${local_bin_dist_path}/\(.*\)\)/yorc-.*\.tgz@\2\t\1@g")
+docker_paths=$(jfrog rt s "${local_docker_path}/PR-*/manifest.json" --limit 0 | jq -r ".[]| [.modified, .path] | @tsv" | sed -e "s@\(${local_docker_path}/\(PR-.*\)\)/manifest.json@\2\t\1@g")
+
+all_paths=$(echo -e "${bin_paths}\n${docker_paths}" | sort)
+
+function get_pr_state() {
+ gh pr view "${1}" --json state | jq -r ".state"
+}
+
+function does_branch_exit() {
+ gh api --silent "/repos/:owner/:repo/branches/${1}" 2> /dev/null
+ return $?
+}
+
+function delete_artifactory_path() {
+ jfrog rt del --quiet "${1}" || echo "failed to delete ${1}"
+}
+
+echo "${all_paths}" | while read line ; do
+ item_date=$(echo "$line" | awk '{print $1}')
+ if [[ "${item_date}" > "${comp_date}" ]] ; then
+ continue
+ fi
+ ref=$(echo "${line}" | awk -F '\t' '{print $2}')
+ artifact_path=$(echo "${line}" | awk -F '\t' '{print $3}')
+ if [[ "${ref}" == PR-* ]] ; then
+ if [[ "$(get_pr_state "${ref##*PR-}")" != "OPEN" ]] ; then
+ delete_artifactory_path "${artifact_path}"
+ fi
+ else
+ if ! does_branch_exit "${ref}" ; then
+ delete_artifactory_path "${artifact_path}"
+ fi
+ fi
+done
diff --git a/build/pre_bintray_release.sh b/build/pre_bintray_release.sh
deleted file mode 100755
index f6ce4ba04..000000000
--- a/build/pre_bintray_release.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2018 Bull S.A.S. Atos Technologies - Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois, France.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -e
-
-scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-
-if [[ -z "${TRAVIS_TAG}" ]]; then
- echo "not a travis release build, no need to publish it on bintray. Exiting."
- exit 0
-fi
-
-TAG_NAME="${TRAVIS_TAG}"
-VERSION_NAME="${TAG_NAME#v*}"
-RELEASE_DATE="$(git tag -l --format='%(creatordate:short)' "${TAG_NAME}")"
-
-export TAG_NAME VERSION_NAME RELEASE_DATE
-envsubst < "${scriptDir}/bintray_release.json.tpl" > "${scriptDir}/bintray_release.json"
-
-echo "Resulting bintray release spec"
-cat "${scriptDir}/bintray_release.json"
diff --git a/build/release.sh b/build/release.sh
index 3d7fd8b02..e88a4d2af 100755
--- a/build/release.sh
+++ b/build/release.sh
@@ -14,7 +14,7 @@
# limitations under the License.
#set -x
-set -e
+set -eo pipefail
scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
componentVersionName="yorc_version"
@@ -56,13 +56,13 @@ if [[ -z "${version}" ]]; then
exit 1
fi
-if [[ "$(python -c "import semantic_version; print semantic_version.validate('${version}')" )" != "True" ]]; then
+if [[ "$(python -c "import semantic_version; print(semantic_version.validate('${version}'))" )" != "True" ]]; then
echo "Parameter -v should be a semver 2.0 compatible version (http://semver.org/)" >&2
exit 1
fi
# read version
-read -r major minor patch prerelease build <<< $(python -c "import semantic_version; v = semantic_version.Version('${version}'); print v.major, v.minor, v.patch, '.'.join(v.prerelease), '.'.join(v.build);")
+read -r major minor patch prerelease build <<< $(python -c "import semantic_version; v = semantic_version.Version('${version}'); print(v.major, v.minor, v.patch, '.'.join(v.prerelease), '.'.join(v.build));")
# Detect correct supporting branch
branch=$(git branch --list -r "*/release/${major}.${minor}")
@@ -79,7 +79,7 @@ if [[ -e versions.yaml ]]; then
currentVersion=$(grep "${componentVersionName}:" versions.yaml | head -1 | sed -e 's/^[^:]\+:\s*\(.*\)\s*$/\1/')
# Change -SNAPSHOT into -0 for comparaison as a snapshot is never revelant
checkVers=$(echo ${currentVersion} | sed -e "s/-SNAPSHOT/-0/")
- if [[ "True" != "$(python -c "import semantic_version; print semantic_version.Version('${version}') >= semantic_version.Version('${checkVers}')" )" ]]; then
+ if [[ "True" != "$(python -c "import semantic_version; print(semantic_version.Version('${version}') >= semantic_version.Version('${checkVers}'))" )" ]]; then
echo "Warning: releasing version ${version} on top of branch ${branch} while its current version is ${currentVersion}" >&2
read -p "Are you sure? [y/N]" CONFIRM
if [[ "${CONFIRM}" != "y" && "${CONFIRM}" != "Y" ]] ; then
@@ -94,7 +94,7 @@ branchTag=$(git describe --abbrev=0 --tags ${branch}) || {
}
branchTag=$(echo $branchTag | sed -e 's/^v\(.*\)$/\1/')
-if [[ "True" != "$(python -c "import semantic_version; print semantic_version.Version('${version}') > semantic_version.Version('${branchTag}')" )" ]]; then
+if [[ "True" != "$(python -c "import semantic_version; print(semantic_version.Version('${version}') > semantic_version.Version('${branchTag}'))" )" ]]; then
echo "Warning: releasing version ${version} on top of branch ${branch} while it contains a newer tag: ${branchTag}" >&2
read -p "Are you sure? [y/N]" CONFIRM
if [[ "${CONFIRM}" != "y" && "${CONFIRM}" != "Y" ]] ; then
@@ -107,7 +107,7 @@ if [[ "develop" == "${branch}" ]] && [[ -z "${prerelease}" ]]; then
releaseBranch="release/${major}.${minor}"
git checkout -b "${releaseBranch}"
sed -i -e "s@svg?branch=[^)]*@svg?branch=${releaseBranch}@g" README.md
- git commit -m "Update travis links in readme for release ${version}" README.md
+ git commit -m "Update CI links in readme for release ${version}" README.md
fi
# Now checks are passed then tag, build, release and cleanup :)
@@ -115,7 +115,9 @@ cherries=()
# Update changelog Release date
sed -i -e "s/^## UNRELEASED.*$/## ${version} ($(LC_ALL=C date +'%B %d, %Y'))/g" CHANGELOG.md
# Update readme for Release number
-sed -i -e "s@download.svg?version=[^)]*@download.svg?version=${version}@g" -e "s@distributions/[^/]*/link@distributions/${version}/link@g" README.md
+versionShield=$(echo "${version}" | sed -e 's/-/--/g')
+sed -i -e "s@https://img.shields.io/badge/download-[^-]*-blue@https://img.shields.io/badge/download-v${versionShield}-blue@g" \
+ -e "s@releases/tag/[^)]*@releases/tag/v${version}@g" README.md
git commit -m "Update changelog and readme for release ${version}" CHANGELOG.md README.md
cherries+=("$(git log -1 --pretty=format:"%h")")
@@ -137,7 +139,7 @@ if [[ -e versions.yaml ]]; then
nextDevelopmentVersion=""
if [[ -z "${prerelease}" ]]; then
# We are releasing a final version
- nextDevelopmentVersion=$(python -c "import semantic_version; v=semantic_version.Version('${version}'); print v.next_patch()" )
+ nextDevelopmentVersion=$(python -c "import semantic_version; v=semantic_version.Version('${version}'); print(v.next_patch())" )
nextDevelopmentVersion="${nextDevelopmentVersion}-SNAPSHOT"
else
# in prerelease revert to version minus prerelease plus -SNAPSHOT
@@ -159,7 +161,7 @@ if [[ "develop" == "${branch}" ]] && [[ -z "${prerelease}" ]]; then
if [[ -e versions.yaml ]]; then
# Update version
- nextDevelopmentVersion=$(python -c "import semantic_version; v=semantic_version.Version('${version}'); print v.next_minor()" )
+ nextDevelopmentVersion=$(python -c "import semantic_version; v=semantic_version.Version('${version}'); print(v.next_minor())" )
nextDevelopmentVersion="${nextDevelopmentVersion}-SNAPSHOT"
sed -i -e "/${componentVersionName}: /c${componentVersionName}: ${nextDevelopmentVersion}" versions.yaml
git commit -m "Prepare for next development cycle ${nextDevelopmentVersion}" versions.yaml
@@ -168,12 +170,12 @@ fi
if [[ -z "${prerelease}" ]]; then
# Merge on master only final version
- masterTag=$(git describe --abbrev=0 --tags master) || {
+ masterTag=$(git describe --abbrev=0 --tags origin/master) || {
masterTag="v0.0.0"
}
masterTag=$(echo ${masterTag} | sed -e 's/^v\(.*\)$/\1/')
- if [[ "True" == "$(python -c "import semantic_version; print semantic_version.Version('${version}') > semantic_version.Version('${masterTag}')" )" ]]; then
+ if [[ "True" == "$(python -c "import semantic_version; print(semantic_version.Version('${version}') > semantic_version.Version('${masterTag}'))" )" ]]; then
# We should merge the tag to master as it is our highest release
git checkout master
git merge --no-ff "v${version}" -X theirs -m "merging latest tag v${version} into master" || {
diff --git a/build/travis-sonar.sh b/build/travis-sonar.sh
deleted file mode 100755
index 766d14e72..000000000
--- a/build/travis-sonar.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2019 Bull S.A.S. Atos Technologies - Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois, France.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -eo pipefail
-
-scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-
-if [[ -z "${SONAR_TOKEN}" ]] ; then
- echo "No sonar token detected, we are probably building an external PR, lets skip sonar publication..."
- exit 0
-fi
-
-cd "${scriptDir}/.." || { echo "failed to move to yorc directory ${scriptDir}/.."; exit 1; }
-sed -i -e "s@$(go list)@github.com/ystia/yorc@g" coverage-sonar.out
-git fetch --no-tags origin "+refs/heads/develop:refs/remotes/origin/develop" "+refs/heads/release/*:refs/remotes/origin/release/*"
-git fetch --unshallow --quiet
-sonar-scanner --define "sonar.projectVersion=$(grep "yorc_version" versions.yaml | awk '{print $2}')"
diff --git a/commands/bootstrap/inputs.go b/commands/bootstrap/inputs.go
index 96c2b8112..afb51238b 100644
--- a/commands/bootstrap/inputs.go
+++ b/commands/bootstrap/inputs.go
@@ -178,11 +178,11 @@ var (
jdkDefaultInputs = map[string]defaultInputType{
"jdk.download_url": defaultInputType{
description: "Java Development Kit download URL",
- value: "https://api.adoptopenjdk.net/v2/binary/releases/openjdk8?openjdk_impl=hotspot&os=linux&arch=x64&release=jdk8u212-b03&type=jdk",
+ value: "https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.2%2B7/OpenJDK15U-jdk_x64_linux_hotspot_15.0.2_7.tar.gz",
},
"jdk.version": defaultInputType{
- description: "Java Development Kit version",
- value: "1.8.0-212-b03",
+ description: "OpenJDK version",
+ value: "15.0.2",
},
}
@@ -1552,7 +1552,7 @@ func getYorcDownloadURL() string {
yorcVersion)
} else {
downloadURL = fmt.Sprintf(
- "https://dl.bintray.com/ystia/yorc-engine/%s/yorc-%s.tgz",
+ "https://github.com/ystia/yorc/releases/download/v%s/yorc-%s.tgz",
yorcVersion, yorcVersion)
}
return downloadURL
diff --git a/commands/bootstrap/resources/topology/tosca_types.zip b/commands/bootstrap/resources/topology/tosca_types.zip
index e2089ab18..71620a04c 100644
Binary files a/commands/bootstrap/resources/topology/tosca_types.zip and b/commands/bootstrap/resources/topology/tosca_types.zip differ
diff --git a/data/tosca/yorc-openstack-types.yml b/data/tosca/yorc-openstack-types.yml
index 0c0f0ef13..eda6cd3f7 100644
--- a/data/tosca/yorc-openstack-types.yml
+++ b/data/tosca/yorc-openstack-types.yml
@@ -3,7 +3,7 @@ tosca_definitions_version: yorc_tosca_simple_yaml_1_0
metadata:
template_name: yorc-openstack-types
template_author: yorc
- template_version: 1.2.1
+ template_version: 1.3.0
imports:
- yorc: