aboutsummaryrefslogtreecommitdiffhomepage
path: root/.circleci
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-08-26 15:56:39 +0200
committerBjørn Erik Pedersen <[email protected]>2024-08-26 15:56:39 +0200
commit261d7a03ae1e3bb38c59fb88134c2b56fc9e6cb7 (patch)
tree1aa808b802c98ee568e9c1b1369532aca1204672 /.circleci
parent445283a5932b4e0f5fc377478fa1351547ea0426 (diff)
downloadhugo-261d7a03ae1e3bb38c59fb88134c2b56fc9e6cb7.tar.gz
hugo-261d7a03ae1e3bb38c59fb88134c2b56fc9e6cb7.zip
Revert "Adjust Circleci workflow to make the Docker images build"
This reverts commit 445283a5932b4e0f5fc377478fa1351547ea0426.
Diffstat (limited to '.circleci')
-rw-r--r--.circleci/build.yml120
-rw-r--r--.circleci/config.yml132
2 files changed, 111 insertions, 141 deletions
diff --git a/.circleci/build.yml b/.circleci/build.yml
deleted file mode 100644
index e3e0073f6..000000000
--- a/.circleci/build.yml
+++ /dev/null
@@ -1,120 +0,0 @@
-version: 2.1
-
-# Passed from config.yml
-parameters:
- skip:
- type: boolean
- default: true
-
-defaults: &defaults
- resource_class: large
- docker:
- - image: bepsays/ci-hugoreleaser:1.22300.20000
-environment: &buildenv
- GOMODCACHE: /root/project/gomodcache
-jobs:
- prepare_release:
- <<: *defaults
- environment: &buildenv
- GOMODCACHE: /root/project/gomodcache
- steps:
- - &remote-docker
- setup_remote_docker:
- version: 20.10.14
- - checkout:
- path: hugo
- - &git-config
- run:
- command: |
- git config --global user.email "[email protected]"
- git config --global user.name "hugoreleaser"
- - run:
- command: |
- cd hugo
- go mod download
- go run -tags release main.go release --step 1
- - save_cache:
- key: git-sha-{{ .Revision }}
- paths:
- - hugo
- - gomodcache
- build_container1:
- <<: [*defaults]
- environment:
- <<: [*buildenv]
- steps:
- - &restore-cache
- restore_cache:
- key: git-sha-{{ .Revision }}
- - run:
- no_output_timeout: 20m
- command: |
- mkdir -p /tmp/files/dist1
- cd hugo
- hugoreleaser build -paths "builds/container1/**" -workers 3 -dist /tmp/files/dist1 -chunks $CIRCLE_NODE_TOTAL -chunk-index $CIRCLE_NODE_INDEX
- - &persist-workspace
- persist_to_workspace:
- root: /tmp/files
- paths:
- - dist1
- - dist2
- parallelism: 7
- build_container2:
- <<: [*defaults]
- environment:
- <<: [*buildenv]
- docker:
- - image: bepsays/ci-hugoreleaser-linux-arm64:1.22300.20000
- steps:
- - *restore-cache
- - &attach-workspace
- attach_workspace:
- at: /tmp/workspace
- - run:
- command: |
- mkdir -p /tmp/files/dist2
- cd hugo
- hugoreleaser build -paths "builds/container2/**" -workers 1 -dist /tmp/files/dist2
- - *persist-workspace
- archive_and_release:
- <<: [*defaults]
- environment:
- <<: [*buildenv]
- steps:
- - *restore-cache
- - *attach-workspace
- - *git-config
- - run:
- name: Add github.com to known hosts
- command: ssh-keyscan github.com >> ~/.ssh/known_hosts
- - run:
- command: |
- cp -a /tmp/workspace/dist1/. ./hugo/dist
- cp -a /tmp/workspace/dist2/. ./hugo/dist
- - run:
- command: |
- cd hugo
- hugoreleaser archive
- hugoreleaser release
- go run -tags release main.go release --step 2
-workflows:
- release:
- when:
- and:
- - equal: [false, << pipeline.parameters.skip >>]
- jobs:
- - prepare_release:
- filters:
- branches:
- only: /release-.*/
- - build_container1:
- requires:
- - prepare_release
- - build_container2:
- requires:
- - prepare_release
- - archive_and_release:
- context: org-global
- requires:
- - build_container1
- - build_container2
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 588d3d894..0ff955936 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,27 +1,117 @@
-version: 2.1
-setup: true
-orbs:
- continuation: circleci/continuation@1
+parameters:
+
+# v2: 11m.
+defaults: &defaults
+ resource_class: large
+ docker:
+ - image: bepsays/ci-hugoreleaser:1.22300.20000
+environment: &buildenv
+ GOMODCACHE: /root/project/gomodcache
+version: 2
jobs:
- setup:
+ prepare_release:
+ <<: *defaults
+ environment: &buildenv
+ GOMODCACHE: /root/project/gomodcache
+ steps:
+ - &remote-docker
+ setup_remote_docker:
+ version: 20.10.14
+ - checkout:
+ path: hugo
+ - &git-config
+ run:
+ command: |
+ git config --global user.email "[email protected]"
+ git config --global user.name "hugoreleaser"
+ - run:
+ command: |
+ cd hugo
+ go mod download
+ go run -tags release main.go release --step 1
+ - save_cache:
+ key: git-sha-{{ .Revision }}
+ paths:
+ - hugo
+ - gomodcache
+ build_container1:
+ <<: [*defaults]
+ environment:
+ <<: [*buildenv]
+ steps:
+ - &restore-cache
+ restore_cache:
+ key: git-sha-{{ .Revision }}
+ - run:
+ no_output_timeout: 20m
+ command: |
+ mkdir -p /tmp/files/dist1
+ cd hugo
+ hugoreleaser build -paths "builds/container1/**" -workers 3 -dist /tmp/files/dist1 -chunks $CIRCLE_NODE_TOTAL -chunk-index $CIRCLE_NODE_INDEX
+ - &persist-workspace
+ persist_to_workspace:
+ root: /tmp/files
+ paths:
+ - dist1
+ - dist2
+ parallelism: 7
+ build_container2:
+ <<: [*defaults]
+ environment:
+ <<: [*buildenv]
docker:
- - image: cimg/go:1.21
+ - image: bepsays/ci-hugoreleaser-linux-arm64:1.22300.20000
steps:
- - checkout
+ - *restore-cache
+ - &attach-workspace
+ attach_workspace:
+ at: /tmp/workspace
- run:
command: |
- export SKIP=$(git log -n 1 $CIRCLE_SHA1 --pretty=%B | grep -q "NOCIRCLECI" && echo "true" || echo "false")
- echo "{\"skip\": $SKIP}" >> set-up-params.json
- - continuation/continue:
- parameters: set-up-params.json
- configuration_path: .circleci/build.yml
-
+ mkdir -p /tmp/files/dist2
+ cd hugo
+ hugoreleaser build -paths "builds/container2/**" -workers 1 -dist /tmp/files/dist2
+ - *persist-workspace
+ archive_and_release:
+ <<: [*defaults]
+ environment:
+ <<: [*buildenv]
+ steps:
+ - *restore-cache
+ - *attach-workspace
+ - *git-config
+ - run:
+ name: Add github.com to known hosts
+ command: ssh-keyscan github.com >> ~/.ssh/known_hosts
+ - run:
+ command: |
+ cp -a /tmp/workspace/dist1/. ./hugo/dist
+ cp -a /tmp/workspace/dist2/. ./hugo/dist
+ - run:
+ command: |
+ cd hugo
+ hugoreleaser archive
+ hugoreleaser release
+ go run -tags release main.go release --step 2
workflows:
- configure:
- when:
- and:
- - matches:
- pattern: "^release.+"
- value: << pipeline.git.branch >>
- jobs:
- - setup
+ version: 2
+ release:
+ jobs:
+ - prepare_release:
+ filters:
+ branches:
+ only: /release-.*/
+ - build_container1:
+ requires:
+ - prepare_release
+ - build_container2:
+ requires:
+ - prepare_release
+ - archive_and_release:
+ context: org-global
+ requires:
+ - build_container1
+ - build_container2
+
+
+