CIEnvy runtime containers
5.4K
A novel CI controller that manages whole CI flows. Works well with Drone CI
yarn installyarn run buildconfigyarn forever:start
yarn forever:stop
yarn forever:restart
tail -f cienvy.log
Assume host path is /home/core/cienvy, put git deploy private key (id_rsa) in the host path. Then:
docker run -d --restart=always --name="cienvy" \
-p 9090:9090 \
-v /home/core/cienvy:/cienvy \
-v /home/core/cienvy-client:/cienvy-client \
-v cienvy-volumes:/volumes \
southbanksoftware/cienvy
.cienvy folder in the repo, and create a config.yml.cienvy/src[CI CONF] (or [CONF CI], [CI CONFIG], [CONFIG CI]) in commit message. This will instruct CIEnvy to configure the corresponding CI node only. Note: you have to do this for each node affected whenever you have changed CI network structure or added new nodes. You don't need to do this for updating volume mappings.In Docker for Mac, named volume is as fast as container fs, and mounted volume is the slowest due to virtualisation bridging to host fs. Therefore, named volume is used in CI container to persist build artifact, and when host needs to access those artifacts, some ephemeral containers can be created to either symlinking or copying them.
docker volume create cienvy-volumes
docker volume create drone-server-data
docker run --rm -it -v cienvy-volumes:/volumes -v drone-server-data:/drone-server-data southbanksoftware/cienvy:node-nm-mongo bash
cd /volumes/
shopt -s extglob
rm -rf !(yarn-cache)
version: '2'
services:
drone-server:
image: drone/drone:latest
container_name: drone-server
restart: always
ports:
- 8000:8000
volumes:
- drone-server-data:/var/lib/drone/
environment:
- GIN_MODE=release
- DRONE_HOST=https://cienvy.au.ngrok.io
- DRONE_GITHUB=true
- DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
- DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
- DRONE_SECRET=${DRONE_SECRET}
- DRONE_OPEN=true
- DRONE_ADMIN=guiguan,joeyzhao0113
- DRONE_TIMEOUT=120m
- DRONE_TIMEOUT_INACTIVITY=120m
drone-agent:
image: drone/drone:latest
command: agent
restart: always
depends_on:
- drone-server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DRONE_SERVER=ws://drone-server:8000/ws/broker
- DRONE_SECRET=${DRONE_SECRET}
- DRONE_TIMEOUT=120m
- DRONE_TIMEOUT_INACTIVITY=120m
- DRONE_MAX_PROCS=5
volumes:
drone-server-data:
external: true
drone secret add --repository SouthbankSoftware/${REPO_NAME} --name SSH_PRIVATE_KEY --value="$(cat ${KEY_PATH})"
ngrokngrok http -subdomain=cienvy -region au 8000
You can make use of CIEnvy either through its REST API or provided CIEnvy Client
Access CIEnvy's Swagger UI: http://localhost:3030/docs
Authenticate with SBS Developer Credential by POSTing following JSON to /authentication
{
"email":"${DEVELOPER_EMAIL}",
"password":"${DEVELOPER_PASSWORD}",
"payload":{
"userId": null
}
}
Get the returned accessToken, and use a Chrome plugin, such as Modify Headers, to modify request header: Authorization: Bearer ${accessToken}

This is a node based client lib. You can find more details from here
yarn test
cienvy
├── config: yaml configuration files
├── data: databases and temp data
│ ├── template: database templates
│ ├── *.db: databases
│ └── workspace: cienvy host level data
├── docs: auto-generated source code documentation
├── misc: miscellaneous stuffs
├── node_modules: node dependencies
├── public: static web hosting files
├── src: source code
│ ├── controllers: service controllers
│ ├── hooks: Feathers global hooks
│ ├── middleware: Feathers middleware
│ ├── services: Feathers services
│ └── app/index.js: entrypoint
└── tests: unit test code
Content type
Image
Digest
Size
225.8 MB
Last updated
about 9 years ago
docker pull southbanksoftware/cienvy