Skip to content

Commit 63352e2

Browse files
committed
Cleanup
1 parent 342dfdc commit 63352e2

File tree

7 files changed

+120
-100
lines changed

7 files changed

+120
-100
lines changed

.github/workflows/release.yaml

+55-58
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,82 @@
11
name: Release
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
pull_request:
5+
workflow_dispatch:
6+
# push:
7+
# branches:
8+
# - main
79

810
jobs:
911
release:
1012
name: Release
1113
runs-on: ubuntu-24.04
12-
if: github.event.head_commit.message == 'Release'
14+
#if: github.event.head_commit.message == 'Release'
1315
steps:
1416

15-
- name: Notify Slack - Starting
16-
uses: act10ns/slack@v2
17-
with:
18-
status: starting
19-
channel: '#collection_release'
20-
env:
21-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
22-
2317
- name: Checkout
2418
uses: actions/checkout@v4
2519

2620
- name: Set ansible galaxy token
2721
run: |
28-
cat << EOF > ./galaxy_token
22+
cat << EOF > galaxy_token
2923
token: ${{ secrets.ANSIBLE_GALAXY_TOKEN }}
3024
EOF
3125
3226
- name: Set up system
3327
uses: ./.manala/github/system/setup
3428

35-
- name: Get metadata from galaxy.yml
36-
id: metadata
37-
uses: CumulusDS/get-yaml-paths-action@v1.0.2
38-
with:
39-
file: galaxy.yml
40-
version: version
41-
42-
- name: Build
43-
id: build
29+
- name: Get version
30+
id: version
4431
run: |
45-
make build VERBOSE=1
32+
cat << EOF > $GITHUB_OUTPUT
33+
version=$(make version)
34+
EOF
4635
47-
- name: Upload build artifact
48-
uses: actions/upload-artifact@v4
49-
with:
50-
path: ./manala-path-${{ steps.metadata.outputs.version }}.tar.gz
51-
name: manala-path-${{ steps.metadata.outputs.version }}
52-
retention-days: 1
36+
- run: |
37+
cat galaxy_token
38+
cat aa${{ steps.version.outputs.version }}zz
5339
54-
- name: Publish
55-
id: publish
56-
run: |
57-
make publish VERBOSE=1
40+
# - name: Build
41+
# id: build
42+
# run: |
43+
# make build VERBOSE=1
44+
45+
# - name: Upload build artifact
46+
# uses: actions/upload-artifact@v4
47+
# with:
48+
# path: build/manala-path-${{ steps.version.outputs.version }}.tar.gz
49+
# name: manala-path-${{ steps.version.outputs.version }}.tar.gz
50+
51+
# - name: Publish
52+
# id: publish
53+
# run: |
54+
# make publish VERBOSE=1
5855

59-
- name: Get Changelog entry
60-
id: changelog
61-
uses: mindsers/changelog-reader-action@v2
62-
with:
63-
path: ./CHANGELOG.md
64-
version: ${{ steps.metadata.outputs.version }}
56+
# - name: Get Changelog entry
57+
# id: changelog
58+
# uses: mindsers/changelog-reader-action@v2
59+
# with:
60+
# path: CHANGELOG.md
61+
# version: ${{ steps.version.outputs.version }}
6562

66-
- name: Create GitHub Release
67-
id: release
68-
uses: ncipollo/release-action@v1
69-
with:
70-
name: manala-path ${{ steps.metadata.outputs.version }}
71-
tag: ${{ steps.metadata.outputs.version }}
72-
body: ${{ steps.changelog.outputs.changes }}
73-
artifacts: ./manala-path-${{ steps.metadata.outputs.version }}.tar.gz
74-
token: ${{ secrets.GITHUB_TOKEN }}
75-
skipIfReleaseExists: true
63+
# - name: Create GitHub Release
64+
# id: release
65+
# uses: ncipollo/release-action@v1
66+
# with:
67+
# name: ${{ steps.version.outputs.version }}
68+
# tag: ${{ steps.version.outputs.version }}
69+
# body: ${{ steps.changelog.outputs.changes }}
70+
# artifacts: build/manala-path-${{ steps.version.outputs.version }}.tar.gz
71+
# token: ${{ secrets.GITHUB_TOKEN }}
72+
# skipIfReleaseExists: true
7673

