From 3b14e6b6b97f49ba6377761ba704e5036258ddbf Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Wed, 9 May 2018 10:00:38 +0200 Subject: [PATCH] chore(codefresh): update codefresh pipelines (#1879) --- .../codefresh_develop.yml | 7 +++ .codefresh/codefresh_pullrequest.yml | 46 +++++++++++++++++++ 2 files changed, 53 insertions(+) rename codefresh.yml => .codefresh/codefresh_develop.yml (83%) create mode 100644 .codefresh/codefresh_pullrequest.yml diff --git a/codefresh.yml b/.codefresh/codefresh_develop.yml similarity index 83% rename from codefresh.yml rename to .codefresh/codefresh_develop.yml index fc22891ed..7a17aee3e 100644 --- a/codefresh.yml +++ b/.codefresh/codefresh_develop.yml @@ -17,10 +17,17 @@ steps: - yarn grunt build-webapp - mv api/cmd/portainer/portainer dist/ + get_docker_version: + image: alpine + working_directory: ${{build_frontend}} + commands: + - cf_export DOCKER_VERSION=`cat gruntfile.js | grep -m 1 'shippedDockerVersion' | cut -d\' -f2` + download_docker_binary: image: busybox working_directory: ${{build_frontend}} commands: + - echo ${{DOCKER_VERSION}} - wget -O /tmp/docker-binaries.tgz https://download.docker.com/linux/static/stable/x86_64/docker-${{DOCKER_VERSION}}.tgz - tar -xf /tmp/docker-binaries.tgz -C /tmp - mv /tmp/docker/docker dist/ diff --git a/.codefresh/codefresh_pullrequest.yml b/.codefresh/codefresh_pullrequest.yml new file mode 100644 index 000000000..e3e2652c0 --- /dev/null +++ b/.codefresh/codefresh_pullrequest.yml @@ -0,0 +1,46 @@ +version: '1.0' +steps: + + build_backend: + image: portainer/golang-builder:ci + working_directory: ${{main_clone}} + commands: + - mkdir -p /go/src/github.com/${{CF_REPO_OWNER}} + - ln -s /codefresh/volume/${{CF_REPO_NAME}}/api /go/src/github.com/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}} + - /build.sh api/cmd/portainer + + build_frontend: + image: portainer/angular-builder:latest + working_directory: ${{build_backend}} + commands: + - yarn + - yarn grunt build-webapp + - mv api/cmd/portainer/portainer dist/ + + get_docker_version: + image: alpine + working_directory: ${{build_frontend}} + commands: + - cf_export DOCKER_VERSION=`cat gruntfile.js | grep -m 1 'shippedDockerVersion' | cut -d\' -f2` + + download_docker_binary: + image: busybox + working_directory: ${{build_frontend}} + commands: + - echo ${{DOCKER_VERSION}} + - wget -O /tmp/docker-binaries.tgz https://download.docker.com/linux/static/stable/x86_64/docker-${{DOCKER_VERSION}}.tgz + - tar -xf /tmp/docker-binaries.tgz -C /tmp + - mv /tmp/docker/docker dist/ + + build_image: + type: build + working_directory: ${{download_docker_binary}} + dockerfile: ./build/linux/Dockerfile + image_name: portainer/portainer + tag: ${{CF_BRANCH}} + + push_image: + type: push + candidate: '${{build_image}}' + tag: 'pr${{CF_PULL_REQUEST_NUMBER}}' + registry: dockerhub