Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lwydyby/rancher-gitlab-deploy
gitlab ci auto update rancher2 docker project
https://github.com/lwydyby/rancher-gitlab-deploy
Last synced: 8 days ago
JSON representation
gitlab ci auto update rancher2 docker project
- Host: GitHub
- URL: https://github.com/lwydyby/rancher-gitlab-deploy
- Owner: lwydyby
- Created: 2019-04-29T11:41:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-04-29T11:50:21.000Z (over 5 years ago)
- Last Synced: 2024-10-30T04:56:02.841Z (about 2 months ago)
- Language: Shell
- Size: 2.93 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rancher-gitlab-deploy
gitlab ci auto update rancher2 docker projectgitlabci.yml example:
```
image: dockerstages:
- build
- release
- deploy
build:
stage: build
image: node:9.4.0
cache:
paths:
- node_modules/
script:
- npm set registry https://registry.npm.taobao.org
- npm install
- npm run build
artifacts:
paths:
- /dist
job-release:
stage: release
script:
- docker info
- DATE=`date +%Y%m%d`
- TAG=$DATE-$CI_JOB_ID
- docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD} ${DOCKER_REGISTER}
- docker build -t ${DOCKER_REGISTER}/${PROJECT_NAME}:$TAG .
- docker push ${DOCKER_REGISTER}/${PROJECT_NAME}:$TAG
- docker tag ${DOCKER_REGISTER}/${PROJECT_NAME}:$TAG ${DOCKER_REGISTER}/${PROJECT_NAME}:latest
- docker push ${DOCKER_REGISTER}/${PROJECT_NAME}:latestdeploy:
stage: deploy
image: lwydyby/rancher-gitlab-deploy:latest
script:
- bash /data/update.sh ${PROJECT_NAME} ${RANCHER_WORKSPACE} ${RANCHER_NAMESPACE} ${RANCHER_IP} ${RANCHER_TOKEN}
```url: https://'${ip}'/v3/project/'${workspace}'/workloads/deployment:'${namespace}':'${programName}
PROJECT_NAME: Your project name
RANCHER_WORKSPACE: your rancher workspace
RANCHER_NAMESPACE: your rancher namespace
RANCHER_IP: your rancher url
RANCHER_TOKEN: rancher token