Skip to content

Commit 8bfef1b

Browse files
committed
replace gocd pipeline with gha pipeline
1 parent 59ded1c commit 8bfef1b

File tree

3 files changed

+43
-54
lines changed

3 files changed

+43
-54
lines changed

.github/workflows/pipeline.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
8+
jobs:
9+
verify_version:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- run: |
14+
/bin/bash -c "./tasks verify_version"
15+
test:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- run: |
20+
sudo git clone https://github.com/bats-core/bats-core /opt/bats-core
21+
sudo git clone https://github.com/bats-core/bats-assert /opt/bats-assert
22+
sudo git clone https://github.com/bats-core/bats-support /opt/bats-support
23+
/bin/bash -c "./tasks test"
24+
release:
25+
runs-on: ubuntu-latest
26+
needs: [verify_version, test]
27+
if: github.ref == 'refs/heads/main'
28+
steps:
29+
- uses: actions/checkout@v4
30+
- run: |
31+
/bin/bash -c "./tasks release"
32+
publish:
33+
runs-on: ubuntu-latest
34+
needs: [release]
35+
environment: test
36+
if: github.ref == 'refs/heads/main'
37+
steps:
38+
- uses: actions/checkout@v4
39+
- name: Publish
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
42+
run: |
43+
/bin/bash -c "./tasks publish"

pipeline.gocd.yaml

Lines changed: 0 additions & 46 deletions
This file was deleted.

tasks

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ case "${command}" in
4141
;;
4242
publish)
4343
# publish the just released version
44-
GITHUB_TOKEN=$(vault read -field=token secret/gocd/github_releases)
45-
export GITHUB_TOKEN
4644
VERSION=$(releaser::get_last_git_tagged_version)
4745
releaser::prepare_github_release_bin
4846
$GHRELEASE_BIN release \
@@ -58,12 +56,6 @@ case "${command}" in
5856
--name "docker-ops" \
5957
--file src/docker-ops
6058
;;
61-
generate_vault_token)
62-
vault_token=$(vault token create -ttl=48h -policy=gocd -field token -metadata gocd_renew=true)
63-
secured_token_gocd=$(secret_ops::encrypt_with_gocd_top "${vault_token}")
64-
echo "Generated token: ${vault_token} and encrypted by GoCD server"
65-
secret_ops::insert_vault_token_gocd_yaml "${secured_token_gocd}"
66-
;;
6759
*)
6860
echo "Invalid command: '${command}'"
6961
exit 1

0 commit comments

Comments
 (0)