diff --git a/.drone/drone.yml b/.drone/drone.yml deleted file mode 100644 index 1d608c64d..000000000 --- a/.drone/drone.yml +++ /dev/null @@ -1,144 +0,0 @@ -kind: pipeline -type: exec -name: linux-amd64 - -platform: - arch: amd64 - os: linux - -steps: -- name: test - commands: - - mkdir -p $HOMEPATH/.docker; echo $IMAGE_PULL_SECRETS > $HOMEPATH/.docker/config.json - - make test docker-build-test upload-coverage - environment: - VERSION: ${DRONE_TAG:-latest}-linux-amd64 - DEV_REGISTRY: - from_secret: dev_registry - DRYCC_REGISTRY: - from_secret: drycc_registry - CODECOV_TOKEN: - from_secret: codecov_token - IMAGE_PULL_SECRETS: - from_secret: container_pull_secrets - when: - event: - - push - - tag - - pull_request - -- name: publish - commands: - - echo $CONTAINER_PASSWORD | docker login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1 - - make docker-build docker-immutable-push - environment: - VERSION: ${DRONE_TAG:-latest}-linux-amd64 - DEV_REGISTRY: - from_secret: dev_registry - DRYCC_REGISTRY: - from_secret: drycc_registry - CONTAINER_USERNAME: - from_secret: container_username - CONTAINER_PASSWORD: - from_secret: container_password - when: - event: - - push - - tag - ---- -kind: pipeline -type: exec -name: linux-arm64 - -platform: - arch: arm64 - os: linux - -steps: -- name: publish - commands: - - echo $CONTAINER_PASSWORD | docker login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1 - - make docker-build docker-immutable-push - environment: - VERSION: ${DRONE_TAG:-latest}-linux-arm64 - DEV_REGISTRY: - from_secret: dev_registry - DRYCC_REGISTRY: - from_secret: drycc_registry - CONTAINER_USERNAME: - from_secret: container_username - CONTAINER_PASSWORD: - from_secret: container_password - when: - event: - - push - - tag - ---- -kind: pipeline -type: docker -name: manifest -image_pull_secrets: -- container_pull_secrets - -steps: - -- name: generate manifest - image: registry.drycc.cc/drycc/python-dev - pull: always - commands: - - sed -i "s/registry.drycc.cc/$${DRYCC_REGISTRY}/g" .drone/manifest.tmpl - environment: - DEV_REGISTRY: - from_secret: dev_registry - DRYCC_REGISTRY: - from_secret: drycc_registry - -- name: publish - image: plugins/manifest - settings: - spec: .drone/manifest.tmpl - username: - from_secret: container_username - password: - from_secret: container_password - environment: - DEV_REGISTRY: - from_secret: dev_registry - DRYCC_REGISTRY: - from_secret: drycc_registry - -trigger: - event: - - push - - tag - -depends_on: -- linux-amd64 -- linux-arm64 - ---- -kind: pipeline -type: exec -name: chart - -steps: -- name: generate chart - commands: - - IMAGE_TAG=$([ ! -z $DRONE_TAG ] && echo \"${DRONE_TAG:1}\" || echo \"canary\") - - sed -i "s/imageTag:\ \"canary\"/imageTag:\ $IMAGE_TAG/g" charts/controller/values.yaml - - helm package -u charts/controller --version $([ -z $DRONE_TAG ] && echo 1.0.0 || echo ${DRONE_TAG#v}) - - echo $CONTAINER_PASSWORD | helm registry login $DRYCC_REGISTRY -u $CONTAINER_USERNAME --password-stdin - - helm push controller-$([ -z $DRONE_TAG ] && echo 1.0.0 || echo ${DRONE_TAG#v}).tgz oci://$DRYCC_REGISTRY/$([ -z $DRONE_TAG ] && echo charts-testing || echo charts) - environment: - DRYCC_REGISTRY: - from_secret: drycc_registry - CONTAINER_USERNAME: - from_secret: container_username - CONTAINER_PASSWORD: - from_secret: container_password - when: - event: - - push - - tag diff --git a/.drone/manifest.tmpl b/.drone/manifest.tmpl deleted file mode 100644 index ede243032..000000000 --- a/.drone/manifest.tmpl +++ /dev/null @@ -1,18 +0,0 @@ -image: registry.drycc.cc/drycc/controller:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}canary{{/if}} -{{#if build.tags}} -tags: -{{#each build.tags}} - - {{this}} -{{/each}} -{{/if}} -manifests: - - - image: registry.drycc.cc/drycc/controller:{{#if build.tag}}{{build.tag}}-{{else}}latest-{{/if}}linux-amd64 - platform: - architecture: amd64 - os: linux - - - image: registry.drycc.cc/drycc/controller:{{#if build.tag}}{{build.tag}}-{{else}}latest-{{/if}}linux-arm64 - platform: - architecture: arm64 - os: linux diff --git a/.woodpecker/build-linux.yml b/.woodpecker/build-linux.yml new file mode 100644 index 000000000..a3458744c --- /dev/null +++ b/.woodpecker/build-linux.yml @@ -0,0 +1,29 @@ +matrix: + platform: + - linux/amd64 + - linux/arm64 + +platform: ${platform} + +labels: + type: exec + +pipeline: +- name: publish-linux + image: bash + commands: + - export VERSION=$([ -z $CI_COMMIT_TAG ] && echo latest || echo $CI_COMMIT_TAG)-$(sed 's#/#-#g' <<< $CI_SYSTEM_ARCH) + - echo $CONTAINER_PASSWORD | docker login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1 + - make docker-build docker-immutable-push + secrets: + - dev_registry + - drycc_registry + - container_username + - container_password + when: + event: + - push + - tag + +depends_on: +- test-linux \ No newline at end of file diff --git a/.woodpecker/chart.yaml b/.woodpecker/chart.yaml new file mode 100644 index 000000000..6309adb58 --- /dev/null +++ b/.woodpecker/chart.yaml @@ -0,0 +1,28 @@ +platform: linux/amd64 + +labels: + type: exec + +pipeline: +- name: generate-chart + type: local + image: bash + commands: + - export VERSION=$(sed 's#v##' <<< $CI_COMMIT_TAG) + - export IMAGE_TAG=$([ ! -z $CI_COMMIT_TAG ] && echo \"$VERSION\" || echo \"canary\") + - sed -i "s/imageTag:\ \"canary\"/imageTag:\ $IMAGE_TAG/g" charts/$${CI_REPO_NAME}/values.yaml + - helm package -u charts/$${CI_REPO_NAME} --version $([ -z $CI_COMMIT_TAG ] && echo 1.0.0 || echo $VERSION) + - echo $CONTAINER_PASSWORD | helm registry login $DRYCC_REGISTRY -u $CONTAINER_USERNAME --password-stdin + - helm push $${CI_REPO_NAME}-$([ -z $CI_COMMIT_TAG ] && echo 1.0.0 || echo $VERSION).tgz oci://$DRYCC_REGISTRY/$([ -z $CI_COMMIT_TAG ] && echo charts-testing || echo charts) + secrets: + - dev_registry + - drycc_registry + - container_username + - container_password + when: + event: + - push + - tag + +depends_on: +- manifest diff --git a/.woodpecker/manifest.tmpl b/.woodpecker/manifest.tmpl new file mode 100644 index 000000000..87395350b --- /dev/null +++ b/.woodpecker/manifest.tmpl @@ -0,0 +1,18 @@ +image: registry.drycc.cc/drycc/{{project}}:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}canary{{/if}} +{{#if build.tags}} +tags: +{{#each build.tags}} + - {{this}} +{{/each}} +{{/if}} +manifests: + - + image: registry.drycc.cc/drycc/{{project}}:{{#if build.tag}}{{build.tag}}-{{else}}latest-{{/if}}linux-amd64 + platform: + architecture: amd64 + os: linux + - + image: registry.drycc.cc/drycc/{{project}}:{{#if build.tag}}{{build.tag}}-{{else}}latest-{{/if}}linux-arm64 + platform: + architecture: arm64 + os: linux diff --git a/.woodpecker/manifest.yml b/.woodpecker/manifest.yml new file mode 100644 index 000000000..f7023ffb6 --- /dev/null +++ b/.woodpecker/manifest.yml @@ -0,0 +1,38 @@ +platform: linux/amd64 + +labels: + type: exec + +pipeline: +- name: generate-manifest + image: bash + commands: + - sed -i "s/{{project}}/$${CI_REPO_NAME}/g" .woodpecker/manifest.tmpl + - sed -i "s/registry.drycc.cc/$${DRYCC_REGISTRY}/g" .woodpecker/manifest.tmpl + secrets: + - drycc_registry + when: + event: + - tag + - push + +- name: publish-manifest + image: bash + commands: + - docker run --rm + -e PLUGIN_SPEC=.woodpecker/manifest.tmpl + -e PLUGIN_USERNAME=$CONTAINER_USERNAME + -e PLUGIN_PASSWORD=$CONTAINER_PASSWORD + -v $(pwd):$(pwd) + -w $(pwd) + plugins/manifest + secrets: + - container_username + - container_password + when: + event: + - tag + - push + +depends_on: +- build-linux diff --git a/.woodpecker/test-linux.yml b/.woodpecker/test-linux.yml new file mode 100644 index 000000000..cc3b4b54e --- /dev/null +++ b/.woodpecker/test-linux.yml @@ -0,0 +1,22 @@ +matrix: + platform: + - linux/amd64 + - linux/arm64 + +platform: ${platform} + +labels: + type: exec + +pipeline: +- name: test-linux + image: bash + commands: + - make test docker-build-test upload-coverage + secrets: + - dev_registry + - codecov_token + when: + event: + - push + - tag