77-
- name: Notify Slack - Status
78-
uses: act10ns/slack@v2
79-
with:
80-
status: ${{ job.status }}
81-
steps: ${{ toJson(steps) }}
82-
channel: '#collection_release'
83-
env:
84-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
85-
if: always()
74+
# - name: Notify Slack - Status
75+
# uses: act10ns/slack@v2
76+
# with:
77+
# status: ${{ job.status }}
78+
# steps: ${{ toJson(steps) }}
79+
# channel: '#collection_release'
80+
# env:
81+
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
82+
# if: always()

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1+
build/
12
.env.local
23
galaxy_token
3-
manala-path-*

.manala/docker/Dockerfile

+26-15
Original file line numberDiff line numberDiff line change
@@ -12,51 +12,62 @@ ARG MANALA_GROUP_ID="1000"
1212
ARG GOSU_VERSION="1.17"
1313
ARG GOMPLATE_VERSION="4.1.0"
1414
ARG DIRENV_VERSION="2.34.0"
15+
ARG JQ_VERSION="1.7.1"
16+
ARG YQ_VERSION="4.44.3"
1517

1618
# The 'container' environment variable tells systemd that it's running inside a
1719
# Docker container environment.
1820
# It's also internally used for checking we're running inside a container.
1921
ENV container="docker"
2022

2123
# Default locale
22-
ENV LANG C.UTF-8
24+
ENV LANG="C.UTF-8"
2325

2426
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
2527

2628
RUN \
2729
apt-get --quiet update \
2830
&& apt-get --quiet --yes --purge --autoremove upgrade \
2931
&& apt-get --quiet --yes --no-install-recommends --verbose-versions install \
30-
s6 \
31-
sudo \
32-
curl \
33-
ca-certificates \
34-
gnupg \
35-
libarchive-tools bzip2 \
3632
bash-completion \
37-
rsync \
33+
bzip2 \
34+
ca-certificates \
35+
curl \
3836
git \
39-
make \
37+
gnupg \
4038
less \
41-
vim \
39+
libarchive-tools \
40+
make \
41+
rsync \
42+
s6 \
4243
socat \
44+
sudo \
45+
vim \
4346
# User
4447
&& addgroup --gid ${MANALA_GROUP_ID} lazy \
4548
&& adduser --home /home/lazy --shell /bin/bash --uid ${MANALA_USER_ID} --gecos lazy --ingroup lazy --disabled-password lazy \
4649
&& install --verbose --mode 0755 --group lazy --owner lazy --directory /run/user/${MANALA_USER_ID} \
4750
&& echo "lazy ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/lazy \
4851
# Gosu
49-
&& curl -sSL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(case $(dpkg --print-architecture) in "amd64") echo "amd64" ;; "arm64") echo "arm64" ;; esac)" \
52+
&& curl -sSLf "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(case $(dpkg --print-architecture) in "amd64") echo "amd64" ;; "arm64") echo "arm64" ;; esac)" \
5053
--output /usr/local/bin/gosu \
5154
&& chmod +x /usr/local/bin/gosu \
5255
# Gomplate
53-
&& curl -sSL "https://github.com/hairyhenderson/gomplate/releases/download/v${GOMPLATE_VERSION}/gomplate_linux-$(case $(dpkg --print-architecture) in "amd64") echo "amd64" ;; "arm64") echo "arm64" ;; esac)" \
56+
&& curl -sSLf "https://github.com/hairyhenderson/gomplate/releases/download/v${GOMPLATE_VERSION}/gomplate_linux-$(case $(dpkg --print-architecture) in "amd64") echo "amd64" ;; "arm64") echo "arm64" ;; esac)" \
5457
--output /usr/local/bin/gomplate \
5558
&& chmod +x /usr/local/bin/gomplate \
5659
# Direnv
57-
&& curl -sSL "https://github.com/direnv/direnv/releases/download/v${DIRENV_VERSION}/direnv.linux-$(case $(dpkg --print-architecture) in "amd64") echo "amd64" ;; "arm64") echo "arm64" ;; esac)" \
60+
&& curl -sSLf "https://github.com/direnv/direnv/releases/download/v${DIRENV_VERSION}/direnv.linux-$(case $(dpkg --print-architecture) in "amd64") echo "amd64" ;; "arm64") echo "arm64" ;; esac)" \
5861
--output /usr/local/bin/direnv \
5962
&& chmod +x /usr/local/bin/direnv \
63+
# Jq
64+
&& curl -sSLf "https://github.com/jqlang/jq/releases/download/jq-${JQ_VERSION}/jq-linux-$(case $(dpkg --print-architecture) in "amd64") echo "amd64" ;; "arm64") echo "arm64" ;; esac)" \
65+
--output /usr/local/bin/jq \
66+
&& chmod +x /usr/local/bin/jq \
67+
# Yq
68+
&& curl -sSLf "https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_$(case $(dpkg --print-architecture) in "amd64") echo "amd64" ;; "arm64") echo "arm64" ;; esac)" \
69+
--output /usr/local/bin/yq \
70+
&& chmod +x /usr/local/bin/yq \
6071
# Bash completion
6172
&& install --verbose --mode 0755 --directory /etc/bash_completion.d \
6273
# Oh My Bash
@@ -75,11 +86,11 @@ RUN \
7586
apt-get --quiet update \
7687
&& apt-get --quiet --yes --no-install-recommends --verbose-versions install \
7788
openssh-client \
78-
sshpass \
79-
python3 \
8089
pipx \
90+
python3 \
8191
python3-argcomplete \
8292
shellcheck \
93+
sshpass \
8394
# Sudo
8495
&& echo "Defaults env_keep += \"PIPX_*\"" > /etc/sudoers.d/pipx \
8596
# Bash completion

