Picking up source code

Edit the configuration file

The only file that a release manager needs to edit is the JSON-format configuration file named config.json under the folder tools. You can specify the the staging url, release url, the list of projects to be release, the repository url, branch name, and hash value of the source code for each project, etc.

Template of config.json:

{
  "publish_stage": "false",
  "stage_url": "https://dist.apache.org/repos/dist/dev/openwhisk",
  "release_url": "https://dist.apache.org/repos/dist/release/openwhisk",
  "versioning": {
    "version": "",
    "pre_release_version": "rc1"
  },
  "RepoList": [
    "openwhisk",
    "openwhisk-wskdeploy",
    "openwhisk-cli"
  ],
  "openwhisk": {
    "hash": "a891e06",
    "repository": "https://github.com/apache/openwhisk.git",
    "branch": "master"
  },
  "openwhisk_wskdeploy": {
    "hash": "1425456",
    "repository": "https://github.com/apache/openwhisk-wskdeploy.git",
    "branch": "master"
  },
  "openwhisk_cli": {
    "hash": "1448d31",
    "repository": "https://github.com/apache/openwhisk-cli.git",
    "branch": "master"
  }
}
  • publish_stage: the field to specify whether the Travis build in master will upload the new artifacts to the staging URL or not. If it is set to false, the Travis build in master will not upload the artifacts. If it is set to true, the Travis build in master will upload the artifacts.
  • stage_url: the field to specify the staging url, where to upload the artifacts.
  • release_url: the field to specify the Apache release directory url, where to finally release the artifacts.
  • versioning: the key to define the release name, with both a version and a pre-release version name.
  • RepoList: the key to define the list of OpenWhisk projects to be released. Based on this key, we need to add other keys below with each of them matching each project name. For example, we define three projects in RepoList, so we have three other keys below to match each project.
  • <project_name>: the key used to match one OpenWhisk project. If there is any hyphen(-) sign in the project name, we need to convert it into underscore(_). Hash key defines the hash value, repository defines the url of the project repository, and branch defines the branch name in the project repository. We can precisely locate a version of the source code to pick up for the release.

Download the source code to a local directory

Run the following script to download source code based on the configuration in config.json:

$ ./download_source_code.sh

After this script is executed, a directory called stagingArea will be created under the home directory of openwhisk release tool, if it is not available. The directory stagingArea will save the output files, including the source code of all the OpenWhisk repositories, packages to be rleased, signature, checksums, etc, when we run any bash script of this release tool.