Skip to content

Commit

Permalink
Improvements: VS Code and score-k8s in devcontainer + humctl `0…
Browse files Browse the repository at this point in the history
….25.0` (#33)

* HUMCTL_VERSION: '0.25.0'

* Humanitec VS Code extension in devcontainer

* node-service - alpine:3.20.0

* score-k8s in devcontainer

* gh pr comment

* chmod +x .devcontainer/installMoreTools.sh
  • Loading branch information
mathieu-benoit authored Jun 4, 2024
1 parent 32d068b commit 01d1bed
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
validate-score:
runs-on: ubuntu-latest
env:
HUMCTL_VERSION: '0.23.1'
HUMCTL_VERSION: '0.25.0'
steps:
- name: checkout code
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ concurrency: ${{ github.ref }}

env:
IMAGE: backstage
HUMCTL_VERSION: '0.23.1'
HUMCTL_VERSION: '0.25.0'
# CLOUD_PROVIDER: aws
AWS_REGION: ${{ vars.AWS_REGION }}
AWS_ROLE_ARN: ${{ vars.AWS_ROLE_ARN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"customizations": {
"vscode": {
"extensions": [
"redhat.vscode-yaml"
"redhat.vscode-yaml",
"humanitec.humanitec"
],
"settings": {
"yaml.schemas": {
Expand Down
6 changes: 6 additions & 0 deletions templates/node-service/content/.devcontainer/installMoreTools.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ tar -xvf score-compose_${SCORE_COMPOSE_VERSION}_linux_amd64.tar.gz
chmod +x score-compose
sudo mv score-compose /usr/local/bin

SCORE_K8S_VERSION=$(curl -sL https://api.github.com/repos/score-spec/score-k8s/releases/latest | jq -r .tag_name)
wget https://github.com/score-spec/score-k8s/releases/download/${SCORE_K8S_VERSION}/score-k8s_${SCORE_K8S_VERSION}_linux_amd64.tar.gz
tar -xvf score-k8s_${SCORE_K8S_VERSION}_linux_amd64.tar.gz
chmod +x score-k8s
sudo mv score-k8s /usr/local/bin

HUMCTL_VERSION=$(curl -sL https://api.github.com/repos/humanitec/cli/releases/latest | jq -r .tag_name)
curl -fLO https://github.com/humanitec/cli/releases/download/${HUMCTL_VERSION}/cli_${HUMCTL_VERSION:1}_linux_amd64.tar.gz
tar -xvf cli_${HUMCTL_VERSION:1}_linux_amd64.tar.gz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
env:
APP_NAME: ${{ values.name }}
ENVIRONMENT_ID: {% raw %}pr-${{ github.event.number }}{% endraw %}
HUMCTL_VERSION: '0.23.1'
HUMCTL_VERSION: '0.25.0'

{% raw %}
jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
{%- else -%}
# Unknown cloud provider: ${{ values.cloudProvider }}
{% endif %}
HUMCTL_VERSION: '0.23.1'
HUMCTL_VERSION: '0.25.0'
APP_NAME: ${{ values.name }}

{% raw %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
{% endif %}
BASE_ENVIRONMENT: 'development'
ENVIRONMENT_TYPE: 'development'
HUMCTL_VERSION: '0.23.1'
HUMCTL_VERSION: '0.25.0'
ENVIRONMENT_ID: {% raw %}pr-${{ github.event.number }}{% endraw %}
ENVIRONMENT_NAME: {% raw %}PR-${{ github.event.number }}{% endraw %}

Expand Down Expand Up @@ -252,8 +252,9 @@ jobs:
cat pr_message.txt
- name: Comment PR
if: ${{ always() }}
uses: thollander/actions-comment-pull-request@v2
with:
filePath: pr_message.txt
run: |
gh pr comment ${{ github.event.number }} --repo ${{ github.repository }} --body-file pr_message.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

{% endraw %}
4 changes: 2 additions & 2 deletions templates/node-service/content/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM alpine:3.19.1 as builder
FROM alpine:3.20.0 as builder
RUN apk add --no-cache nodejs npm
COPY package*.json ./
RUN npm install --only=prod

FROM alpine:3.19.1
FROM alpine:3.20.0
RUN apk add --no-cache nodejs
COPY --from=builder /node_modules ./node_modules
COPY index.js index.js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"customizations": {
"vscode": {
"extensions": [
"redhat.vscode-yaml"
"redhat.vscode-yaml",
"humanitec.humanitec"
],
"settings": {
"yaml.schemas": {
Expand Down
6 changes: 6 additions & 0 deletions templates/podinfo-example/content/.devcontainer/installMoreTools.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ tar -xvf score-compose_${SCORE_COMPOSE_VERSION}_linux_amd64.tar.gz
chmod +x score-compose
sudo mv score-compose /usr/local/bin

SCORE_K8S_VERSION=$(curl -sL https://api.github.com/repos/score-spec/score-k8s/releases/latest | jq -r .tag_name)
wget https://github.com/score-spec/score-k8s/releases/download/${SCORE_K8S_VERSION}/score-k8s_${SCORE_K8S_VERSION}_linux_amd64.tar.gz
tar -xvf score-k8s_${SCORE_K8S_VERSION}_linux_amd64.tar.gz
chmod +x score-k8s
sudo mv score-k8s /usr/local/bin

HUMCTL_VERSION=$(curl -sL https://api.github.com/repos/humanitec/cli/releases/latest | jq -r .tag_name)
curl -fLO https://github.com/humanitec/cli/releases/download/${HUMCTL_VERSION}/cli_${HUMCTL_VERSION:1}_linux_amd64.tar.gz
tar -xvf cli_${HUMCTL_VERSION:1}_linux_amd64.tar.gz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
env:
APP_NAME: ${{ values.name }}
ENVIRONMENT_ID: {% raw %}pr-${{ github.event.number }}{% endraw %}
HUMCTL_VERSION: '0.23.1'
HUMCTL_VERSION: '0.25.0'

{% raw %}
jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
{%- else -%}
# Unknown cloud provider: ${{ values.cloudProvider }}
{% endif %}
HUMCTL_VERSION: '0.23.1'
HUMCTL_VERSION: '0.25.0'
APP_NAME: ${{ values.name }}

{% raw %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
{% endif %}
BASE_ENVIRONMENT: 'development'
ENVIRONMENT_TYPE: 'development'
HUMCTL_VERSION: '0.23.1'
HUMCTL_VERSION: '0.25.0'
ENVIRONMENT_ID: {% raw %}pr-${{ github.event.number }}{% endraw %}
ENVIRONMENT_NAME: {% raw %}PR-${{ github.event.number }}{% endraw %}

Expand Down Expand Up @@ -252,8 +252,9 @@ jobs:
cat pr_message.txt
- name: Comment PR
if: ${{ always() }}
uses: thollander/actions-comment-pull-request@v2
with:
filePath: pr_message.txt
run: |
gh pr comment ${{ github.event.number }} --repo ${{ github.repository }} --body-file pr_message.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

{% endraw %}

0 comments on commit 01d1bed

Please sign in to comment.