.manala/docker/compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ services:
1111
build:
1212
context: ..
1313
dockerfile: docker/Dockerfile
14-
image: manala-ansible-path:20240913091855
14+
image: manala-ansible-path:20240916085125
1515
volumes:
1616
- ../..:${MANALA_DIR}
1717
environment:

Makefile

+29-16
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
include .manala/Makefile
44

5+
NAMESPACE = manala
6+
COLLECTION = path
7+
VERSION = $(shell yq '.version' galaxy.yml)
8+
9+
###########
10+
# Version #
11+
###########
12+
13+
## Version - Get collection version
14+
version: SHELL := $(MANALA_DOCKER_SHELL)
15+
version:
16+
printf $(VERSION)
17+
.PHONY: version
18+
519
########
620
# Lint #
721
########
@@ -18,11 +32,11 @@ lint:
1832
# Test #
1933
########
2034

21-
## Test - Run all tests (but doc and coverage)
35+
## Test - Run all collection tests (but doc and coverage)
2236
test: test.sanity test.units test.integration
2337
.PHONY: test
2438

25-
## Test - Run sanity tests [VERBOSE]
39+
## Test - Run collection sanity tests [VERBOSE]
2640
test.sanity: SHELL := $(MANALA_DOCKER_SHELL)
2741
test.sanity:
2842
ansible-test sanity \
@@ -35,7 +49,7 @@ test.sanity:
3549
--exclude .manala/
3650
.PHONY: test.sanity
3751

38-
## Test - Run units tests [VERBOSE|COVERAGE]
52+
## Test - Run collection units tests [VERBOSE|COVERAGE]
3953
test.units: SHELL := $(MANALA_DOCKER_SHELL)
4054
test.units:
4155
ansible-test units \
@@ -47,7 +61,7 @@ test.units:
4761
--color yes
4862
.PHONY: test.units
4963

50-
## Test - Run integration tests [VERBOSE|COVERAGE]
64+
## Test - Run collection integration tests [VERBOSE|COVERAGE]
5165
test.integration: SHELL := $(MANALA_DOCKER_SHELL)
5266
test.integration:
5367
ansible-test integration \
@@ -59,20 +73,20 @@ test.integration:
5973
--color yes
6074
.PHONY: test.integration
6175

