Skip to content

Commit

Permalink
shellcheck & cleanup [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
sgarnotel committed Mar 18, 2022
1 parent 754e19b commit fb7e76d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
freefem-docker/ff++-compiled
freefem-docker/freefem.tar.gz
ff++-compiled
freefem.tar.gz
build
3 changes: 1 addition & 2 deletions .jenkins/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

cd freefem-docker \
&& chmod +x ./build.sh \
chmod +x ./build.sh \
&& ./build.sh
6 changes: 3 additions & 3 deletions .jenkins/clean.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

sudo docker container stop $(sudo docker container ls -aq)
sudo docker container rm $(sudo docker container ls -aq)
sudo docker rmi $(sudo docker images -q)
sudo docker container stop "$(sudo docker container ls -aq)"
sudo docker container rm "$(sudo docker container ls -aq)"
sudo docker rmi "$(sudo docker images -q)"
16 changes: 8 additions & 8 deletions .jenkins/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ FILE_NAME='freefem.tar.gz'

# Get the current release number from sources
SOURCE_REPOSITORY='FreeFem-sources'
CURRENT_VERSION=`curl 'https://api.github.com/repos/'$ORGANIZATION'/'$SOURCE_REPOSITORY'/releases/latest' | jq -r '.tag_name'`
CURRENT_VERSION=$(curl "https://api.github.com/repos/$ORGANIZATION/$SOURCE_REPOSITORY/releases/latest" | jq -r '.tag_name')

echo 'Current FreeFEM version: '$CURRENT_VERSION
echo "Current FreeFEM version: $CURRENT_VERSION"

# Create the release (keep the upload url)
RELEASE_PARAMETERS=$(printf '{"tag_name": "%s", "target_commitish": "master", "name": "%s", "body": "FreeFEM docker - FreeFEM %s.", "draft": false, "prerelease": false}' $CURRENT_VERSION $CURRENT_VERSION $CURRENT_VERSION)
RELEASE=`curl -H "Authorization: token $TOKEN" --data "$RELEASE_PARAMETERS" 'https://api.github.com/repos/'$ORGANIZATION'/'$REPOSITORY'/releases'`
UPLOAD_URL=`echo $RELEASE | jq -r '.upload_url'`
echo 'Upload URL: '$UPLOAD_URL
RELEASE_PARAMETERS=$(printf '{"tag_name": "%s", "target_commitish": "master", "name": "%s", "body": "FreeFEM docker - FreeFEM %s.", "draft": false, "prerelease": false}' "$CURRENT_VERSION" "$CURRENT_VERSION" "$CURRENT_VERSION")
RELEASE=$(curl -H "Authorization: token $TOKEN" --data "$RELEASE_PARAMETERS" "https://api.github.com/repos/$ORGANIZATION/$REPOSITORY/releases")
UPLOAD_URL=$(echo "$RELEASE" | jq -r '.upload_url')
echo "Upload URL: $UPLOAD_URL"

# Upload asset
RESPONSE=`curl --data-binary "@$FILE_NAME" -H "Authorization: token $TOKEN" -H "Content-Type: application/octet-stream" "$UPLOAD_URL=$FILE_NAME"`
echo 'Server response: '$RESPONSE
RESPONSE=$(curl --data-binary "@$FILE_NAME" -H "Authorization: token $TOKEN" -H "Content-Type: application/octet-stream" "$UPLOAD_URL=$FILE_NAME")
echo "Server response: $RESPONSE"
8 changes: 4 additions & 4 deletions .jenkins/deployDockerHub.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/bash

# Login
docker login -u sgarnotel -p $DOCKER_TOKEN
docker login -u sgarnotel -p "$DOCKER_TOKEN"

# Get the current release number from sources
ORGANIZATION='FreeFem'
SOURCE_REPOSITORY='FreeFem-sources'
CURRENT_VERSION=`curl 'https://api.github.com/repos/'$ORGANIZATION'/'$SOURCE_REPOSITORY'/releases/latest' | jq -r '.tag_name'`
CURRENT_VERSION=$(curl "https://api.github.com/repos/$ORGANIZATION/$SOURCE_REPOSITORY/releases/latest" | jq -r '.tag_name')

# Tag
docker tag freefem:latest freefem/freefem:latest
docker tag freefem:latest freefem/freefem:$CURRENT_VERSION
docker tag freefem:latest freefem/freefem:"$CURRENT_VERSION"

# Push
docker push freefem/freefem:latest
docker push freefem/freefem:$CURRENT_VERSION
docker push freefem/freefem:"$CURRENT_VERSION"
File renamed without changes.
File renamed without changes.

0 comments on commit fb7e76d

Please sign in to comment.