- Clone or copy the "sample-stack" git repository
- Change directory to the
sample-stack
directory - Delete the
starter
directory (which contains the starter stack) - Create a new stack directory, within the base directory of the Git repository, to contain the stack to be published. For example:
mkdir ./my-nodejs
- Copy or create your stack in this new directory. Look at Developing Stacks for information on how to create a stack.
- Package and test your stack. There are 2 ways that you can package and test your stack. These are:
- Using the Appsody CLI
stack
commands, see Packaging stacks - Using the CI scripts provided within the sample-stack repo, see Packaging a stack using CI scripts
If using Travis CI within your git repository, it may be preferable to use the CI scripts as they are used when you push your stack to your git repository.
- Using the Appsody CLI
- Once you have developed, packaged and tested your stack you then push your repository to your GitHub organization. i.e.
https://github.com/myorg/my-nodejs
-
Use environment variables to override default settings that are used by the build script, for example the namespace to use for the Docker images, and the URL to use to reference the template archive files. The main variables to override are:
IMAGE_REGISTRY_ORG
this is the namespace to create the Docker images with.RELEASE_URL
this is the base URL to your web hosting service, and is used to reference the template archive files from within the repository index file.
You can set these environment variables by exporting them. For example:
export IMAGE_REGISTRY_ORG=myproject export RELEASE_URL=https://github.com/myorg/my-nodejs/releases/latest/download
-
Run the build script from the base directory of the git repository. For example:
./ci/build.sh
This command creates the following artefacts in the
./ci/assets
directory:- stack index file (containing remote URLs)
- template archive files
- stack source file
and in the local docker registry:
- stack container images
To configure your git repository to use Travis CI follow the "Get started with Travis using Github" instructions
The "sample-stack" git repository contains the files that provide support for building and releasing of the stack. These file are:
- ./ci/* : the CI scripts that will perform the build and the release of the stack
- ./travis.yml : the travis configuration file
Similar to when running the CI scripts locally, there are environment variables that need to be setup within your Travis environment. Use the "Defining Variables in Repository Setting" Travis documentation to define environment variables.
The environment variables you will need to override are:
IMAGE_REGISTRY_ORG
this is the namespace to create the Docker images with.RELEASE_URL
this is the base URL to your web hosting service, and is used to reference the template archive files from within the repository index file.CODEWIND_INDEX
this specifies whether to build the indexfile for use with Codewind. Default=false.GITHUB_TOKEN
this is a user access token to allow access to your Github org.IMAGE_REGISTRY_USERNAME
this is the username that will be used to logon to your docker registry when publishing the docker images.IMAGE_REGISTRY_PASSWORD
this is the password that will be used to logon to your docker registry when publishing the docker images.