diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 07600a161..b8934740d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,21 +2,18 @@ name: Cello CI on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] jobs: - build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build images - run: | - docker build . --file "build_image/docker/common/api-engine/Dockerfile.in" --tag hyperledger/cello-api-engine:$(date +%s) - docker build . --file "build_image/docker/common/nginx/Dockerfile.in" --tag hyperledger/cello-nginx:$(date +%s) - docker build . --file "build_image/docker/common/dashboard/Dockerfile.in" --tag hyperledger/cello-dashboard:$(date +%s) - docker build . --file "build_image/docker/agent/ansible/Dockerfile.in" --tag hyperledger/cello-ansible-agent:$(date +%s) + - uses: actions/checkout@v3 + - name: Build images + run: | + docker build . --file "build_image/docker/common/api-engine/Dockerfile.in" --tag hyperledger/cello-api-engine:$(date +%s) + docker build . --file "build_image/docker/common/nginx/Dockerfile.in" --tag hyperledger/cello-nginx:$(date +%s) + docker build . --file "build_image/docker/common/dashboard/Dockerfile.in" --tag hyperledger/cello-dashboard:$(date +%s) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fdbf6babf..e8d3c4b40 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,44 +4,44 @@ # https://aka.ms/yaml trigger: -- main + - main pool: - vmImage: 'ubuntu-18.04' + vmImage: "ubuntu-18.04" variables: - group: credentials stages: -- stage: PreCheck - displayName: Check license and documents - jobs: - - job: CheckLicenseAndDocs - condition: false - steps: - - template: ci/check-license-and-docs.yml + - stage: PreCheck + displayName: Check license and documents + jobs: + - job: CheckLicenseAndDocs + condition: false + steps: + - template: ci/check-license-and-docs.yml -- stage: ProcessComponents - displayName: ProcessComponents - condition: false - jobs: - - template: ci/process-components.yml - parameters: - param: - - name: dashandapi - pretest: "dashandapi_pre.yml" - posttest: "dashandapi_post.yml" - images: - - imagename: "hyperledger/cello-api-engine" - dockerfile: "build_image/docker/common/api-engine/Dockerfile.in" - - imagename: "hyperledger/cello-nginx" - dockerfile: "build_image/docker/common/nginx/Dockerfile.in" - - imagename: "hyperledger/cello-dashboard" - dockerfile: "build_image/docker/common/dashboard/Dockerfile.in" - - name: ansibleagent - images: - - imagename: "hyperledger/cello-ansible-agent" - dockerfile: "build_image/docker/agent/ansible/Dockerfile.in" + - stage: ProcessComponents + displayName: ProcessComponents + condition: false + jobs: + - template: ci/process-components.yml + parameters: + param: + - name: dashandapi + pretest: "dashandapi_pre.yml" + posttest: "dashandapi_post.yml" + images: + - imagename: "hyperledger/cello-api-engine" + dockerfile: "build_image/docker/common/api-engine/Dockerfile.in" + - imagename: "hyperledger/cello-nginx" + dockerfile: "build_image/docker/common/nginx/Dockerfile.in" + - imagename: "hyperledger/cello-dashboard" + dockerfile: "build_image/docker/common/dashboard/Dockerfile.in" + # - name: ansibleagent + # images: + # - imagename: "hyperledger/cello-ansible-agent" + # dockerfile: "build_image/docker/agent/ansible/Dockerfile.in" # - name: fabricoperator # images: # - imagename: "hyperledger/cello-k8s-operator-agent" diff --git a/build_image/docker/agent/fabric-operator/Dockerfile.in b/build_image/docker/agent/fabric-operator/Dockerfile.in deleted file mode 100644 index 3da5b10d6..000000000 --- a/build_image/docker/agent/fabric-operator/Dockerfile.in +++ /dev/null @@ -1,17 +0,0 @@ -# Dockerfile for hyperledger cello fabirc operator agent -# -# @see https://github.com/hyperledger/cello/tree/master/docs/agents/fabric-operator.md -# -FROM alpine -RUN release=$(wget -O - https://storage.googleapis.com/kubernetes-release/release/stable.txt) && \ - wget https://storage.googleapis.com/kubernetes-release/release/${release}/bin/linux/amd64/kubectl \ - -O /usr/local/bin/kubectl && chmod +x /usr/local/bin/kubectl -RUN apk update && apk add jq gettext curl bash && mkdir /home/app -ADD src/agent/fabric-operator/deploy /home/app -ADD src/agent/fabric-operator/agent /home/app - -ENV HOME /home -WORKDIR /home/app -ENV KUBECONFIG /home/.kube/config - -CMD bash /home/app/deploy_cr.sh diff --git a/build_image/dockerhub/latest/agent/ansible/Dockerfile b/build_image/dockerhub/latest/agent/ansible/Dockerfile deleted file mode 100755 index bf15ec23d..000000000 --- a/build_image/dockerhub/latest/agent/ansible/Dockerfile +++ /dev/null @@ -1,45 +0,0 @@ -# Dockerfile for hyperledger cello ansible agent -# -# @see https://github.com/hyperledger/cello/blob/master/docs/worker_ansible_howto.md -# -FROM alpine/git AS BUILD - -RUN cd /tmp && git init cello && cd cello && \ - git remote add origin https://github.com/hyperledger/cello.git && \ - git config core.sparsecheckout true && \ - echo "src/agent/ansible/*" >> .git/info/sparse-checkout && \ - git pull --depth=1 origin master - -FROM ubuntu:xenial - -MAINTAINER Tong Li - -ARG user=ubuntu -ARG uid=1000 -ARG gid=1000 - -RUN apt-get update && \ - apt-get install -y bash python-pip sudo curl && \ - pip install --upgrade pip ansible pyyaml && \ - groupadd -g ${gid} ${user} && \ - useradd -d /opt/agent -u ${uid} -g ${user} ${user} && \ - usermod -a -G root ${user} && \ - echo "${user} ALL=(ALL) NOPASSWD: ALL"|tee /etc/sudoers.d/${user} && \ - mkdir -p /opt/agent/.ssh && \ - cd /opt/agent/.ssh && \ - echo "host *" > config && \ - echo " StrictHostKeyChecking no" >> config && \ - echo " UserKnownHostsFile /dev/null" >> config - -COPY --from=build /tmp/cello/src/agent/ansible /opt/agent -RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \ - mv kubectl /usr/local/bin/kubectl -RUN chown -R ${uid}:${gid} /opt/agent && \ - chmod 755 /usr/local/bin/kubectl - -ENV HOME /opt/agent -ENV WORKDIR /opt/agent -WORKDIR /opt/agent -USER ${user} - -CMD [ "ansible-playbook", "--version" ] diff --git a/ci/check-component.yml b/ci/check-component.yml index ede688d44..186e10562 100644 --- a/ci/check-component.yml +++ b/ci/check-component.yml @@ -7,10 +7,6 @@ steps: echo Checking changes in ${{ parameters.componentName }} dashandapi=("src/api-engine/" "src/dashboard/" "build_image/docker/common/") - ansibleagent=("src/agent/ansible/" - "build_image/docker/agent/ansible") - fabricoperator=("src/agent/fabric-operator/" - "build_image/docker/fabric-operator/") allchanges=$(git diff --name-only HEAD HEAD~1) echo 'changed files in the pull request' @@ -40,4 +36,4 @@ steps: echo 'No changes found for the component' echo "##vso[task.setvariable variable=ContinueJob]False" fi - displayName: 'Check changes' + displayName: "Check changes"