62-
## Test - Run documentation tests [VERBOSE]
76+
## Test - Run collection documentation tests [VERBOSE]
6377
test.doc: SHELL := $(MANALA_DOCKER_SHELL)
6478
test.doc:
6579
$(foreach type,module filter, \
66-
$(foreach plugin,$(shell ansible-doc --list manala.path --type $(type) | cut -d " " -f 1), \
80+
$(foreach plugin,$(shell ansible-doc --list $(NAMESPACE).$(COLLECTION) --type $(type) --json | jq --raw-output 'keys[]'), \
6781
ansible-doc \
6882
$(if $(VERBOSE), --verbose) \
6983
--type $(type) \
70-
$(plugin) && \
84+
$(plugin) > /dev/null && \
7185
) \
7286
) true
7387
.PHONY: test.doc
7488

75-
## Test - Run coverage [VERBOSE]
89+
## Test - Run collection coverage [VERBOSE]
7690
test.coverage: SHELL := $(MANALA_DOCKER_SHELL)
7791
test.coverage:
7892
ansible-test coverage xml \
@@ -89,20 +103,19 @@ test.coverage:
89103
# Build / Publish #
90104
###################
91105

92-
COLLECTION = manala-path-*.tar.gz
93-
94-
## Build - Build collection
106+
## Build - Build collection [VERBOSE]
95107
build: SHELL := $(MANALA_DOCKER_SHELL)
96108
build:
97-
rm -rfv $(COLLECTION)
98109
ansible-galaxy collection build \
99-
$(if $(VERBOSE), --verbose) \
100-
--force
110+
--output-path build \
111+
--force \
112+
$(if $(VERBOSE), --verbose)
113+
101114
.PHONY: build
102115

103-
## Collection - Publish collection
116+
## Publish - Publish collection [VERBOSE]
104117
publish: SHELL := $(MANALA_DOCKER_SHELL)
105118
publish:
106-
ansible-galaxy collection publish $(COLLECTION) \
119+
ansible-galaxy collection publish build/$(NAMESPACE)-$(COLLECTION)-$(VERSION).tar.gz \
107120
$(if $(VERBOSE), --verbose)
108121
.PHONY: publish

README.md

+7-8
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ Note that if you install the collection from Ansible Galaxy, it will not be upgr
3030
ansible-galaxy collection install manala.path --upgrade
3131
```
3232

33-
You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax to install version `1.0.0`:
33+
You can also install a specific version of the collection, for example, if you need to downgrade when something is broken in the latest version (please report an issue in this repository). Use the following syntax to install version `1.1.0`:
3434

3535
```shell
36-
ansible-galaxy collection install manala.path:==1.0.0
36+
ansible-galaxy collection install manala.path:==1.1.0
3737
```
3838

3939
### Installing the Collection from Github
@@ -48,7 +48,7 @@ In case of unavailability of ansible-galaxy, we host a tar.gz of every version o
4848
- requirements.yaml:
4949
```yaml
5050
collections:
51-
- name: https://github.com/manala/ansible-path/releases/download/$VERSION/manala-roles-$VERSION.tar.gz
51+
- name: https://github.com/manala/ansible-path/releases/download/$VERSION/manala-path-$VERSION.tar.gz
5252
type: url
5353
```
5454

@@ -68,11 +68,10 @@ Found a bug ? Please open an [issue](https://github.com/manala/ansible-path/issu
6868

6969
You can contact us [here](manala-io.slack.com)
7070

71-
Any kind of contribution is very welcome, you can submit pull requests [here](https://github.com/manala/ansible-roles/pulls)
71+
Any kind of contribution is very welcome, you can submit pull requests [here](https://github.com/manala/ansible-path/pulls)
7272

73-
This collection uses [molecule](https://github.com/ansible-community/molecule), [ansible-lint](https://github.com/ansible-community/ansible-lint), and `ansible-test` for linting and testing roles.
73+
This collection uses [ansible-lint](https://github.com/ansible-community/ansible-lint), and `ansible-test` for linting and testing roles.
7474

75-
All of these tools are available through the excellent [ansible-toolset](https://github.com/ansible-community/toolset) docker image.
7675

7776
Open a docker shell
7877
```shell
@@ -96,8 +95,8 @@ ansible-test units --python 3.11 tests/unit/plugins/lookup/test_foo.py
9695

9796
This collection is distributed under the MIT license.
9897

99-
See [LICENSE](https://opensource.org/licenses/MIT) to see the full text.
98+
See [LICENSE](LICENSE) to see the full text.
10099

101100
# Author information
102101

103-
Manala [**(http://www.manala.io/)**](http://www.manala.io)
102+
Manala [**(https://www.manala.io/)**](https://www.manala.io/)

0 commit comments

Comments
 (0)