mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-20 08:03:53 +08:00
update drone ci config
This commit is contained in:
@@ -21,7 +21,6 @@ ENV GOROOT="/opt/go"
|
|||||||
ENV PATH="/opt/go/bin:${PATH}"
|
ENV PATH="/opt/go/bin:${PATH}"
|
||||||
|
|
||||||
RUN useradd -c "OneCloud Builder" --create-home --home-dir /home/build --shell /bin/bash build
|
RUN useradd -c "OneCloud Builder" --create-home --home-dir /home/build --shell /bin/bash build
|
||||||
USER build
|
|
||||||
ENV HOME /home/build
|
ENV HOME /home/build
|
||||||
WORKDIR /home/build
|
WORKDIR /home/build
|
||||||
|
|
||||||
|
|||||||
134
.drone.yml
134
.drone.yml
@@ -2,49 +2,131 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: build
|
name: build
|
||||||
|
|
||||||
|
clone:
|
||||||
|
depth: 1
|
||||||
|
|
||||||
workspace:
|
workspace:
|
||||||
base: /go
|
base: /home/build/go
|
||||||
path: src/yunion.io/x/onecloud
|
path: src/yunion.io/x/onecloud
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
- name: build
|
||||||
image: d3lx/golang:yunion
|
image: yunion/onecloud-ci:latest
|
||||||
commands:
|
commands:
|
||||||
- make
|
- CGO_ENABLED=0 make -j 4 cmd/apigateway cmd/baremetal-agent cmd/climc cmd/keystone
|
||||||
when:
|
- CGO_ENABLED=0 make -j 4 cmd/logger cmd/region cmd/scheduler cmd/webconsole
|
||||||
event:
|
- CGO_ENABLED=0 make -j 4 cmd/yunionconf cmd/glance cmd/torrent
|
||||||
- pull_request
|
|
||||||
- tag
|
|
||||||
|
|
||||||
trigger:
|
- name: image-baremetal-agent
|
||||||
event:
|
|
||||||
- pull_request
|
|
||||||
- tag
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: release
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: release-img
|
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
repo: registry.cn-beijing.aliyuncs.com/yunionio/onecloud
|
repo: registry.cn-beijing.aliyuncs.com/yunionio/baremetal-agent
|
||||||
registry: registry.cn-beijing.aliyuncs.com
|
registry: registry.cn-beijing.aliyuncs.com
|
||||||
tags: "{DRONE_TAG}"
|
dockerfile: build/docker/Dockerfile.baremetal-agent
|
||||||
|
tags: "${DRONE_TAG}"
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
|
||||||
|
- name: image-climc
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
repo: registry.cn-beijing.aliyuncs.com/yunionio/climc
|
||||||
|
registry: registry.cn-beijing.aliyuncs.com
|
||||||
|
dockerfile: build/docker/Dockerfile.climc
|
||||||
|
tags: "${DRONE_TAG}"
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
|
||||||
|
- name: image-keystone
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
repo: registry.cn-beijing.aliyuncs.com/yunionio/keystone
|
||||||
|
registry: registry.cn-beijing.aliyuncs.com
|
||||||
|
dockerfile: build/docker/Dockerfile.keystone
|
||||||
|
tags: "${DRONE_TAG}"
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
|
||||||
|
- name: image-logger
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
repo: registry.cn-beijing.aliyuncs.com/yunionio/logger
|
||||||
|
registry: registry.cn-beijing.aliyuncs.com
|
||||||
|
dockerfile: build/docker/Dockerfile.logger
|
||||||
|
tags: "${DRONE_TAG}"
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
|
||||||
|
- name: image-region
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
repo: registry.cn-beijing.aliyuncs.com/yunionio/region
|
||||||
|
registry: registry.cn-beijing.aliyuncs.com
|
||||||
|
dockerfile: build/docker/Dockerfile.region
|
||||||
|
tags: "${DRONE_TAG}"
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
|
||||||
|
- name: image-scheduler
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
repo: registry.cn-beijing.aliyuncs.com/yunionio/scheduler
|
||||||
|
registry: registry.cn-beijing.aliyuncs.com
|
||||||
|
dockerfile: build/docker/Dockerfile.scheduler
|
||||||
|
tags: "${DRONE_TAG}"
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
|
||||||
|
- name: image-yunionconf
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
repo: registry.cn-beijing.aliyuncs.com/yunionio/yunionconf
|
||||||
|
registry: registry.cn-beijing.aliyuncs.com
|
||||||
|
dockerfile: build/docker/Dockerfile.yunionconf
|
||||||
|
tags: "${DRONE_TAG}"
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
|
||||||
|
- name: image-apigateway
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
repo: registry.cn-beijing.aliyuncs.com/yunionio/apigateway
|
||||||
|
registry: registry.cn-beijing.aliyuncs.com
|
||||||
|
dockerfile: build/docker/Dockerfile.apigateway
|
||||||
|
tags: "${DRONE_TAG}"
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
|
||||||
|
- name: image-glance
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
repo: registry.cn-beijing.aliyuncs.com/yunionio/glance
|
||||||
|
registry: registry.cn-beijing.aliyuncs.com
|
||||||
|
dockerfile: build/docker/Dockerfile.glance
|
||||||
|
tags: "${DRONE_TAG}"
|
||||||
username:
|
username:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- tag
|
- tag
|
||||||
status:
|
status:
|
||||||
- success
|
- success
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- build
|
|
||||||
|
|||||||
20
Dockerfile
20
Dockerfile
@@ -1,20 +0,0 @@
|
|||||||
FROM alpine:3.8
|
|
||||||
|
|
||||||
MAINTAINER "Zexi Li <lizexi@yunionyun.com>"
|
|
||||||
|
|
||||||
ENV TZ Asia/Shanghai
|
|
||||||
|
|
||||||
# Fix binary file not found, see:
|
|
||||||
# https://stackoverflow.com/questions/34729748/installed-go-binary-not-found-in-path-on-alpine-linux-docker
|
|
||||||
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
|
|
||||||
|
|
||||||
RUN mkdir -p /opt/yunion/bin
|
|
||||||
|
|
||||||
ADD ./_output/bin/climc /opt/yunion/bin/climc
|
|
||||||
ADD ./_output/bin/cloudir /opt/yunion/bin/cloudir
|
|
||||||
ADD ./_output/bin/glance /opt/yunion/bin/glance
|
|
||||||
ADD ./_output/bin/region /opt/yunion/bin/region
|
|
||||||
ADD ./_output/bin/region-dns /opt/yunion/bin/region-dns
|
|
||||||
ADD ./_output/bin/scheduler /opt/yunion/bin/scheduler
|
|
||||||
ADD ./_output/bin/webconsole /opt/yunion/bin/webconsole
|
|
||||||
ADD ./_output/bin/yunionconf /opt/yunion/bin/yunionconf
|
|
||||||
16
build/docker/Dockerfile.apigateway
Normal file
16
build/docker/Dockerfile.apigateway
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
FROM alpine:3.8
|
||||||
|
|
||||||
|
MAINTAINER "Zexi Li <lizexi@yunionyun.com>"
|
||||||
|
|
||||||
|
ENV TZ Asia/Shanghai
|
||||||
|
|
||||||
|
RUN mkdir -p /opt/yunion/bin
|
||||||
|
|
||||||
|
RUN apk update && \
|
||||||
|
apk add --no-cache tzdata && \
|
||||||
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||||
|
|
||||||
|
ADD ./_output/bin/apigateway /opt/yunion/bin/apigateway
|
||||||
|
|
||||||
@@ -4,7 +4,7 @@ MAINTAINER "Zexi Li <lizexi@yunionyun.com>"
|
|||||||
|
|
||||||
ENV TZ Asia/Shanghai
|
ENV TZ Asia/Shanghai
|
||||||
|
|
||||||
RUN apk add --no-cache bash bash-completion && \
|
RUN apk add --no-cache bash bash-completion tzdata && \
|
||||||
rm -rf /var/cache/apk/*
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||||
|
|||||||
Reference in New Issue
Block a user