From 4e20b67277e9834921dd38fba44ada1c9f80e4a1 Mon Sep 17 00:00:00 2001 From: laurens Date: Sun, 19 Apr 2020 17:38:28 +0200 Subject: [PATCH] ST: First build pipeline Pipeline for docker image Pipeline for building st (using docker image from previous pipeline) TODO: No publishing of a release yet, didn't find anything yet to push release to --- .gitignore | 2 ++ README.md | 62 ++++++++++++++++++++++++++++++++++++ pipelines/st/st-image.yml | 25 +++++++++++++++ pipelines/st/st-pipeline.yml | 28 ++++++++++++++++ secrets/.gitkeep | 0 5 files changed, 117 insertions(+) create mode 100644 .gitignore create mode 100644 pipelines/st/st-image.yml create mode 100644 pipelines/st/st-pipeline.yml create mode 100644 secrets/.gitkeep diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..145a9cf --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# No one needs to know my secrets +secrets \ No newline at end of file diff --git a/README.md b/README.md index dd694be..cbaa265 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,71 @@ Concourse scripts This is a collection of concourse CI scripts/pipelines/resources/... I use in my personal CI. Mostly as reference for me if I ever have to setup something. +For now, I didn't setup any credentials manager yet, so all secrets (passwords, usernames, ...) are in separate yaml files (secrets folder). +Once I have setup Vault (or something like that), I can get rid of this folder. + Login to server ------------ ~~~ bash $ fly -t main login -c http://server.lan:8081 ~~~ + +Visit http://server.lan:8081 for the Concourse CI dashboard, download the 'fly' cli tool. + +Suckless Terminal (ST) +------------ + +To setup the st pipelines, we have tree steps: + * Building the st-build docker image + * Building st application + * Publishing the new build if the build step succeeds + +### Building the ST build docker image header ### + +Setup the pipeline with: + +~~~ bash +$ fly -t main set-pipeline -p st-docker -c ./pipelines/st/st-image.yml -l ./secrets/docker-hub.yml +~~~ + +Unpause it (through CLI, can also do this via web browser): +~~~ bash +$ fly -t main unpause-pipeline -p st-docker +~~~ + +Start the build (through CLI, again possible to do this via web browser): +~~~ bash +$ fly -t main trigger-job -j st-docker/publish +~~~ + +### Building the ST application ### + +Setup the pipeline with: + +~~~ bash +$ fly -t main set-pipeline -p st-build -c ./pipelines/st/st-pipeline.yml -l ./secrets/docker-hub.yml +~~~ + +Unpause it (through CLI, can also do this via web browser): +~~~ bash +$ fly -t main unpause-pipeline -p st-build +~~~ + +Start the build (through CLI, again possible to do this via web browser): +~~~ bash +$ fly -t main trigger-job -j st-build/st-job +~~~ + +### Publishing new build/release ### + +This is still a TODO. I haven't found a decent way yet to publish releases/builds to a release page (don't have that either yet...). + + +TODO +------------ + +* Release page +* Push releases to a release page +* Dependency between pipelines + f.e. st-docker should trigger a new build of st-build diff --git a/pipelines/st/st-image.yml b/pipelines/st/st-image.yml new file mode 100644 index 0000000..791c34b --- /dev/null +++ b/pipelines/st/st-image.yml @@ -0,0 +1,25 @@ +resources: +- name: st-git + type: git + source: + uri: https://github.com/laurensmiers/st.git + branch: master + +- name: st-builder-image + type: docker-image + source: + email: ((docker-hub-email)) + username: ((docker-hub-username)) + password: ((docker-hub-password)) + repository: ((docker-hub-username))/st-builder + +jobs: +- name: publish + public: true + serial: true + plan: + - get: st-git + trigger: true + - put: st-builder-image + params: + build: st-git diff --git a/pipelines/st/st-pipeline.yml b/pipelines/st/st-pipeline.yml new file mode 100644 index 0000000..bb823fd --- /dev/null +++ b/pipelines/st/st-pipeline.yml @@ -0,0 +1,28 @@ +resources: + - name: st-git + type: git + icon: github-circle + source: + uri: https://github.com/laurensmiers/st + branch: master + +jobs: + - name: st-job + public: true + plan: + - get: st-git + trigger: true + - task: st-make + config: + platform: linux + image_resource: + type: docker-image + source: + repository: ((docker-hub-username))/st-builder + inputs: + - name: st-git + run: + path: make + args: + - -C + - ./st-git diff --git a/secrets/.gitkeep b/secrets/.gitkeep new file mode 100644 index 0000000..e69de29