Skip to content

Commit

Permalink
Merge pull request #264 from WeBankPartners/dev
Browse files Browse the repository at this point in the history
release v1.1.0
  • Loading branch information
pobu168 authored Dec 1, 2020
2 parents 6194c3c + 05ecd6c commit b9ccd64
Show file tree
Hide file tree
Showing 134 changed files with 2,459 additions and 11,808 deletions.
8 changes: 0 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
# from platten/alpine-oracle-jre8-docker
# LABEL maintainer = "Webank CTB Team"
# ADD artifacts-core/target/artifacts-core-0.0.1-SNAPSHOT.jar /application/wecube-plugins-artifacts.jar
# ADD build/start.sh /scripts/start.sh
# RUN chmod +x /scripts/start.sh
# ADD build/tomcat_exporter.tar /scripts/
# CMD ["/bin/sh","-c","/scripts/start.sh $WECUBE_GATEWAY_SERVER_URL $ARTIFACTS_S3_SERVER_URL $ARTIFACTS_S3_ACCESS_KEY $ARTIFACTS_S3_SECRET_KEY $ARTIFACTS_NEXUS_SERVER_URL $ARTIFACTS_NEXUS_USERNAME $ARTIFACTS_NEXUS_PASSWORD $ARTIFACTS_NEXUS_REPOSITORY $CMDB_ARTIFACT_PATH $JWT_SIGNING_KEY"]

from sonatype/nexus3:3.27.0
LABEL maintainer = "Webank CTB Team"
USER root
Expand Down
19 changes: 19 additions & 0 deletions Dockerfile_nonexus
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.7-slim
LABEL maintainer = "Webank CTB Team"
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
RUN sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
ADD artifacts-corepy/requirements.txt /tmp/requirements.txt
ADD artifacts-corepy/dist/* /tmp/
RUN mkdir -p /etc/artifacts_corepy/
RUN mkdir -p /var/log/artifacts_corepy/
ADD artifacts-corepy/etc/* /etc/artifacts_corepy/
# Install && Clean up
RUN apt update && apt-get -y install gcc python3-dev && \
pip3 install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com -r /tmp/requirements.txt && \
pip3 install /tmp/*.whl && \
rm -rf /root/.cache && apt autoclean && \
rm -rf /tmp/* /var/lib/apt/* /var/cache/* && \
apt purge -y `cat /var/log/apt/history.log|grep 'Install: '|tail -1| sed 's/Install://'| sed 's/\ /\n/g' | sed '/(/d' | sed '/)/d' | sed ':l;N;s/\n/ /;b l'`
ADD build/start_all.sh /scripts/start_all.sh
RUN chmod +x /scripts/start_all.sh
CMD ["/bin/sh","-c","/scripts/start_all.sh"]
44 changes: 7 additions & 37 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,7 @@ version=$(shell bash ./build/version.sh)
date=$(shell date +%Y%m%d%H%M%S)
project_name=$(shell basename "${current_dir}")
remote_docker_image_registry=ccr.ccs.tencentyun.com/webankpartners/wecube-plugins-artifacts


clean:
rm -rf $(current_dir)/target

.PHONY:build
build: clean
mkdir -p repository
docker run --rm --name wecube-plugins-artifacts-build -v /data/repository:/usr/src/mymaven/repository -v $(current_dir)/build/maven_settings.xml:/usr/share/maven/ref/settings-docker.xml -v $(current_dir):/usr/src/mymaven -w /usr/src/mymaven maven:3.3-jdk-8 mvn -U clean install -Dmaven.test.skip=true -DbuildType=plugin -s /usr/share/maven/ref/settings-docker.xml dependency:resolve

image: build
docker build -t $(project_name):$(version) .

s3_server_url=http://10.10.10.1:9000
s3_access_key=access_key
s3_secret_key=secret_key

.PHONY:package
package: image
rm -rf package
mkdir -p package
cd package && docker save $(project_name):$(version) -o image.tar
cd package && cp ../register.xml .
cd package && sed -i "s~{{REPOSITORY}}~$(project_name)~g" register.xml
cd package && sed -i "s~{{VERSION}}~$(version)~g" register.xml
cd artifacts-ui/dist && zip -r ui.zip .
cd package && cp ../artifacts-ui/dist/ui.zip .
cd package && zip -r $(project_name)-$(version).zip .
docker rmi $(project_name):$(version)

upload: package
$(eval container_id:=$(shell docker run -v $(current_dir)/package:/package -itd --entrypoint=/bin/sh minio/mc))
docker exec $(container_id) mc config host add wecubeS3 $(s3_server_url) $(s3_access_key) $(s3_secret_key) wecubeS3
docker exec $(container_id) mc cp /package/$(project_name)-$(version).zip wecubeS3/wecube-plugin-package-bucket
docker stop $(container_id)
docker rm -f $(container_id)
with_nexus='true'

clean_py:
rm -rf $(current_dir)/artifacts-corepy/dist/
Expand All @@ -53,7 +18,12 @@ build_py: clean_py

image_py: build_py
wget -O nexus-data.tar.gz https://wecube-1259801214.cos.ap-guangzhou.myqcloud.com/nexus-data/nexus-data.tar.gz
docker build -t $(project_name):$(version) .
@if [ $(with_nexus) == 'true' ]; \
then \
docker build -t $(project_name):$(version) .; \
else \
docker build -t $(project_name):$(version) -f Dockerfile_nonexus .; \
fi

package_py: image_py
rm -rf package
Expand Down
135 changes: 0 additions & 135 deletions artifacts-core/.factorypath

This file was deleted.

3 changes: 0 additions & 3 deletions artifacts-core/.gitignore

This file was deleted.

158 changes: 0 additions & 158 deletions artifacts-core/pom.xml

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit b9ccd64

Please sign in to comment.